[PATCH] D146349: [InstCombine] Make `FoldOpIntoSelect` handle non-constants and use condition to deduce constants.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 12:41:48 PDT 2023


nikic added a comment.

This should also relax the requirement on at least one caller so that the change becomes testable. Or maybe you can use the one in InstCombineCalls to test this, I think one of the multi-argument intrinsics should work.



================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:1030
+static SmallVector<Value *>
+getInstSelectArmOperands(Instruction &I, SelectInst *SI, bool IsTrueArm) {
+  SmallVector<Value *> Ops;
----------------
Why was this factored out into a separate function? Doesn't really seem to simplify things.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146349



More information about the llvm-commits mailing list