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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 12:22:54 PDT 2020


efriedma added a comment.

In general, I think it has to look something like that, yes.  You have to keep the value from the first iteration in a PHI node like %accumulator.tr.  You need a select in the loop to consistently take the value from the first iteration.  And you need a select before the return to check if there's a valid value in %accumulator.tr.  Otherwise, the dominance doesn't work out in general, and you're back in isDynamicConstant() territory.  Later loop optimizations should be able to simplify it to something sane in most cases.


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

https://reviews.llvm.org/D78765





More information about the llvm-commits mailing list