Skip to content

Commit 401f834

Browse files
fixed the implementations of istruncatefree and iszextfree according to nvptx arch.
1 parent f43171b commit 401f834

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3341,26 +3341,20 @@ bool NVPTXTargetLowering::splitValueIntoRegisterParts(
33413341
}
33423342

33433343
bool llvm::NVPTXTargetLowering::isTruncateFree(EVT FromVT, EVT ToVT) const {
3344-
3345-
if (!FromVT.isSimple() || !ToVT.isSimple()) {
3344+
if (FromVT.isVector() || ToVT.isVector() || !FromVT.isInteger() ||
3345+
!ToVT.isInteger()) {
33463346
return false;
33473347
}
33483348

3349-
return (FromVT.getSimpleVT() == MVT::i64 && ToVT.getSimpleVT() == MVT::i32);
3349+
return FromVT.getSizeInBits() == 64 && ToVT.getSizeInBits() == 32;
33503350
}
33513351

33523352
bool llvm::NVPTXTargetLowering::isZExtFree(EVT FromVT, EVT ToVT) const {
3353-
if (!FromVT.isSimple() || !ToVT.isSimple()) {
3354-
return false;
3355-
}
3356-
return (FromVT.getSimpleVT() == MVT::i32 && ToVT.getSimpleVT() == MVT::i64);
3353+
return false;
33573354
}
33583355

33593356
bool llvm::NVPTXTargetLowering::isZExtFree(Type *SrcTy, Type *DstTy) const {
3360-
if (!SrcTy->isIntegerTy() || !DstTy->isIntegerTy())
3361-
return false;
3362-
return SrcTy->getPrimitiveSizeInBits() == 32 &&
3363-
DstTy->getPrimitiveSizeInBits() == 64;
3357+
return false;
33643358
}
33653359

33663360
// This creates target external symbol for a function parameter.

0 commit comments

Comments
 (0)