Re-enabled optimizations for gtFoldExprConst (#53347)
authorSingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Mon, 31 May 2021 08:25:23 +0000 (11:25 +0300)
committerGitHub <noreply@github.com>
Mon, 31 May 2021 08:25:23 +0000 (01:25 -0700)
The method has been refactored and the code that was
causing problems for the optimizer no longer exists.

src/coreclr/jit/compiler.h

index 9eb9843..2d34456 100644 (file)
@@ -3165,18 +3165,7 @@ public:
     //-------------------------------------------------------------------------
 
     GenTree* gtFoldExpr(GenTree* tree);
-    GenTree*
-#ifdef __clang__
-        // TODO-Amd64-Unix: Remove this when the clang optimizer is fixed and/or the method implementation is
-        // refactored in a simpler code. This is a workaround for a bug in the clang-3.5 optimizer. The issue is that in
-        // release build the optimizer is mistyping (or just wrongly decides to use 32 bit operation for a corner case
-        // of MIN_LONG) the args of the (ltemp / lval2) to int (it does a 32 bit div operation instead of 64 bit) - see
-        // the implementation of the method in gentree.cpp. For the case of lval1 and lval2 equal to MIN_LONG
-        // (0x8000000000000000) this results in raising a SIGFPE. The method implementation is rather complex. Disable
-        // optimizations for now.
-        __attribute__((optnone))
-#endif // __clang__
-        gtFoldExprConst(GenTree* tree);
+    GenTree* gtFoldExprConst(GenTree* tree);
     GenTree* gtFoldExprSpecial(GenTree* tree);
     GenTree* gtFoldBoxNullable(GenTree* tree);
     GenTree* gtFoldExprCompare(GenTree* tree);