summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2019-11-10 16:20:19 -0800
committerCraig Topper <craig.topper@gmail.com>2019-11-10 16:25:25 -0800
commitaafde063aaf09285c701c80cd4b543c2beb523e8 (patch)
treeaafc61f30d67000f64d9409ca7025a382ff1e2c5 /llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll
parentd37db750c25dc3a7da66c97d973f7a64b7bf907b (diff)
downloadbcm5719-llvm-aafde063aaf09285c701c80cd4b543c2beb523e8.tar.gz
bcm5719-llvm-aafde063aaf09285c701c80cd4b543c2beb523e8.zip
[InstCombine] Turn (extractelement <1 x i64/double> (bitcast (x86_mmx))) into a single bitcast from x86_mmx to i64/double.
The _m64 type is represented in IR as <1 x i64>. The x86-64 ABI on Linux passes <1 x i64> as a double. MMX intrinsics use x86_mmx type in IR.These things result in a lot of bitcasts in mmx code. There's another instcombine that tries to turn bitcast <1 x i64> to double into extractelement and a bitcast. The combine here tries to reverse this extractelement conversion if we see an mmx type.
Diffstat (limited to 'llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll b/llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll
index 486a78529c5..21c8e78bbb1 100644
--- a/llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll
+++ b/llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll
@@ -59,8 +59,7 @@ define <1 x i64> @f(x86_mmx %y) {
define double @g(x86_mmx %x) {
; CHECK-LABEL: @g(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[BC:%.*]] = bitcast x86_mmx %x to <1 x double>
-; CHECK-NEXT: [[TMP0:%.*]] = extractelement <1 x double> [[BC]], i32 0
+; CHECK-NEXT: [[TMP0:%.*]] = bitcast x86_mmx [[X:%.*]] to double
; CHECK-NEXT: ret double [[TMP0]]
;
entry:
OpenPOWER on IntegriCloud