summaryrefslogtreecommitdiff
path: root/src/jit/block.h
diff options
context:
space:
mode:
authorJoseph Tremoulet <jotrem@microsoft.com>2016-10-14 13:57:38 -0400
committerJoseph Tremoulet <jotrem@microsoft.com>2016-11-04 15:10:50 -0400
commite75ba7caecd5323b544fb3794574987e032fe01d (patch)
treed96a2a98f288c7a928e5b95cadbba9af8f7a9873 /src/jit/block.h
parent4748bb354f00b6d48aae4a85ac3b1c955e6fe0ca (diff)
downloadcoreclr-e75ba7caecd5323b544fb3794574987e032fe01d.tar.gz
coreclr-e75ba7caecd5323b544fb3794574987e032fe01d.tar.bz2
coreclr-e75ba7caecd5323b544fb3794574987e032fe01d.zip
Add unroller support to CloneBlockState
This helper is used by the loop cloner to copy a block's attributes and statements. Expand it so it can also be used by the loop unroller: - Accept var/val parameters to pass through to `gtCloneExpr` to perform in-place substitutions - When presented with an expression that `gtCloneExpr` can't clone, return false rather than dereferencing null
Diffstat (limited to 'src/jit/block.h')
-rw-r--r--src/jit/block.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/jit/block.h b/src/jit/block.h
index 280b60298e..20d4952ad6 100644
--- a/src/jit/block.h
+++ b/src/jit/block.h
@@ -1088,9 +1088,11 @@ public:
return AllSuccs(comp, this);
}
- // Clone block state and statements from 'from' block to 'to' block.
- // Assumes that "to" is an empty block.
- static void CloneBlockState(Compiler* compiler, BasicBlock* to, const BasicBlock* from);
+ // Try to clone block state and statements from `from` block to `to` block (which must be new/empty),
+ // optionally replacing uses of local `varNum` with IntCns `varVal`. Return true if all statements
+ // in the block are cloned successfully, false (with partially-populated `to` block) if one fails.
+ static bool CloneBlockState(
+ Compiler* compiler, BasicBlock* to, const BasicBlock* from, unsigned varNum = (unsigned)-1, int varVal = 0);
void MakeLIR(GenTree* firstNode, GenTree* lastNode);
bool IsLIR();