forked from OSchip/llvm-project
[FastISel] Fix a potential bug in FastEmitInst_ri
FastEmitInst_ri was constraining the first operand without checking if it is a virtual register. Use constrainOperandRegClass as all the other FastEmitInst_* functions. llvm-svn: 216613
This commit is contained in:
parent
0b9bab48bb
commit
833bc681e3
|
@ -1816,8 +1816,7 @@ unsigned FastISel::FastEmitInst_ri(unsigned MachineInstOpcode,
|
|||
const MCInstrDesc &II = TII.get(MachineInstOpcode);
|
||||
|
||||
unsigned ResultReg = createResultReg(RC);
|
||||
RC = TII.getRegClass(II, II.getNumDefs(), &TRI, *FuncInfo.MF);
|
||||
MRI.constrainRegClass(Op0, RC);
|
||||
Op0 = constrainOperandRegClass(II, Op0, II.getNumDefs());
|
||||
|
||||
if (II.getNumDefs() >= 1)
|
||||
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DbgLoc, II, ResultReg)
|
||||
|
|
Loading…
Reference in New Issue