summaryrefslogtreecommitdiff
path: root/src/jit/compiler.h
diff options
context:
space:
mode:
authorJoseph Tremoulet <jotrem@microsoft.com>2017-05-08 22:30:04 -0400
committerJoseph Tremoulet <jotrem@microsoft.com>2017-05-09 17:59:19 -0400
commit673f56aa91d69b78fc0055e4419d5ad59c47b83b (patch)
tree5af35f7b2f5b841b99d29b3bba4eb70d3235394c /src/jit/compiler.h
parenteac27ca7fb6e80a0a1af44b889469b2818c45a9a (diff)
downloadcoreclr-673f56aa91d69b78fc0055e4419d5ad59c47b83b.tar.gz
coreclr-673f56aa91d69b78fc0055e4419d5ad59c47b83b.tar.bz2
coreclr-673f56aa91d69b78fc0055e4419d5ad59c47b83b.zip
Stop hoisting statics above cctors
Extend the logic in optLoopHoist around `CLS_VAR` nodes to ensure we don't hoist any tree that contains a `CLS_VAR` for a field with the flag `CORINFO_FLG_FIELD_INITCLASS` set, unless we also (identify and) hoist the corresponding static init helper call. The previous logic was insufficient in that it blocked hoisting of singleton `CLS_VAR` nodes, but not hoisting of trees that contain `CLS_VAR` nodes as sub-trees. Add flag `GTF_FLD_INITCLASS`/`GTF_CLS_VAR_INITCLASS` so that optLoopHoist can recall which fields are paired with static init helper calls, and only block the hoisting of their trees. Fixes #10780.
Diffstat (limited to 'src/jit/compiler.h')
-rw-r--r--src/jit/compiler.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/jit/compiler.h b/src/jit/compiler.h
index 75cb4dc491..30c46eee30 100644
--- a/src/jit/compiler.h
+++ b/src/jit/compiler.h
@@ -5005,7 +5005,8 @@ protected:
unsigned lnum,
LoopHoistContext* hoistCtxt,
bool* firstBlockAndBeforeSideEffect,
- bool* pHoistable);
+ bool* pHoistable,
+ bool* pCctorDependent);
// Performs the hoisting 'tree' into the PreHeader for loop 'lnum'
void optHoistCandidate(GenTreePtr tree, unsigned lnum, LoopHoistContext* hoistCtxt);