Skip to content

Commit

Permalink
Handle casts done via helpers and fold overflow operations in value n…
Browse files Browse the repository at this point in the history
…umbering (dotnet#50450)

* Added a missing license header

* Added a test verifying that checked arithmetic is correct

* Added a test verifying that checked casts are correct

* Refactored VNEvalShouldFold

* Refactored gtFoldExprConst to use helpers and follow the common code style

* Fixed the comment stating TYP_BYREF has no zero value

* Moved checking of overflow for arithmetic operations from gtFoldExprConst into a separate namespace

* Implemented folding of overflow arithmetic in value numbering

* Fixed some typos in valuenum.cpp/h

* Added identity-based evaluation for overflow arithmetic

* Refactored gtFoldExpr some more, moved the overflow checking logic to CheckedOps, implemented overflow checking for floating point -> integer casts

* Implemented folding of checked casts in value numbering, started value numbering casts via helpers like normal casts

* Fixed the formatting

* Made the definition of var_types a standalone header so that it can be safely #included'ed in utils.h

* Replaced uses of GTF_CALL_M_SPECIAL_INTRINSIC with the equivalent helpers

* Fold cast via helpers in morph

* Disable the test for checked casts on Mono
  • Loading branch information
SingleAccretion authored Apr 15, 2021
1 parent 2e12730 commit 730abc9
Show file tree
Hide file tree
Showing 26 changed files with 49,589 additions and 719 deletions.
1 change: 1 addition & 0 deletions src/coreclr/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ if (CLR_CMAKE_TARGET_WIN32)
valuenumtype.h
varset.h
vartype.h
vartypesdef.h
)

if (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_ARM)
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/jit/assertionprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4986,6 +4986,9 @@ GenTree* Compiler::optExtractSideEffListFromConst(GenTree* tree)
bool ignoreRoot = true;

gtExtractSideEffList(tree, &sideEffList, GTF_SIDE_EFFECT, ignoreRoot);

JITDUMP("Extracted side effects from a constant tree [%06u]:\n", tree->gtTreeID);
DISPTREE(sideEffList);
}

return sideEffList;
Expand Down
Loading

0 comments on commit 730abc9

Please sign in to comment.