diff options
author | Quentin Colombet <qcolombet@apple.com> | 2017-11-18 04:28:58 +0000 |
---|---|---|
committer | Quentin Colombet <qcolombet@apple.com> | 2017-11-18 04:28:58 +0000 |
commit | 63816c09573a459d5cbf6dbd2f7c34bd3adcfc3a (patch) | |
tree | b065421cbe7999fa84b7f583ee838760dcb7a91c /llvm/lib | |
parent | fe538f71453dd7eb750c3861e47a4b9014e6382c (diff) | |
download | bcm5719-llvm-63816c09573a459d5cbf6dbd2f7c34bd3adcfc3a.tar.gz bcm5719-llvm-63816c09573a459d5cbf6dbd2f7c34bd3adcfc3a.zip |
[AArch64] Map G_STORE on FPR when the source comes from a FPR copy
We used to detect that stores were fed by fp instructions, but we were
failing to take into account cases where this happens through copies.
For instance, stores can be fed by copies coming from the ABI lowering
of floating point arguments.
llvm-svn: 318588
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp b/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp index 5289063ca2b..9940a74d7a8 100644 --- a/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp @@ -611,7 +611,15 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const { if (!VReg) break; MachineInstr *DefMI = MRI.getVRegDef(VReg); - if (isPreISelGenericFloatingPointOpcode(DefMI->getOpcode())) + unsigned DefOpc = DefMI->getOpcode(); + if (isPreISelGenericFloatingPointOpcode(DefOpc) || + // Check if we come from a copy-like instruction with + // floating point constraints. In that case, we are still + // fed by fp instructions, but indirectly + // (e.g., through ABI copies). + ((DefOpc == TargetOpcode::COPY || DefMI->isPHI()) && + getRegBank(DefMI->getOperand(0).getReg(), MRI, TRI) == + &AArch64::FPRRegBank)) OpRegBankIdx[0] = PMI_FirstFPR; break; } |