Improve codegen in impStringEqualsOrStartsWith (#90288)
authorEgor Bogatov <egorbo@gmail.com>
Thu, 10 Aug 2023 18:08:58 +0000 (20:08 +0200)
committerGitHub <noreply@github.com>
Thu, 10 Aug 2023 18:08:58 +0000 (20:08 +0200)
src/coreclr/jit/importervectorization.cpp

index bb11a5a..0d89f45 100644 (file)
@@ -616,10 +616,8 @@ GenTree* Compiler::impStringEqualsOrStartsWith(bool startsWith, CORINFO_SIG_INFO
         op2 = impStackTop(0).val;
     }
 
-    if (!(op1->OperIs(GT_CNS_STR) ^ op2->OperIs(GT_CNS_STR)))
+    if (!op1->OperIs(GT_CNS_STR) && !op2->OperIs(GT_CNS_STR))
     {
-        // either op1 or op2 has to be CNS_STR, but not both - that case is optimized
-        // just fine as is.
         return nullptr;
     }