[llvm] Check for side effects when lowering target intrinsics, update NVVM ldu/ldg intrinsics with IntrWillReturn and test for DCE (PR #98968)
Kevin McAfee via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 22 14:50:28 PDT 2024
================
@@ -148,3 +148,129 @@ define <2 x half> @test_ldg_v2f16(ptr addrspace(1) %ptr) {
%val = tail call <2 x half> @llvm.nvvm.ldg.global.f.v2f16.p1(ptr addrspace(1) %ptr, i32 4)
ret <2 x half> %val
}
+
+; CHECK-LABEL: test_ldu_i8_dead
+define void @test_ldu_i8_dead(ptr addrspace(1) %ptr) {
+ ; CHECK-NOT: ldu.global.u8
----------------
kalxr wrote:
Previously these weren't getting deleted before codegen since they weren't `willReturn`. With the added `IntrWillReturn` attribute they can be deleted in the middle end, so I'll get rid of these tests and make ones to reflect that.
https://github.com/llvm/llvm-project/pull/98968
More information about the llvm-commits
mailing list