aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-05-14 19:56:14 +0000
committerChris Lattner <sabre@nondot.org>2002-05-14 19:56:14 +0000
commitf54d0dea8faa11fbae4cf7d6505414564f4ddfa9 (patch)
tree3ec35182a7e39b7aabb63f9fa8763284825c18cd
parent86c25fd5560dd9df92ccfd37ffa2dba1a007eeae (diff)
New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2628 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/GCSE/2002-05-14-OperandSwap.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/Transforms/GCSE/2002-05-14-OperandSwap.ll b/test/Transforms/GCSE/2002-05-14-OperandSwap.ll
new file mode 100644
index 0000000000..a75e298f7f
--- /dev/null
+++ b/test/Transforms/GCSE/2002-05-14-OperandSwap.ll
@@ -0,0 +1,18 @@
+; This entire chain of computation should be optimized away, but
+; wasn't because the two multiplies were not detected as being identical.
+;
+; RUN: if as < %s | opt -gcse -instcombine -dce | dis | grep sub
+; RUN: then exit 1
+; RUN: else exit 0
+; RUN: fi
+
+implementation ; Functions:
+
+uint "vnum_test4"(uint* %data) {
+ %reg1101 = load uint* %data, uint 1
+ %reg1111 = load uint* %data, uint 3
+ %reg109 = mul uint %reg1101, %reg1111
+ %reg108 = mul uint %reg1111, %reg1101
+ %reg121 = sub uint %reg108, %reg109
+ ret uint %reg121
+}