mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 20:34:38 +00:00
Bug fix. Passive nodes are not in SUnitMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43922 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
77819419b8
commit
7da8f399bf
@ -1599,21 +1599,17 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
case 8: LD = DAG.getLoad(MVT::i64, Chain, Addr, NULL, 0); break;
|
case 8: LD = DAG.getLoad(MVT::i64, Chain, Addr, NULL, 0); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Addr = LD;
|
||||||
if (TLI.getTargetMachine().getRelocationModel() == Reloc::PIC_) {
|
if (TLI.getTargetMachine().getRelocationModel() == Reloc::PIC_) {
|
||||||
// For PIC, the sequence is:
|
// For PIC, the sequence is:
|
||||||
// BRIND(load(Jumptable + index) + RelocBase)
|
// BRIND(load(Jumptable + index) + RelocBase)
|
||||||
// RelocBase is the JumpTable on PPC and X86, GOT on Alpha
|
// RelocBase can be JumpTable, GOT or some sort of global base.
|
||||||
SDOperand Reloc;
|
if (PTy != MVT::i32)
|
||||||
if (TLI.usesGlobalOffsetTable())
|
Addr = DAG.getNode(ISD::SIGN_EXTEND, PTy, Addr);
|
||||||
Reloc = DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, PTy);
|
Addr = DAG.getNode(ISD::ADD, PTy, Addr,
|
||||||
else
|
TLI.getPICJumpTableRelocBase(Table, DAG));
|
||||||
Reloc = Table;
|
|
||||||
Addr = (PTy != MVT::i32) ? DAG.getNode(ISD::SIGN_EXTEND, PTy, LD) : LD;
|
|
||||||
Addr = DAG.getNode(ISD::ADD, PTy, Addr, Reloc);
|
|
||||||
Result = DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), Addr);
|
|
||||||
} else {
|
|
||||||
Result = DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), LD);
|
|
||||||
}
|
}
|
||||||
|
Result = DAG.getNode(ISD::BRIND, MVT::Other, LD.getValue(1), Addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -156,7 +156,7 @@ void ScheduleDAGRRList::CommuteNodesToReducePressure() {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
SDNode *OpN = SU->Node->getOperand(j).Val;
|
SDNode *OpN = SU->Node->getOperand(j).Val;
|
||||||
SUnit *OpSU = SUnitMap[OpN][SU->InstanceNo];
|
SUnit *OpSU = isPassiveNode(OpN) ? NULL : SUnitMap[OpN][SU->InstanceNo];
|
||||||
if (OpSU && OperandSeen.count(OpSU) == 1) {
|
if (OpSU && OperandSeen.count(OpSU) == 1) {
|
||||||
// Ok, so SU is not the last use of OpSU, but SU is two-address so
|
// Ok, so SU is not the last use of OpSU, but SU is two-address so
|
||||||
// it will clobber OpSU. Try to commute SU if no other source operands
|
// it will clobber OpSU. Try to commute SU if no other source operands
|
||||||
@ -165,7 +165,7 @@ void ScheduleDAGRRList::CommuteNodesToReducePressure() {
|
|||||||
for (unsigned k = 0; k < NumOps; ++k) {
|
for (unsigned k = 0; k < NumOps; ++k) {
|
||||||
if (k != j) {
|
if (k != j) {
|
||||||
OpN = SU->Node->getOperand(k).Val;
|
OpN = SU->Node->getOperand(k).Val;
|
||||||
OpSU = SUnitMap[OpN][SU->InstanceNo];
|
OpSU = isPassiveNode(OpN) ? NULL : SUnitMap[OpN][SU->InstanceNo];
|
||||||
if (OpSU && OperandSeen.count(OpSU) == 1) {
|
if (OpSU && OperandSeen.count(OpSU) == 1) {
|
||||||
DoCommute = false;
|
DoCommute = false;
|
||||||
break;
|
break;
|
||||||
@ -1252,7 +1252,8 @@ bool BURegReductionPriorityQueue<SF>::canClobber(SUnit *SU, SUnit *Op) {
|
|||||||
for (unsigned i = 0; i != NumOps; ++i) {
|
for (unsigned i = 0; i != NumOps; ++i) {
|
||||||
if (TII->getOperandConstraint(Opc, i+NumRes, TOI::TIED_TO) != -1) {
|
if (TII->getOperandConstraint(Opc, i+NumRes, TOI::TIED_TO) != -1) {
|
||||||
SDNode *DU = SU->Node->getOperand(i).Val;
|
SDNode *DU = SU->Node->getOperand(i).Val;
|
||||||
if (Op == (*SUnitMap)[DU][SU->InstanceNo])
|
if ((*SUnitMap).find(DU) != (*SUnitMap).end() &&
|
||||||
|
Op == (*SUnitMap)[DU][SU->InstanceNo])
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1298,6 +1299,8 @@ void BURegReductionPriorityQueue<SF>::AddPseudoTwoAddrDeps() {
|
|||||||
for (unsigned j = 0; j != NumOps; ++j) {
|
for (unsigned j = 0; j != NumOps; ++j) {
|
||||||
if (TII->getOperandConstraint(Opc, j+NumRes, TOI::TIED_TO) != -1) {
|
if (TII->getOperandConstraint(Opc, j+NumRes, TOI::TIED_TO) != -1) {
|
||||||
SDNode *DU = SU->Node->getOperand(j).Val;
|
SDNode *DU = SU->Node->getOperand(j).Val;
|
||||||
|
if ((*SUnitMap).find(DU) == (*SUnitMap).end())
|
||||||
|
continue;
|
||||||
SUnit *DUSU = (*SUnitMap)[DU][SU->InstanceNo];
|
SUnit *DUSU = (*SUnitMap)[DU][SU->InstanceNo];
|
||||||
if (!DUSU) continue;
|
if (!DUSU) continue;
|
||||||
for (SUnit::succ_iterator I = DUSU->Succs.begin(),E = DUSU->Succs.end();
|
for (SUnit::succ_iterator I = DUSU->Succs.begin(),E = DUSU->Succs.end();
|
||||||
|
@ -393,6 +393,13 @@ unsigned TargetLowering::getVectorTypeBreakdown(MVT::ValueType VT,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDOperand TargetLowering::getPICJumpTableRelocBase(SDOperand Table,
|
||||||
|
SelectionDAG &DAG) const {
|
||||||
|
if (usesGlobalOffsetTable())
|
||||||
|
return DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, getPointerTy());
|
||||||
|
return Table;
|
||||||
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Optimization Methods
|
// Optimization Methods
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user