[llvm] [AMDGPULowerBufferFatPointers] Simplify and fix GEP offset emission (PR #95115)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 11 07:45:05 PDT 2024


================
@@ -119,7 +124,8 @@ define ptr addrspace(7) @zero_gep_goes_first(ptr addrspace(7) %v0, i32 %arg) {
 ; CHECK-SAME: ({ ptr addrspace(8), i32 } [[V0:%.*]], i32 [[ARG:%.*]]) #[[ATTR0]] {
 ; CHECK-NEXT:    [[V0_RSRC:%.*]] = extractvalue { ptr addrspace(8), i32 } [[V0]], 0
 ; CHECK-NEXT:    [[V0_OFF:%.*]] = extractvalue { ptr addrspace(8), i32 } [[V0]], 1
-; CHECK-NEXT:    [[V2:%.*]] = add i32 [[V0_OFF]], [[ARG]]
+; CHECK-NEXT:    [[V1:%.*]] = add i32 [[V0_OFF]], 0
----------------
krzysz00 wrote:

Silly question: is there a good way to fold away these sort of trivial computations? Because I think I've seen them make their way down into ISel and beyond

(Maybe there's a way to do a localized instcombine?)

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


More information about the llvm-commits mailing list