[llvm] [InstCombine] Fold comparison of adding two z/sext booleans (PR #67895)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 2 02:50:11 PDT 2023


================
@@ -2895,19 +2896,86 @@ Instruction *InstCombinerImpl::foldICmpSubConstant(ICmpInst &Cmp,
   return new ICmpInst(SwappedPred, Add, ConstantInt::get(Ty, ~C));
 }
 
+static Value *createLogicFromTable(const std::bitset<4> &Table, Value *Op0,
+                                   Value *Op1, IRBuilderBase &Builder) {
+  switch (Table.to_ulong()) {
+    case 0: // 0 0 0 0
----------------
dtcxzyw wrote:

Please check again the following code and attach alive2 proof. I think you may have gotten the order of bits backward.


https://github.com/llvm/llvm-project/pull/67895


More information about the llvm-commits mailing list