forked from OSchip/llvm-project
[FastISel][AArch64] Use the proper FMOV instruction to materialize a +0.0.
Use FMOVWSr/FMOVXDr instead of FMOVSr/FMOVDr, which have the proper register class to be used with the zero register. This makes the MachineInstruction verifier happy again. This is related to <rdar://problem/18027157>. llvm-svn: 216040
This commit is contained in:
parent
a0b988cb63
commit
0781b860e4
|
@ -291,7 +291,7 @@ unsigned AArch64FastISel::AArch64MaterializeFP(const ConstantFP *CFP, MVT VT) {
|
|||
// register, because the immediate version of fmov cannot encode zero.
|
||||
if (Val.isPosZero()) {
|
||||
unsigned ZReg = Is64Bit ? AArch64::XZR : AArch64::WZR;
|
||||
unsigned Opc = Is64Bit ? AArch64::FMOVDr : AArch64::FMOVSr;
|
||||
unsigned Opc = Is64Bit ? AArch64::FMOVXDr : AArch64::FMOVWSr;
|
||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(Opc), ResultReg)
|
||||
.addReg(ZReg, getKillRegState(true));
|
||||
return ResultReg;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: llc -O0 -fast-isel-abort -mtriple=arm64-apple-darwin < %s | FileCheck %s
|
||||
; RUN: llc -O0 -fast-isel-abort -verify-machineinstrs -mtriple=arm64-apple-darwin < %s | FileCheck %s
|
||||
|
||||
; Materialize using fmov
|
||||
define float @fmov_float1() {
|
||||
|
|
Loading…
Reference in New Issue