mirror of
https://github.com/RPCS3/llvm.git
synced 2024-11-29 14:40:39 +00:00
pull MarkFlagResult out from between an EmitNode/CompleteMatch
pair. This encourages MorphNodeTo formation, this gets us 200 more MorphNodeTo's on X86 and shrinks the table a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97434 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0cebe6181a
commit
c99b5a25bb
@ -67,7 +67,23 @@ static void ContractNodes(OwningPtr<Matcher> &MatcherPtr,
|
|||||||
return ContractNodes(MatcherPtr, CGP);
|
return ContractNodes(MatcherPtr, CGP);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: Handle OPC_MarkFlagResults.
|
// Turn EmitNode->MarkFlagResults->CompleteMatch into
|
||||||
|
// MarkFlagResults->EmitNode->CompleteMatch when we can to encourage
|
||||||
|
// MorphNodeTo formation. This is safe because MarkFlagResults never refers
|
||||||
|
// to the root of the pattern.
|
||||||
|
if (isa<EmitNodeMatcher>(N) && isa<MarkFlagResultsMatcher>(N->getNext()) &&
|
||||||
|
isa<CompleteMatchMatcher>(N->getNext()->getNext())) {
|
||||||
|
// Unlink the two nodes from the list.
|
||||||
|
Matcher *EmitNode = MatcherPtr.take();
|
||||||
|
Matcher *MFR = EmitNode->takeNext();
|
||||||
|
Matcher *Tail = MFR->takeNext();
|
||||||
|
|
||||||
|
// Relink them.
|
||||||
|
MatcherPtr.reset(MFR);
|
||||||
|
MFR->setNext(EmitNode);
|
||||||
|
EmitNode->setNext(Tail);
|
||||||
|
return ContractNodes(MatcherPtr, CGP);
|
||||||
|
}
|
||||||
|
|
||||||
// Turn EmitNode->CompleteMatch into MorphNodeTo if we can.
|
// Turn EmitNode->CompleteMatch into MorphNodeTo if we can.
|
||||||
if (EmitNodeMatcher *EN = dyn_cast<EmitNodeMatcher>(N))
|
if (EmitNodeMatcher *EN = dyn_cast<EmitNodeMatcher>(N))
|
||||||
|
Loading…
Reference in New Issue
Block a user