[X86] Fix creating vreg def after use.

llvm-svn: 296601
This commit is contained in:
Ayman Musa 2017-03-01 10:20:48 +00:00
parent 9108644dbf
commit 9b802e4650
1 changed files with 10 additions and 5 deletions

View File

@ -2423,17 +2423,22 @@ bool X86FastISel::X86SelectFPExtOrFPTrunc(const Instruction *I,
if (OpReg == 0)
return false;
unsigned ImplicitDefReg;
if (Subtarget->hasAVX()) {
ImplicitDefReg = createResultReg(RC);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
TII.get(TargetOpcode::IMPLICIT_DEF), ImplicitDefReg);
}
unsigned ResultReg = createResultReg(RC);
MachineInstrBuilder MIB;
MIB = BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, TII.get(TargetOpc),
ResultReg);
if (Subtarget->hasAVX()) {
unsigned ImplicitDefReg = createResultReg(RC);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc,
TII.get(TargetOpcode::IMPLICIT_DEF), ImplicitDefReg);
if (Subtarget->hasAVX())
MIB.addReg(ImplicitDefReg);
}
MIB.addReg(OpReg);
updateValueMap(I, ResultReg);
return true;