[PATCH] D24280: [IndVarSimplify] Wisely choose sext or zext when widening IV

Li Huang via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 13:07:12 PDT 2016


lihuang marked an inline comment as done.

================
Comment at: lib/Transforms/Scalar/IndVarSimplify.cpp:1331-1332
@@ -1291,3 +1330,4 @@
   // Our raison d'etre! Eliminate sign and zero extension.
-  if (IsSigned ? isa<SExtInst>(DU.NarrowUse) : isa<ZExtInst>(DU.NarrowUse)) {
+  if ((isa<SExtInst>(DU.NarrowUse) && canWidenBySExt()) ||
+      (isa<ZExtInst>(DU.NarrowUse) && canWidenByZExt())) {
     Value *NewDef = DU.WideDef;
----------------
Good suggestion :) I changed them to lambdas


https://reviews.llvm.org/D24280





More information about the llvm-commits mailing list