forked from OSchip/llvm-project
Fix X86/inline-asm.ll:test2, a case where an input value was implicitly
truncated. llvm-svn: 28733
This commit is contained in:
parent
38b318d436
commit
c03a9259c0
|
@ -1804,9 +1804,12 @@ void RegsForValue::getCopyToRegs(SDOperand Val, SelectionDAG &DAG,
|
|||
// If there is a single register and the types differ, this must be
|
||||
// a promotion.
|
||||
if (RegVT != ValueVT) {
|
||||
if (MVT::isInteger(RegVT))
|
||||
Val = DAG.getNode(ISD::ANY_EXTEND, RegVT, Val);
|
||||
if (MVT::isInteger(RegVT)) {
|
||||
if (RegVT < ValueVT)
|
||||
Val = DAG.getNode(ISD::TRUNCATE, RegVT, Val);
|
||||
else
|
||||
Val = DAG.getNode(ISD::ANY_EXTEND, RegVT, Val);
|
||||
} else
|
||||
Val = DAG.getNode(ISD::FP_EXTEND, RegVT, Val);
|
||||
}
|
||||
Chain = DAG.getCopyToReg(Chain, Regs[0], Val, Flag);
|
||||
|
|
Loading…
Reference in New Issue