[llvm] 517202c - [TargetLowering] Fix comments describing XOR -> OR/AND transformations

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 05:57:22 PDT 2020


Author: Jay Foad
Date: 2020-09-10T13:56:34+01:00
New Revision: 517202c720ea527aab689590c81703a70793cb97

URL: https://github.com/llvm/llvm-project/commit/517202c720ea527aab689590c81703a70793cb97
DIFF: https://github.com/llvm/llvm-project/commit/517202c720ea527aab689590c81703a70793cb97.diff

LOG: [TargetLowering] Fix comments describing XOR -> OR/AND transformations

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index cbdd027f55fe..a80ca04921f4 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1325,15 +1325,15 @@ bool TargetLowering::SimplifyDemandedBits(
       return true;
 
     // If all of the unknown bits are known to be zero on one side or the other
-    // (but not both) turn this into an *inclusive* or.
+    // turn this into an *inclusive* or.
     //    e.g. (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
     if (DemandedBits.isSubsetOf(Known.Zero | Known2.Zero))
       return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::OR, dl, VT, Op0, Op1));
 
     ConstantSDNode* C = isConstOrConstSplat(Op1, DemandedElts);
     if (C) {
-      // If one side is a constant, and all of the known set bits on the other
-      // side are also set in the constant, turn this into an AND, as we know
+      // If one side is a constant, and all of the set bits in the constant are
+      // also known set on the other side, turn this into an AND, as we know
       // the bits will be cleared.
       //    e.g. (X | C1) ^ C2 --> (X | C1) & ~C2 iff (C1&C2) == C2
       // NB: it is okay if more bits are known than are requested


        


More information about the llvm-commits mailing list