[llvm] [NVPTX] Implement `isTruncateFree(EVT FromVT, EVT ToVT)` (PR #138605)
Alex MacLean via llvm-commits
llvm-commits at lists.llvm.org
Mon May 5 16:14:18 PDT 2025
================
@@ -155,11 +155,19 @@ class NVPTXTargetLowering : public TargetLowering {
Instruction *I = nullptr) const override;
bool isTruncateFree(Type *SrcTy, Type *DstTy) const override {
- // Truncating 64-bit to 32-bit is free in SASS.
- if (!SrcTy->isIntegerTy() || !DstTy->isIntegerTy())
+ if (!(SrcTy->isIntegerTy() && DstTy->isIntegerTy()))
return false;
- return SrcTy->getPrimitiveSizeInBits() == 64 &&
- DstTy->getPrimitiveSizeInBits() == 32;
+ if (SrcTy->getPrimitiveSizeInBits() <= DstTy->getPrimitiveSizeInBits())
+ return false;
----------------
AlexMaclean wrote:
Would it be valid to call `isTruncateFree` if either of these conditions were not already met?
https://github.com/llvm/llvm-project/pull/138605
More information about the llvm-commits
mailing list