[PATCH] Handle some cases of mismatched types in IRCE

Philip Reames listmail at philipreames.com
Wed Jan 21 16:01:50 PST 2015


LGTM once comments are addressed.


================
Comment at: lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:666
@@ -665,1 +665,3 @@
+  if (isa<SCEVCouldNotCompute>(CIVComparedToSCEV) ||
+      CIVComparedToSCEV->getType() != LatchCount->getType()) {
     FailureReason = "could not relate CIV to latch expression";
----------------
Given these are non obvious, can you comment how such a scenario arises?  Doesn't have to be repeated at each place, but some hint somewhere?

================
Comment at: lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp:1136
@@ -1121,1 +1135,3 @@
   auto &R1Value = R1.getValue();
+  if (R1Value.first->getType() != R2.first->getType())
+    return None;
----------------
Maybe add a TODO:?  

================
Comment at: test/Transforms/IRCE/bug-mismatched-types.ll:5
@@ +4,3 @@
+entry:
+  br label %for.body
+
----------------
Add check lines and/or comments.

http://reviews.llvm.org/D7082

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list