mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 03:23:01 +02:00
Teach TableGen to put chains on more instructions
When generating selection tables for Pat instances, TableGen relied on an output Instruction's Pattern field being set to infer whether a chain should be added. This patch adds additional logic to check various flag fields so that correct code can be generated even if Pattern is unset. llvm-svn: 159217
This commit is contained in:
parent
bcb2742394
commit
6b78b4ea43
@ -690,6 +690,13 @@ EmitResultInstructionAsOperand(const TreePatternNode *N,
|
||||
bool NodeHasChain = InstPatNode &&
|
||||
InstPatNode->TreeHasProperty(SDNPHasChain, CGP);
|
||||
|
||||
// Instructions which load and store from memory should have a chain,
|
||||
// regardless of whether they happen to have an internal pattern saying so.
|
||||
if (Pattern.getSrcPattern()->TreeHasProperty(SDNPHasChain, CGP)
|
||||
&& (II.hasCtrlDep || II.mayLoad || II.mayStore || II.canFoldAsLoad ||
|
||||
II.hasSideEffects))
|
||||
NodeHasChain = true;
|
||||
|
||||
bool isRoot = N == Pattern.getDstPattern();
|
||||
|
||||
// TreeHasOutGlue - True if this tree has glue.
|
||||
|
Loading…
Reference in New Issue
Block a user