mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-12 11:03:24 +00:00
No need to go through int64 and APInt when generating a new constant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
34fd0d2b93
commit
4d895455fe
@ -2607,11 +2607,11 @@ SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable,
|
|||||||
SDValue Imm = RecordedNodes[RecNo].first;
|
SDValue Imm = RecordedNodes[RecNo].first;
|
||||||
|
|
||||||
if (Imm->getOpcode() == ISD::Constant) {
|
if (Imm->getOpcode() == ISD::Constant) {
|
||||||
int64_t Val = cast<ConstantSDNode>(Imm)->getZExtValue();
|
const ConstantInt *Val=cast<ConstantSDNode>(Imm)->getConstantIntValue();
|
||||||
Imm = CurDAG->getTargetConstant(Val, Imm.getValueType());
|
Imm = CurDAG->getConstant(*Val, Imm.getValueType(), true);
|
||||||
} else if (Imm->getOpcode() == ISD::ConstantFP) {
|
} else if (Imm->getOpcode() == ISD::ConstantFP) {
|
||||||
const ConstantFP *Val=cast<ConstantFPSDNode>(Imm)->getConstantFPValue();
|
const ConstantFP *Val=cast<ConstantFPSDNode>(Imm)->getConstantFPValue();
|
||||||
Imm = CurDAG->getTargetConstantFP(*Val, Imm.getValueType());
|
Imm = CurDAG->getConstantFP(*Val, Imm.getValueType(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
RecordedNodes.push_back(std::make_pair(Imm, RecordedNodes[RecNo].second));
|
RecordedNodes.push_back(std::make_pair(Imm, RecordedNodes[RecNo].second));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user