[PATCH] D102698: [InstCombine] Relaxed constraints of uses for exp(X) * exp(Y) -> exp(X + Y) and exp2(X) * exp2(Y) -> exp2(X + Y)
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 23 07:30:22 PDT 2021
spatel added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:3309-3310
+ auto NumOps = I->getNumOperands();
+ return std::any_of(I->op_begin(), I->op_end(),
+ [](const Use &Op) { return Op.get()->hasOneUse(); }) ||
+ (FirstOp->hasNUses(NumOps) &&
----------------
Use llvm::any_of() to shorten, and implicit convert operand list to Value?
return any_of(I.operands(), [](Value *V) { return V->hasOneUse();}) || ...
================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:3312
+ (FirstOp->hasNUses(NumOps) &&
+ llvm::is_splat(llvm::make_range(I->op_begin(), I->op_end())));
+}
----------------
I->operands() ?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102698/new/
https://reviews.llvm.org/D102698
More information about the llvm-commits
mailing list