make cns_str indirect loads invariant (#40898)
authorEgor Bogatov <egorbo@gmail.com>
Mon, 31 Aug 2020 20:47:11 +0000 (23:47 +0300)
committerGitHub <noreply@github.com>
Mon, 31 Aug 2020 20:47:11 +0000 (13:47 -0700)
src/coreclr/src/jit/gentree.cpp

index 3c1c144..c21bc80 100644 (file)
@@ -6076,7 +6076,7 @@ GenTree* Compiler::gtNewStringLiteralNode(InfoAccessType iat, void* pValue)
 
         case IAT_PVALUE: // The value needs to be accessed via an indirection
             // Create an indirection
-            tree = gtNewIndOfIconHandleNode(TYP_REF, (size_t)pValue, GTF_ICON_STR_HDL, false);
+            tree = gtNewIndOfIconHandleNode(TYP_REF, (size_t)pValue, GTF_ICON_STR_HDL, true);
 #ifdef DEBUG
             tree->gtGetOp1()->AsIntCon()->gtTargetHandle = (size_t)pValue;
 #endif