diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-01-27 11:19:11 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-01-27 11:19:11 +0000 |
commit | 914f8c4825140a97219e94b815beb2bc77395d10 (patch) | |
tree | e805607941f621af83fdd47b7c5b175986f7a6af /test | |
parent | 16f95669ec814d98ce28ad514df603c01d662ee8 (diff) | |
download | external_llvm-914f8c4825140a97219e94b815beb2bc77395d10.zip external_llvm-914f8c4825140a97219e94b815beb2bc77395d10.tar.gz external_llvm-914f8c4825140a97219e94b815beb2bc77395d10.tar.bz2 |
When the legalizer is splitting vector shifts, the result may not have the right shift amount type.
Fix that by adding a cast to the shift expander. This came up with vector shifts
on sse-less X86 CPUs.
<2 x i64> = shl <2 x i64> <2 x i64>
-> i64,i64 = shl i64 i64; shl i64 i64
-> i32,i32,i32,i32 = shl_parts i32 i32 i64; shl_parts i32 i32 i64
Now we cast the last two i64s to the right type. Fixes the crash in PR14668.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173615 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/legalize-shift-64.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/X86/legalize-shift-64.ll b/test/CodeGen/X86/legalize-shift-64.ll index c9f2fc2..71ef2d3 100644 --- a/test/CodeGen/X86/legalize-shift-64.ll +++ b/test/CodeGen/X86/legalize-shift-64.ll @@ -54,3 +54,14 @@ define i64 @test4(i64 %xx, i32 %test) nounwind { ; CHECK: orl %esi, %eax ; CHECK: sarl %cl, %edx } + +; PR14668 +define <2 x i64> @test5(<2 x i64> %A, <2 x i64> %B) { + %shl = shl <2 x i64> %A, %B + ret <2 x i64> %shl +; CHECK: test5 +; CHECK: shl +; CHECK: shldl +; CHECK: shl +; CHECK: shldl +} |