[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll
Reid Spencer
reid at x10sys.com
Sun Nov 26 21:07:12 PST 2006
Changes in directory llvm/test/Regression/Transforms/InstCombine:
cast-and-cast.ll added (r1.1)
---
Log message:
Add a test to ensure a bitcast/and/trunc combination eliminates the bitcast.
---
Diffs of the changes: (+14 -0)
cast-and-cast.ll | 14 ++++++++++++++
1 files changed, 14 insertions(+)
Index: llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll
diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll:1.1
*** /dev/null Sun Nov 26 23:07:08 2006
--- llvm/test/Regression/Transforms/InstCombine/cast-and-cast.ll Sun Nov 26 23:06:58 2006
***************
*** 0 ****
--- 1,14 ----
+ ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast
+ bool %test1(uint %val) {
+ %t1 = bitcast uint %val to int
+ %t2 = and int %t1, 1
+ %t3 = trunc int %t2 to bool
+ ret bool %t3
+ }
+
+ short %test1(uint %val) {
+ %t1 = bitcast uint %val to int
+ %t2 = and int %t1, 1
+ %t3 = trunc int %t2 to short
+ ret short %t3
+ }
More information about the llvm-commits
mailing list