[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/cast-load-gep.ll
Chris Lattner
lattner at cs.uiuc.edu
Sun Jan 30 20:49:38 PST 2005
Changes in directory llvm/test/Regression/Transforms/InstCombine:
cast-load-gep.ll added (r1.1)
---
Log message:
New testcase
---
Diffs of the changes: (+22 -0)
cast-load-gep.ll | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+)
Index: llvm/test/Regression/Transforms/InstCombine/cast-load-gep.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/cast-load-gep.ll:1.1
*** /dev/null Sun Jan 30 22:49:32 2005
--- llvm/test/Regression/Transforms/InstCombine/cast-load-gep.ll Sun Jan 30 22:49:22 2005
***************
*** 0 ****
--- 1,22 ----
+ ; RUN: llvm-as < %s | opt -instcombine -globaldce | llvm-dis | not grep Array
+
+ ; Pulling the cast out of the load allows us to eliminate the load, and then
+ ; the whole array.
+
+ %unop = type {int }
+ %op = type {float}
+
+ %Array = internal constant [1 x %op* (%op*)*] [ %op* (%op*)* %foo ]
+
+ implementation
+
+ %op* %foo(%op* %X) {
+ ret %op* %X
+ }
+
+ %unop* %caller(%op* %O) {
+ %tmp = load %unop* (%op*)** cast ([1 x %op* (%op*)*]* %Array to %unop* (%op*)**)
+ %tmp.2 = call %unop* (%op*)* %tmp(%op* %O)
+ ret %unop* %tmp.2
+ }
+
More information about the llvm-commits
mailing list