[PATCH] D78765: [TRE] Fix bug in handling of switch statements

Layton Kifer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 24 15:44:14 PDT 2020


laytonio marked 2 inline comments as done.
laytonio added inline comments.


================
Comment at: llvm/test/Transforms/TailCallElim/accum_recursion.ll:48
-; CHECK: tailrecurse:
-; CHECK: %accumulator.tr = phi i64 [ %n, %entry ], [ %3, %bb1 ]
-; CHECK: %n.tr = phi i64 [ %n, %entry ], [ %2, %bb1 ]
----------------
Its not valid for us to use %n here as our initial value, since %n would change with each iteration of the recursion.


================
Comment at: llvm/test/Transforms/TailCallElim/accum_recursion.ll:52-53
-; CHECK: switch i64 %n.tr, label %bb1 [
-    i64 0, label %bb2
-    i64 1, label %bb2
   ]
----------------
If only one of these cases resulted in this branch we could replace the %n (see above comment) with the constant. However, we don't whether to choose the 1 or the 0.


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

https://reviews.llvm.org/D78765





More information about the llvm-commits mailing list