[llvm] [AMDGPU][DAG] Remove AssertZext before some intrinsics (PR #146052)

Pierre van Houtryve via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 30 00:01:58 PDT 2025


================
@@ -3985,6 +3985,24 @@ SDValue AMDGPUTargetLowering::performAssertSZExtCombine(SDNode *N,
     }
   }
 
+  // AssertZext in front of these intrinsics is not necessary, the lowering of
+  // the intrinsics into a register read will insert one if it is needed.
----------------
Pierre-vh wrote:

> We should probably skip adding it from the original callsite if the known range is already implied by the intrinsic declaration

AssertZext is added here because of the range attribute on the return value of the intrinsic, it's on purpose

Would it be better if I added a AMDGPU specific combine to simplify and+assert_zext instead?

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


More information about the llvm-commits mailing list