[PATCH] D61160: [SimplifyCFG] Implement the suggested ctlz transform

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 26 05:48:44 PDT 2019


lebedev.ri added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:5515
+    return false;
+  // TODO a single instruction can be saved on x86 by using cttz over ctlz
+  // when only ctlz results in a subtraction instruction being added
----------------
shawnl wrote:
> jmolloy wrote:
> > This would be a pattern for instcombine to pick up. We shouldn't have to worry about this here.
> Yes we do, because InstCombine does not know how to rearrange case statements.
Sounds like a missed optimization on instcombine side then?
Trying to handle every single unrelated micro-transform in every optimization is a path to failure.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61160





More information about the llvm-commits mailing list