[llvm] [SimplifyCFG] Don't separate a load/store from its gep during sinking (PR #102318)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 20 00:37:57 PDT 2024


================
@@ -1975,13 +1984,13 @@ define void @store_with_non_sunk_gep(i1 %cond, ptr %p.a, ptr %p.b, i64 %a, i64 %
 ; CHECK:       if:
 ; CHECK-NEXT:    call void @dummy()
 ; CHECK-NEXT:    [[GEP_A:%.*]] = getelementptr i8, ptr [[P_A:%.*]], i64 [[A:%.*]]
----------------
nikic wrote:

This is because sinking the GEP would require two phis, while only one is allowed, see https://github.com/llvm/llvm-project/blob/f322f4a55e8a60b996a0a9f0b3fe924c7af2cb1b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp#L2363

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


More information about the llvm-commits mailing list