[PATCH] D47928: [SimplifyIndVars] Eliminate redundant truncs

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 18:30:02 PDT 2018


reames added inline comments.


================
Comment at: lib/Transforms/Utils/SimplifyIndVar.cpp:514
+          HasSignedComparisonUser = true;
+        else
+          HasUnsignedComparisonUser = true;
----------------
This appears to be treating eq/ne as unsigned?  Is that intentional?  If so, probably worth a comment.


================
Comment at: lib/Transforms/Utils/SimplifyIndVar.cpp:580
 
+  if (auto *TI = dyn_cast<TruncInst>(UseInst))
+    if (eliminateTrunc(TI))
----------------
I'm missing something.  Why do this via a new Trunc specific routine that has to look at users instead of just looking at the icmp directly?  We do end up processing it don't we?


https://reviews.llvm.org/D47928





More information about the llvm-commits mailing list