mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-10 22:43:53 +00:00
hack around more crimes in instruction selection.
llvm-svn: 96852
This commit is contained in:
parent
0891078790
commit
0872bdfb41
@ -296,7 +296,8 @@ namespace {
|
|||||||
(SPU::get_ILHUvec_imm(bvNode, *CurDAG, MVT::i64).getNode() != 0) ||
|
(SPU::get_ILHUvec_imm(bvNode, *CurDAG, MVT::i64).getNode() != 0) ||
|
||||||
(SPU::get_vec_u18imm(bvNode, *CurDAG, MVT::i64).getNode() != 0)))) {
|
(SPU::get_vec_u18imm(bvNode, *CurDAG, MVT::i64).getNode() != 0)))) {
|
||||||
HandleSDNode Dummy(SDValue(bvNode, 0));
|
HandleSDNode Dummy(SDValue(bvNode, 0));
|
||||||
Select(bvNode);
|
if (SDNode *N = Select(bvNode))
|
||||||
|
return N;
|
||||||
return Dummy.getValue().getNode();
|
return Dummy.getValue().getNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,7 +321,8 @@ namespace {
|
|||||||
PseudoSourceValue::getConstantPool(),0,
|
PseudoSourceValue::getConstantPool(),0,
|
||||||
false, false, Alignment));
|
false, false, Alignment));
|
||||||
CurDAG->ReplaceAllUsesWith(SDValue(bvNode, 0), Dummy.getValue());
|
CurDAG->ReplaceAllUsesWith(SDValue(bvNode, 0), Dummy.getValue());
|
||||||
SelectCode(Dummy.getValue().getNode());
|
if (SDNode *N = SelectCode(Dummy.getValue().getNode()))
|
||||||
|
return N;
|
||||||
return Dummy.getValue().getNode();
|
return Dummy.getValue().getNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -765,9 +767,8 @@ SPUDAGToDAGISel::Select(SDNode *N) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SDNode *shufMaskLoad = emitBuildVector(shufMask.getNode());
|
SDNode *shufMaskLoad = emitBuildVector(shufMask.getNode());
|
||||||
SDNode *PromoteScalar =
|
SDNode *PromoteScalar = CurDAG->getNode(SPUISD::PREFSLOT2VEC, dl,
|
||||||
SelectCode(CurDAG->getNode(SPUISD::PREFSLOT2VEC, dl,
|
Op0VecVT, Op0).getNode();
|
||||||
Op0VecVT, Op0).getNode());
|
|
||||||
|
|
||||||
SDValue zextShuffle =
|
SDValue zextShuffle =
|
||||||
CurDAG->getNode(SPUISD::SHUFB, dl, OpVecVT,
|
CurDAG->getNode(SPUISD::SHUFB, dl, OpVecVT,
|
||||||
@ -778,9 +779,13 @@ SPUDAGToDAGISel::Select(SDNode *N) {
|
|||||||
// N.B.: BIT_CONVERT replaces and updates the zextShuffle node, so we
|
// N.B.: BIT_CONVERT replaces and updates the zextShuffle node, so we
|
||||||
// re-use it in the VEC2PREFSLOT selection without needing to explicitly
|
// re-use it in the VEC2PREFSLOT selection without needing to explicitly
|
||||||
// call SelectCode (it's already done for us.)
|
// call SelectCode (it's already done for us.)
|
||||||
SelectCode(CurDAG->getNode(ISD::BIT_CONVERT, dl, OpVecVT, zextShuffle).getNode());
|
HandleSDNode Dummy2(zextShuffle); //CurDAG->getNode(ISD::BIT_CONVERT, dl, OpVecVT,
|
||||||
|
// zextShuffle));
|
||||||
|
|
||||||
|
if (SDNode *N = SelectCode(Dummy2.getValue().getNode()))
|
||||||
|
return N;
|
||||||
HandleSDNode Dummy(CurDAG->getNode(SPUISD::VEC2PREFSLOT, dl, OpVT,
|
HandleSDNode Dummy(CurDAG->getNode(SPUISD::VEC2PREFSLOT, dl, OpVT,
|
||||||
zextShuffle));
|
Dummy2.getValue()));
|
||||||
|
|
||||||
CurDAG->ReplaceAllUsesWith(N, Dummy.getValue().getNode());
|
CurDAG->ReplaceAllUsesWith(N, Dummy.getValue().getNode());
|
||||||
SelectCode(Dummy.getValue().getNode());
|
SelectCode(Dummy.getValue().getNode());
|
||||||
@ -794,7 +799,8 @@ SPUDAGToDAGISel::Select(SDNode *N) {
|
|||||||
SDValue(CGLoad, 0)));
|
SDValue(CGLoad, 0)));
|
||||||
|
|
||||||
CurDAG->ReplaceAllUsesWith(N, Dummy.getValue().getNode());
|
CurDAG->ReplaceAllUsesWith(N, Dummy.getValue().getNode());
|
||||||
SelectCode(Dummy.getValue().getNode());
|
if (SDNode *N = SelectCode(Dummy.getValue().getNode()))
|
||||||
|
return N;
|
||||||
return Dummy.getValue().getNode();
|
return Dummy.getValue().getNode();
|
||||||
} else if (Opc == ISD::SUB && (OpVT == MVT::i64 || OpVT == MVT::v2i64)) {
|
} else if (Opc == ISD::SUB && (OpVT == MVT::i64 || OpVT == MVT::v2i64)) {
|
||||||
SDNode *CGLoad =
|
SDNode *CGLoad =
|
||||||
@ -805,7 +811,8 @@ SPUDAGToDAGISel::Select(SDNode *N) {
|
|||||||
SDValue(CGLoad, 0)));
|
SDValue(CGLoad, 0)));
|
||||||
|
|
||||||
CurDAG->ReplaceAllUsesWith(N, Dummy.getValue().getNode());
|
CurDAG->ReplaceAllUsesWith(N, Dummy.getValue().getNode());
|
||||||
SelectCode(Dummy.getValue().getNode());
|
if (SDNode *N = SelectCode(Dummy.getValue().getNode()))
|
||||||
|
return N;
|
||||||
return Dummy.getValue().getNode();
|
return Dummy.getValue().getNode();
|
||||||
} else if (Opc == ISD::MUL && (OpVT == MVT::i64 || OpVT == MVT::v2i64)) {
|
} else if (Opc == ISD::MUL && (OpVT == MVT::i64 || OpVT == MVT::v2i64)) {
|
||||||
SDNode *CGLoad =
|
SDNode *CGLoad =
|
||||||
@ -815,7 +822,8 @@ SPUDAGToDAGISel::Select(SDNode *N) {
|
|||||||
N->getOperand(0), N->getOperand(1),
|
N->getOperand(0), N->getOperand(1),
|
||||||
SDValue(CGLoad, 0)));
|
SDValue(CGLoad, 0)));
|
||||||
CurDAG->ReplaceAllUsesWith(N, Dummy.getValue().getNode());
|
CurDAG->ReplaceAllUsesWith(N, Dummy.getValue().getNode());
|
||||||
SelectCode(Dummy.getValue().getNode());
|
if (SDNode *N = SelectCode(Dummy.getValue().getNode()))
|
||||||
|
return N;
|
||||||
return Dummy.getValue().getNode();
|
return Dummy.getValue().getNode();
|
||||||
} else if (Opc == ISD::TRUNCATE) {
|
} else if (Opc == ISD::TRUNCATE) {
|
||||||
SDValue Op0 = N->getOperand(0);
|
SDValue Op0 = N->getOperand(0);
|
||||||
@ -1242,13 +1250,15 @@ SDNode *SPUDAGToDAGISel::SelectI64Constant(uint64_t Value64, EVT OpVT,
|
|||||||
? shufmask.getNode()
|
? shufmask.getNode()
|
||||||
: emitBuildVector(shufmask.getNode()));
|
: emitBuildVector(shufmask.getNode()));
|
||||||
|
|
||||||
SDNode *shufNode =
|
SDValue shufNode =
|
||||||
Select(CurDAG->getNode(SPUISD::SHUFB, dl, OpVecVT,
|
CurDAG->getNode(SPUISD::SHUFB, dl, OpVecVT,
|
||||||
SDValue(lhsNode, 0), SDValue(rhsNode, 0),
|
SDValue(lhsNode, 0), SDValue(rhsNode, 0),
|
||||||
SDValue(shufMaskNode, 0)).getNode());
|
SDValue(shufMaskNode, 0));
|
||||||
|
HandleSDNode Dummy(shufNode);
|
||||||
return CurDAG->getMachineNode(SPU::ORi64_v2i64, dl, OpVT,
|
SDNode *SN = SelectCode(Dummy.getValue().getNode());
|
||||||
SDValue(shufNode, 0));
|
if (SN == 0) SN = Dummy.getValue().getNode();
|
||||||
|
|
||||||
|
return CurDAG->getMachineNode(SPU::ORi64_v2i64, dl, OpVT, SDValue(SN, 0));
|
||||||
} else if (i64vec.getOpcode() == ISD::BUILD_VECTOR) {
|
} else if (i64vec.getOpcode() == ISD::BUILD_VECTOR) {
|
||||||
return CurDAG->getMachineNode(SPU::ORi64_v2i64, dl, OpVT,
|
return CurDAG->getMachineNode(SPU::ORi64_v2i64, dl, OpVT,
|
||||||
SDValue(emitBuildVector(i64vec.getNode()), 0));
|
SDValue(emitBuildVector(i64vec.getNode()), 0));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user