AArch64: fix one more place movi.2d could be created.

Somehow got missed out of r320965.

llvm-svn: 321162
This commit is contained in:
Tim Northover 2017-12-20 10:45:39 +00:00
parent fffa8229e3
commit 6db5d027c6
2 changed files with 23 additions and 0 deletions

View File

@ -583,6 +583,20 @@ void AArch64AsmPrinter::EmitInstruction(const MachineInstr *MI) {
switch (MI->getOpcode()) {
default:
break;
case AArch64::MOVIv2d_ns:
// If the target has <rdar://problem/16473581>, lower this
// instruction to movi.16b instead.
if (STI->hasZeroCycleZeroingFPWorkaround() &&
MI->getOperand(1).getImm() == 0) {
MCInst TmpInst;
TmpInst.setOpcode(AArch64::MOVIv16b_ns);
TmpInst.addOperand(MCOperand::createReg(MI->getOperand(0).getReg()));
TmpInst.addOperand(MCOperand::createImm(MI->getOperand(1).getImm()));
EmitToStreamer(*OutStreamer, TmpInst);
return;
}
break;
case AArch64::DBG_VALUE: {
if (isVerbose() && OutStreamer->hasRawTextSupport()) {
SmallString<128> TmpStr;

View File

@ -87,4 +87,13 @@ for.end:
ret double %v0
}
define <2 x i64> @t6() {
; ALL-LABEL: t6:
; CYCLONE: movi.16b v0, #0
; KRYO: movi v0.2d, #0000000000000000
; FALKOR: movi v0.2d, #0000000000000000
ret <2 x i64> zeroinitializer
}
declare double @sin(double)