diff options
| author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-12-09 01:19:50 +0000 |
|---|---|---|
| committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2015-12-09 01:19:50 +0000 |
| commit | 97564c3a1b015a5212cab9dfe048425fcb00ff97 (patch) | |
| tree | 0735ff9dc9cbc6637af62b4ce9304275d89fd324 /llvm/test/CodeGen/ARM | |
| parent | b8dced5dfa3b5abba27898dfd0a8341995756584 (diff) | |
| download | bcm5719-llvm-97564c3a1b015a5212cab9dfe048425fcb00ff97.tar.gz bcm5719-llvm-97564c3a1b015a5212cab9dfe048425fcb00ff97.zip | |
[AArch64][ARM] Don't base interleaved op legality on type alloc size.
Otherwise, we think that most types that look like they'd fit in a
legal vector type are legal (so, basically, *any* vector type with a
size between 33 and 128 bits, I think, since we use pow2 alignment;
e.g., v2i25, v3f32, ...).
DataLayout::getTypeAllocSize rounds up based on alignment.
When checking for target intrinsic legality, that's not what we want:
if rounding makes a difference, the type isn't legal, and the
target intrinsics shouldn't be used, as they are always assumed legal.
One could make the argument that alloc size is ultimately the most
relevant here, since we're dealing with LD/ST intrinsics. That's only
true if we did legalize them though; that's a problem for another day.
Use DataLayout::getTypeSizeInBits instead of getTypeAllocSizeInBits.
Type::getSizeInBits can't be used because that'd gratuitously break
pointer vector support.
Some of these uses are currently fine, because we only hit them when
the type is already known legal (e.g., r114454). Update them for
consistency. It's faster to avoid the rounding anyway!
llvm-svn: 255089
Diffstat (limited to 'llvm/test/CodeGen/ARM')
| -rw-r--r-- | llvm/test/CodeGen/ARM/arm-interleaved-accesses.ll | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/arm-interleaved-accesses.ll b/llvm/test/CodeGen/ARM/arm-interleaved-accesses.ll index c3aa2d6b4da..002e71f6d9b 100644 --- a/llvm/test/CodeGen/ARM/arm-interleaved-accesses.ll +++ b/llvm/test/CodeGen/ARM/arm-interleaved-accesses.ll @@ -264,3 +264,43 @@ define void @store_address_space(<2 x i32>* %A, <2 x i32>* %B, <4 x i32> addrspa store <4 x i32> %interleaved, <4 x i32> addrspace(1)* %C ret void } + +; Check that we do something sane with illegal types. + +; NEON-LABEL: load_illegal_factor2: +; NEON: BB#0: +; NEON-NEXT: vld1.64 {d16, d17}, [r0:128] +; NEON-NEXT: vuzp.32 q8, {{.*}} +; NEON-NEXT: vmov r0, r1, d16 +; NEON-NEXT: vmov r2, r3, {{.*}} +; NEON-NEXT: mov pc, lr +; NONEON-LABEL: load_illegal_factor2: +; NONEON: BB#0: +; NONEON-NEXT: ldr [[ELT0:r[0-9]+]], [r0] +; NONEON-NEXT: ldr r1, [r0, #8] +; NONEON-NEXT: mov r0, [[ELT0]] +; NONEON-NEXT: mov pc, lr +define <3 x float> @load_illegal_factor2(<3 x float>* %p) nounwind { + %tmp1 = load <3 x float>, <3 x float>* %p, align 16 + %tmp2 = shufflevector <3 x float> %tmp1, <3 x float> undef, <3 x i32> <i32 0, i32 2, i32 undef> + ret <3 x float> %tmp2 +} + +; This lowering isn't great, but it's at least correct. + +; NEON-LABEL: store_illegal_factor2: +; NEON: BB#0: +; NEON-NEXT: vldr d17, [sp] +; NEON-NEXT: vmov d16, r2, r3 +; NEON-NEXT: vuzp.32 q8, {{.*}} +; NEON-NEXT: vstr d16, [r0] +; NEON-NEXT: mov pc, lr +; NONEON-LABEL: store_illegal_factor2: +; NONEON: BB#0: +; NONEON-NEXT: stm r0, {r1, r3} +; NONEON-NEXT: mov pc, lr +define void @store_illegal_factor2(<3 x float>* %p, <3 x float> %v) nounwind { + %tmp1 = shufflevector <3 x float> %v, <3 x float> undef, <3 x i32> <i32 0, i32 2, i32 undef> + store <3 x float> %tmp1, <3 x float>* %p, align 16 + ret void +} |

