[PATCH] D124552: CodeGenPrepare: Replace constant PHI arguments with switch condition value

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 9 20:15:28 PDT 2022


MatzeB added inline comments.


================
Comment at: llvm/test/Transforms/CodeGenPrepare/X86/switch-phi-const.ll:67
+  %x2 = phi i32 [ 50, %bb0 ], [ 50, %bb0 ], [ %x1, %case_42 ]
+  %x2.2 = phi i32 [ 51, %bb0 ], [ 51, %bb0 ], [ %x1, %case_42 ]
+  store i32 %x2, i32* @effect, align 4
----------------
spatel wrote:
> We should have another smaller test that does have multiple phis in a block but without multiple cases. That would still be replaced, right?
Of course the number of PHIs shouldn't matter. This here just demonstrates a case label reachable by 2 case values and in that case we shouldn't replace by either of them (hence 2 PHIs to test for the two case values).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124552/new/

https://reviews.llvm.org/D124552



More information about the llvm-commits mailing list