From: Mike Danes Date: Sun, 25 Nov 2018 09:22:08 +0000 (+0200) Subject: Don't generate copy assertions for normalize on load variables X-Git-Tag: submit/tizen/20210909.063632~11030^2~3252^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7556ce50a104addceb0d3229fb1615e46aa48084;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Don't generate copy assertions for normalize on load variables Commit migrated from https://github.com/dotnet/coreclr/commit/8e6fa5df402299d833f382679ecf31687f7237a2 --- diff --git a/src/coreclr/src/jit/assertionprop.cpp b/src/coreclr/src/jit/assertionprop.cpp index 88e6b009..dffc5b9 100644 --- a/src/coreclr/src/jit/assertionprop.cpp +++ b/src/coreclr/src/jit/assertionprop.cpp @@ -1182,6 +1182,13 @@ AssertionIndex Compiler::optCreateAssertion(GenTree* op1, goto DONE_ASSERTION; // Don't make an assertion } + // If we're making a copy of a "normalize on load" lclvar then the destination + // has to be "normalize on load" as well, otherwise we risk skipping normalization. + if (lclVar2->lvNormalizeOnLoad() && !lclVar->lvNormalizeOnLoad()) + { + goto DONE_ASSERTION; // Don't make an assertion + } + // If the local variable has its address exposed then bail if (lclVar2->lvAddrExposed) {