mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
Fix logical error in TD pass: we should clear Mod/Ref bits of each caller
before inlining their graphs into a function. To support this, added flags to CloneFlags to strip/keep Mod/Ref bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4836 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -598,9 +598,14 @@ DSNodeHandle DSGraph::cloneInto(const DSGraph &G,
|
||||
Nodes[i]->remapLinks(OldNodeMap);
|
||||
|
||||
// Remove alloca markers as specified
|
||||
if (CloneFlags & StripAllocaBit)
|
||||
if (CloneFlags & (StripAllocaBit | StripModRefBits)) {
|
||||
unsigned short clearBits = (CloneFlags & StripAllocaBit
|
||||
? DSNode::AllocaNode : 0)
|
||||
| (CloneFlags & StripModRefBits
|
||||
? (DSNode::Modified | DSNode::Read) : 0);
|
||||
for (unsigned i = FN, e = Nodes.size(); i != e; ++i)
|
||||
Nodes[i]->NodeType &= ~DSNode::AllocaNode;
|
||||
Nodes[i]->NodeType &= ~clearBits;
|
||||
}
|
||||
|
||||
// Copy the value map... and merge all of the global nodes...
|
||||
for (std::map<Value*, DSNodeHandle>::const_iterator I = G.ScalarMap.begin(),
|
||||
|
Reference in New Issue
Block a user