diff options
author | Pat Gavlin <pgavlin@gmail.com> | 2016-11-28 13:33:26 -0800 |
---|---|---|
committer | Pat Gavlin <pgavlin@gmail.com> | 2016-11-28 13:36:31 -0800 |
commit | a258f013a53e1ad2cdef5998c8340be0ff0c2926 (patch) | |
tree | 84b5974d4f278bb83c73f1005ad8e9cf26d90ad4 /src | |
parent | 7c978202b482d634d10c6841c2f60e0a0d600a17 (diff) | |
download | coreclr-a258f013a53e1ad2cdef5998c8340be0ff0c2926.tar.gz coreclr-a258f013a53e1ad2cdef5998c8340be0ff0c2926.tar.bz2 coreclr-a258f013a53e1ad2cdef5998c8340be0ff0c2926.zip |
Do not rewrite `(t + cns_a) << cns_s)` during CSE.
Morph normally rewrites trees of the form `(t + cns_a) << cns_s` to
`(t << cns_s + cns_a << cns_s)`. This transformation is not safe to run
during CSE, as it may invalidate CSE candidates.
Fixes #8285.
Diffstat (limited to 'src')
-rw-r--r-- | src/jit/morph.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index d0d81f8928..b47f06f427 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -13897,7 +13897,7 @@ GenTree* Compiler::fgMorphSmpOpOptional(GenTreeOp* tree) /* Check for the case "(val + icon) << icon" */ - if (op2->IsCnsIntOrI() && op1->gtOper == GT_ADD && !op1->gtOverflow()) + if (!optValnumCSE_phase && op2->IsCnsIntOrI() && op1->gtOper == GT_ADD && !op1->gtOverflow()) { GenTreePtr cns = op1->gtOp.gtOp2; |