[PATCH] D133369: [InstCombine] fold add+negate through select into sub

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 6 13:28:26 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:882
+    // We need an 'add' and exactly 1 arm of the select to have been simplified.
+    if (Opcode != Instruction::Add || True == False)
+      return nullptr;
----------------
Are we wanting to ensure that True and False are different or that only one of them is non-null?


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

https://reviews.llvm.org/D133369



More information about the llvm-commits mailing list