[clang] [llvm] [ValueLattice][SCCP] Do not track undefs (PR #107105)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 3 06:22:29 PDT 2024


================
@@ -35,6 +35,7 @@ typedef unsigned long long uint64_t;
 // CHECK:       while.cond.i:
 // CHECK-NEXT:    [[__TAGP_ADDR_0_I:%.*]] = phi ptr [ [[P:%.*]], [[ENTRY:%.*]] ], [ [[__TAGP_ADDR_1_I:%.*]], [[CLEANUP_I:%.*]] ]
 // CHECK-NEXT:    [[__R_0_I:%.*]] = phi i64 [ 0, [[ENTRY]] ], [ [[__R_1_I:%.*]], [[CLEANUP_I]] ]
+// CHECK-NEXT:    [[RETVAL_0_I:%.*]] = phi i64 [ undef, [[ENTRY]] ], [ [[RETVAL_1_I:%.*]], [[CLEANUP_I]] ]
----------------
nikic wrote:

This test shows clear regressions. This is because we emit returns as stores to alloca and branch to common return block. For constant returns from blocks we can now end up with extra phi nodes due to the undef input introduced by mem2reg :(

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


More information about the cfe-commits mailing list