[PATCH] Reassociate: reprocess RedoInsts after each instruction

David Majnemer david.majnemer at gmail.com
Thu Jan 15 11:15:34 PST 2015


================
Comment at: lib/Transforms/Scalar/Reassociate.cpp:2276
@@ +2275,3 @@
+        Instruction *I = RedoInsts.pop_back_val();
+        if(I==II)
+          // Will be processed next iteration on the basic block
----------------
Please insert a space between the if and the parenthesis.

================
Comment at: test/Transforms/Reassociate/crash2.ll:4-19
@@ +3,17 @@
+
+define i32 @foo() {
+wrapper_entry:
+  %0 = udiv i32 1, undef
+  %1 = mul i32 undef, %0
+  %2 = add i32 %1, undef
+  %3 = add i32 %2, 1
+  %4 = add i32 %3, undef
+  %5 = add i32 %3, 1
+  %6 = mul i32 %4, -2
+  %7 = add i32 %5, %6
+  %8 = add i32 %6, %7
+  ; this instruction is intentionally dead
+  %9 = add i32 %8, 1
+  %10 = add i32 undef, %8
+  ret i32 %10
+}
----------------
Your test has no CHECK lines, please consider adding some.

http://reviews.llvm.org/D6995

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






More information about the llvm-commits mailing list