[llvm] [VectorCombine] Use InstSimplifyFolder to simplify instrs on creation. (PR #146350)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 1 02:32:28 PDT 2025
================
@@ -1575,10 +1575,14 @@ class IRBuilderBase {
return Accum;
}
- Value *CreateOr(Value *LHS, Value *RHS, const Twine &Name = "") {
+ Value *CreateOr(Value *LHS, Value *RHS, const Twine &Name = "",
+ bool IsDisjoint = false) {
if (auto *V = Folder.FoldBinOp(Instruction::Or, LHS, RHS))
return V;
- return Insert(BinaryOperator::CreateOr(LHS, RHS), Name);
+ return Insert(
+ IsDisjoint ? BinaryOperator::CreateDisjoint(Instruction::Or, LHS, RHS)
+ : BinaryOperator::CreateOr(LHS, RHS),
+ Name);
----------------
artagnon wrote:
Might be better to introduce a CreateDisjoint?
https://github.com/llvm/llvm-project/pull/146350
More information about the llvm-commits
mailing list