diff options
author | Andy Ayers <andya@microsoft.com> | 2018-07-20 14:56:09 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-20 14:56:09 -0700 |
commit | 699028a7a033991f01a72211a88a534ef1360c3a (patch) | |
tree | 1106ee9a2cc4dfb4649ca4c6f6f702003b4af786 /src/jit/compiler.hpp | |
parent | c98addeee64e0bca467079c7e9b9c359818f144c (diff) | |
download | coreclr-699028a7a033991f01a72211a88a534ef1360c3a.tar.gz coreclr-699028a7a033991f01a72211a88a534ef1360c3a.tar.bz2 coreclr-699028a7a033991f01a72211a88a534ef1360c3a.zip |
JIT: handle implicit local var references via local var attribute bit (#19012)
Instead of relying on ref count bumps, add a new attribute bit to local
vars to indicate that they may have implicit references (prolog, epilog,
gc, eh) and may not have any IR references.
Use this attribute bit to ensure that the ref count and weighted ref count for
such variables are never reported as zero, and as a result that these variables
end up being allocated and reportable.
This is another preparatory step for #18969 and frees the jit to recompute
explicit ref counts via an IR scan without having to special case the counts
for these variables.
The jit can no longer describe implicit counts other than 1 and implicit weights
otehr than BB_UNITY_WEIGHT, but that currently doesn't seem to be very important.
The new bit fits into an existing padding void so LclVarDsc remains at 128 bytes
(for windows x64).
Diffstat (limited to 'src/jit/compiler.hpp')
-rw-r--r-- | src/jit/compiler.hpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/jit/compiler.hpp b/src/jit/compiler.hpp index c4a50c0fa9..da00abcd03 100644 --- a/src/jit/compiler.hpp +++ b/src/jit/compiler.hpp @@ -1797,9 +1797,8 @@ inline unsigned Compiler::lvaGrabTempWithImplicitUse(bool shortLifetime DEBUGARG // address-exposed -- DoNotEnregister should suffice? lvaSetVarAddrExposed(lclNum); - // We need lvRefCnt to be non-zero to prevent various asserts from firing. - varDsc->setLvRefCnt(1); - varDsc->setLvRefCntWtd(BB_UNITY_WEIGHT); + // Note the implicit use + varDsc->lvImplicitlyReferenced = 1; return lclNum; } |