[llvm] [NVPTX] Add truncate and zero-extend free type conversions (PR #125580)

Alex MacLean via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 16:11:37 PST 2025


================
@@ -150,6 +150,28 @@ class NVPTXTargetLowering : public TargetLowering {
            DstTy->getPrimitiveSizeInBits() == 32;
   }
 
+  bool isTruncateFree(EVT SrcVT, EVT DstVT) const override {
+    // Truncating from i64 to i32 is free
+    if (SrcVT.isInteger() && DstVT.isInteger())
----------------
AlexMaclean wrote:

I think you can just do something like `SrcVT == MVT::i64`

https://github.com/llvm/llvm-project/pull/125580


More information about the llvm-commits mailing list