Remove useless TODO from genCompareInt
authorMike Danes <onemihaid@hotmail.com>
Sun, 17 Sep 2017 13:57:44 +0000 (16:57 +0300)
committerMike Danes <onemihaid@hotmail.com>
Mon, 18 Sep 2017 13:59:37 +0000 (16:59 +0300)
gtSetEvalOrder already does this. And even if it doesn't it's not the job of genCompareInt to swap operands, that should happen in LowerCompare.

Attempting to do this in LowerCompare resulted in 0 diffs.

src/jit/codegenxarch.cpp
src/jit/lowerxarch.cpp

index 45bcdc2ef8164e3289f15519c9a7cdf028705d4e..f8bad9e94423030719e57f9c14f1a530e0dfdc47 100644 (file)
@@ -6303,9 +6303,7 @@ void CodeGen::genCompareInt(GenTreePtr treeNode)
 
     genConsumeOperands(tree);
 
-    // TODO-CQ: We should be able to support swapping op1 and op2 to generate cmp reg, imm.
-    // https://github.com/dotnet/coreclr/issues/7270
-    assert(!op1->isContainedIntOrIImmed()); // We no longer support
+    assert(!op1->isContainedIntOrIImmed());
     assert(!varTypeIsFloating(op2Type));
 
     instruction ins;
index 67a6d0500480541248e006671c71d5a4b4facc2e..bb45279887e9e0173a6d4c3f5b43eb71596a5ef3 100644 (file)
@@ -1859,9 +1859,6 @@ void Lowering::ContainCheckCompare(GenTreeOp* cmp)
         }
         else if (op1->IsCnsIntOrI())
         {
-            // TODO-CQ: We should be able to support swapping op1 and op2 to generate cmp reg, imm,
-            // but there is currently an assert in CodeGen::genCompareInt().
-            // https://github.com/dotnet/coreclr/issues/7270
             SetRegOptional(op2);
         }
         else