summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-07-18 23:06:53 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-07-18 23:06:53 +0000
commit048e78fc5bae72b55f69fd239ab9eb769e9fc92a (patch)
tree70189d5aa60a41372a47e5b0695833cfa28e681f /llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll
parent67038c1333482fe2669455d67d797274be4ff8ef (diff)
downloadbcm5719-llvm-048e78fc5bae72b55f69fd239ab9eb769e9fc92a.tar.gz
bcm5719-llvm-048e78fc5bae72b55f69fd239ab9eb769e9fc92a.zip
Canonicalize bitcasts between types like <1 x i64> and i64 to
insertelement/extractelement. I'm not entirely sure this is precisely what we want to do: should we prefer bitcast(insertelement) or insertelement(bitcast)? Similarly. should we prefer extractelement(bitcast) or bitcast(extractelement)? llvm-svn: 76345
Diffstat (limited to 'llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll b/llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll
new file mode 100644
index 00000000000..6bb986a2eb9
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll
@@ -0,0 +1,22 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep element | count 4
+
+define double @a(<1 x i64> %y) {
+ %c = bitcast <1 x i64> %y to double
+ ret double %c
+}
+
+define i64 @b(<1 x i64> %y) {
+ %c = bitcast <1 x i64> %y to i64
+ ret i64 %c
+}
+
+define <1 x i64> @c(double %y) {
+ %c = bitcast double %y to <1 x i64>
+ ret <1 x i64> %c
+}
+
+define <1 x i64> @d(i64 %y) {
+ %c = bitcast i64 %y to <1 x i64>
+ ret <1 x i64> %c
+}
+
OpenPOWER on IntegriCloud