[llvm-commits] [llvm] r160778 - in /llvm/trunk: lib/Transforms/Scalar/Reassociate.cpp test/Transforms/Reassociate/2012-05-08-UndefLeak.ll test/Transforms/Reassociate/mightymul.ll
Duncan Sands
baldrick at free.fr
Thu Jul 26 02:26:40 PDT 2012
Author: baldrick
Date: Thu Jul 26 04:26:40 2012
New Revision: 160778
URL: http://llvm.org/viewvc/llvm-project?rev=160778&view=rev
Log:
Stop reassociate from looking through expressions of arbitrary complexity. This
is a temporary measure until my fix for PR13021 is ready.
Added:
llvm/trunk/test/Transforms/Reassociate/mightymul.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
llvm/trunk/test/Transforms/Reassociate/2012-05-08-UndefLeak.ll
Modified: llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp?rev=160778&r1=160777&r2=160778&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Reassociate.cpp Thu Jul 26 04:26:40 2012
@@ -543,6 +543,7 @@
// Update the number of paths to the leaf.
IncorporateWeight(It->second, Weight, Opcode);
+#if 0 // TODO: Re-enable once PR13021 is fixed.
// The leaf already has one use from inside the expression. As we want
// exactly one such use, drop this new use of the leaf.
assert(!Op->hasOneUse() && "Only one use, but we got here twice!");
@@ -559,6 +560,7 @@
Leaves.erase(It);
continue;
}
+#endif
// If we still have uses that are not accounted for by the expression
// then it is not safe to modify the value.
Modified: llvm/trunk/test/Transforms/Reassociate/2012-05-08-UndefLeak.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Reassociate/2012-05-08-UndefLeak.ll?rev=160778&r1=160777&r2=160778&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Reassociate/2012-05-08-UndefLeak.ll (original)
+++ llvm/trunk/test/Transforms/Reassociate/2012-05-08-UndefLeak.ll Thu Jul 26 04:26:40 2012
@@ -1,6 +1,8 @@
; RUN: opt < %s -reassociate -S | FileCheck %s
; PR12169
; PR12764
+; XFAIL: *
+; Transform disabled until PR13021 is fixed.
define i64 @f(i64 %x0) {
; CHECK: @f
Added: llvm/trunk/test/Transforms/Reassociate/mightymul.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Reassociate/mightymul.ll?rev=160778&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/Reassociate/mightymul.ll (added)
+++ llvm/trunk/test/Transforms/Reassociate/mightymul.ll Thu Jul 26 04:26:40 2012
@@ -0,0 +1,35 @@
+; RUN: opt < %s -reassociate
+; PR13021
+
+define i32 @foo(i32 %x) {
+ %t0 = mul i32 %x, %x
+ %t1 = mul i32 %t0, %t0
+ %t2 = mul i32 %t1, %t1
+ %t3 = mul i32 %t2, %t2
+ %t4 = mul i32 %t3, %t3
+ %t5 = mul i32 %t4, %t4
+ %t6 = mul i32 %t5, %t5
+ %t7 = mul i32 %t6, %t6
+ %t8 = mul i32 %t7, %t7
+ %t9 = mul i32 %t8, %t8
+ %t10 = mul i32 %t9, %t9
+ %t11 = mul i32 %t10, %t10
+ %t12 = mul i32 %t11, %t11
+ %t13 = mul i32 %t12, %t12
+ %t14 = mul i32 %t13, %t13
+ %t15 = mul i32 %t14, %t14
+ %t16 = mul i32 %t15, %t15
+ %t17 = mul i32 %t16, %t16
+ %t18 = mul i32 %t17, %t17
+ %t19 = mul i32 %t18, %t18
+ %t20 = mul i32 %t19, %t19
+ %t21 = mul i32 %t20, %t20
+ %t22 = mul i32 %t21, %t21
+ %t23 = mul i32 %t22, %t22
+ %t24 = mul i32 %t23, %t23
+ %t25 = mul i32 %t24, %t24
+ %t26 = mul i32 %t25, %t25
+ %t27 = mul i32 %t26, %t26
+ %t28 = mul i32 %t27, %t27
+ ret i32 %t28
+}
More information about the llvm-commits
mailing list