1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[AArch64][GlobalISel] Don't form truncstores in postlegalizer-lowering for s128.

We don't support truncating s128 stores, so don't form them.
This commit is contained in:
Amara Emerson 2021-07-20 00:03:37 -07:00
parent afd4fe3364
commit c7647f3217
2 changed files with 20 additions and 1 deletions

View File

@ -959,7 +959,10 @@ static bool matchFormTruncstore(MachineInstr &MI, MachineRegisterInfo &MRI,
if (MRI.getType(DstReg).isVector()) if (MRI.getType(DstReg).isVector())
return false; return false;
// Match a store of a truncate. // Match a store of a truncate.
return mi_match(DstReg, MRI, m_GTrunc(m_Reg(SrcReg))); if (!mi_match(DstReg, MRI, m_GTrunc(m_Reg(SrcReg))))
return false;
// Only form truncstores for value types of max 64b.
return MRI.getType(SrcReg).getSizeInBits() <= 64;
} }
static bool applyFormTruncstore(MachineInstr &MI, MachineRegisterInfo &MRI, static bool applyFormTruncstore(MachineInstr &MI, MachineRegisterInfo &MRI,

View File

@ -32,3 +32,19 @@ body: |
%trunc:_(<4 x s8>) = G_TRUNC %val %trunc:_(<4 x s8>) = G_TRUNC %val
G_STORE %trunc(<4 x s8>), %ptr(p0) :: (store (<4 x s8>)) G_STORE %trunc(<4 x s8>), %ptr(p0) :: (store (<4 x s8>))
... ...
---
name: truncstore_too_large
legalized: true
body: |
bb.0.entry:
liveins: $x0
; CHECK-LABEL: name: truncstore_too_large
; CHECK: %ptr:_(p0) = COPY $x0
; CHECK: %val:_(s128) = COPY $q0
; CHECK: %trunc:_(s32) = G_TRUNC %val(s128)
; CHECK: G_STORE %trunc(s32), %ptr(p0) :: (store (s32))
%ptr:_(p0) = COPY $x0
%val:_(s128) = COPY $q0
%trunc:_(s32) = G_TRUNC %val
G_STORE %trunc(s32), %ptr(p0) :: (store (s32))
...