mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Fix a bug aflicting 265.gap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11006 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
17a93e2e1b
commit
ead9eb75d7
@ -853,7 +853,6 @@ void ReachabilityCloner::merge(const DSNodeHandle &NH,
|
|||||||
// requires an allocation anyway.
|
// requires an allocation anyway.
|
||||||
DSNode *DN = NH.getNode(); // Make sure the Offset is up-to-date
|
DSNode *DN = NH.getNode(); // Make sure the Offset is up-to-date
|
||||||
if (NH.getOffset() >= SrcNH.getOffset()) {
|
if (NH.getOffset() >= SrcNH.getOffset()) {
|
||||||
|
|
||||||
if (!DN->isNodeCompletelyFolded()) {
|
if (!DN->isNodeCompletelyFolded()) {
|
||||||
// Make sure the destination node is folded if the source node is folded.
|
// Make sure the destination node is folded if the source node is folded.
|
||||||
if (SN->isNodeCompletelyFolded()) {
|
if (SN->isNodeCompletelyFolded()) {
|
||||||
@ -913,12 +912,12 @@ void ReachabilityCloner::merge(const DSNodeHandle &NH,
|
|||||||
} else {
|
} else {
|
||||||
// We cannot handle this case without allocating a temporary node. Fall
|
// We cannot handle this case without allocating a temporary node. Fall
|
||||||
// back on being simple.
|
// back on being simple.
|
||||||
|
|
||||||
DSNode *NewDN = new DSNode(*SN, &Dest, true /* Null out all links */);
|
DSNode *NewDN = new DSNode(*SN, &Dest, true /* Null out all links */);
|
||||||
NewDN->maskNodeTypes(BitsToKeep);
|
NewDN->maskNodeTypes(BitsToKeep);
|
||||||
|
|
||||||
unsigned NHOffset = NH.getOffset();
|
unsigned NHOffset = NH.getOffset();
|
||||||
NH.mergeWith(DSNodeHandle(NewDN, SrcNH.getOffset()));
|
NH.mergeWith(DSNodeHandle(NewDN, SrcNH.getOffset()));
|
||||||
|
|
||||||
assert(NH.getNode() &&
|
assert(NH.getNode() &&
|
||||||
(NH.getOffset() > NHOffset ||
|
(NH.getOffset() > NHOffset ||
|
||||||
(NH.getOffset() == 0 && NH.getNode()->isNodeCompletelyFolded())) &&
|
(NH.getOffset() == 0 && NH.getNode()->isNodeCompletelyFolded())) &&
|
||||||
@ -927,6 +926,22 @@ void ReachabilityCloner::merge(const DSNodeHandle &NH,
|
|||||||
// Before we start merging outgoing links and updating the scalar map, make
|
// Before we start merging outgoing links and updating the scalar map, make
|
||||||
// sure it is known that this is the representative node for the src node.
|
// sure it is known that this is the representative node for the src node.
|
||||||
SCNH = DSNodeHandle(NH.getNode(), NH.getOffset()-SrcNH.getOffset());
|
SCNH = DSNodeHandle(NH.getNode(), NH.getOffset()-SrcNH.getOffset());
|
||||||
|
|
||||||
|
// If the source node contained any globals, make sure to create entries
|
||||||
|
// in the scalar map for them!
|
||||||
|
for (DSNode::global_iterator I = SN->global_begin(), E = SN->global_end();
|
||||||
|
I != E; ++I) {
|
||||||
|
GlobalValue *GV = *I;
|
||||||
|
const DSNodeHandle &SrcGNH = Src.getNodeForValue(GV);
|
||||||
|
DSNodeHandle &DestGNH = NodeMap[SrcGNH.getNode()];
|
||||||
|
assert(DestGNH.getNode()==NH.getNode() &&"Global mapping inconsistent");
|
||||||
|
assert(SrcGNH.getNode() == SN && "Global mapping inconsistent");
|
||||||
|
Dest.getNodeForValue(GV).mergeWith(DSNodeHandle(DestGNH.getNode(),
|
||||||
|
DestGNH.getOffset()+SrcGNH.getOffset()));
|
||||||
|
|
||||||
|
if (CloneFlags & DSGraph::UpdateInlinedGlobals)
|
||||||
|
Dest.getInlinedGlobals().insert(GV);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1060,7 +1075,6 @@ void DSNode::remapLinks(DSGraph::NodeMapTy &OldNodeMap) {
|
|||||||
///
|
///
|
||||||
void DSGraph::updateFromGlobalGraph() {
|
void DSGraph::updateFromGlobalGraph() {
|
||||||
TIME_REGION(X, "updateFromGlobalGraph");
|
TIME_REGION(X, "updateFromGlobalGraph");
|
||||||
|
|
||||||
ReachabilityCloner RC(*this, *GlobalsGraph, 0);
|
ReachabilityCloner RC(*this, *GlobalsGraph, 0);
|
||||||
|
|
||||||
// Clone the non-up-to-date global nodes into this graph.
|
// Clone the non-up-to-date global nodes into this graph.
|
||||||
|
Loading…
Reference in New Issue
Block a user