aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/Reassociate/crash.ll
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2012-06-27 14:19:00 +0000
committerDuncan Sands <baldrick@free.fr>2012-06-27 14:19:00 +0000
commit2d5f8ca3d180832d168e59e2bf3d85317e86287d (patch)
tree7a246e2eee83dd669994e9699ce4e624d720407b /test/Transforms/Reassociate/crash.ll
parent4acefe192f02849bcb2fd620a9f507c00d39a686 (diff)
downloadexternal_llvm-2d5f8ca3d180832d168e59e2bf3d85317e86287d.zip
external_llvm-2d5f8ca3d180832d168e59e2bf3d85317e86287d.tar.gz
external_llvm-2d5f8ca3d180832d168e59e2bf3d85317e86287d.tar.bz2
Some reassociate optimizations create new instructions, which they insert just
before the expression root. Any existing operators that are changed to use one of them needs to be moved between it and the expression root, and recursively for the operators using that one. When I rewrote RewriteExprTree I accidentally inverted the logic, resulting in the compacting going down from operators to operands rather than up from operands to the operators using them, oops. Fix this, resolving PR12963. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159265 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/Reassociate/crash.ll')
-rw-r--r--test/Transforms/Reassociate/crash.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Transforms/Reassociate/crash.ll b/test/Transforms/Reassociate/crash.ll
index e2ebcdd..a99c844 100644
--- a/test/Transforms/Reassociate/crash.ll
+++ b/test/Transforms/Reassociate/crash.ll
@@ -119,3 +119,17 @@ for.cond: ; preds = %for.cond, %entry
%conv = zext i16 %p to i32
br label %for.cond
}
+
+; PR12963
+@a = external global i8
+define i8 @f0(i8 %x) {
+ %t0 = load i8* @a
+ %t1 = mul i8 %x, %x
+ %t2 = mul i8 %t1, %t1
+ %t3 = mul i8 %t2, %t2
+ %t4 = mul i8 %t3, %x
+ %t5 = mul i8 %t4, %t4
+ %t6 = mul i8 %t5, %x
+ %t7 = mul i8 %t6, %t0
+ ret i8 %t7
+}