[PATCH] D139080: [Instcombine] fold logic ops to select

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 10:02:43 PST 2022


RKSimon added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2479
 /// B, it can be used as the condition operand of a select instruction.
-Value *InstCombinerImpl::getSelectCondition(Value *A, Value *B) {
+Value *InstCombinerImpl::getSelectCondition(Value *A, Value *B, bool AisB) {
   // We may have peeked through bitcasts in the caller.
----------------
Rename AisB ? It seems to suggest that A is known to be equivalent to B.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineInternal.h:367
                                        bool IsLogical = false);
-  Value *matchSelectFromAndOr(Value *A, Value *B, Value *C, Value *D);
-  Value *getSelectCondition(Value *A, Value *B);
+  Value *matchSelectFromAndOr(Value *A, Value *B, Value *C, Value *D,
+                              bool NeedNotD = false);
----------------
Explain the purposes of NeedNotD and AisB


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139080/new/

https://reviews.llvm.org/D139080



More information about the llvm-commits mailing list