[PATCH] D102698: [InstCombine] Relaxed constraints of uses for exp(X) * exp(Y) -> exp(X + Y) and exp2(X) * exp2(Y) -> exp2(X + Y)

Daniil Seredkin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 24 07:04:36 PDT 2021


vdsered added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:3305
 
+bool llvm::isOnlyUserOfAnyOperand(Instruction *I) {
+  assert(I->getNumOperands() && "Must have at least one operand");
----------------
spatel wrote:
> This seems inverted. How about creating an inspection function within the Instruction class itself?
>   bool Instruction::isOnlyUserOfAnyOperand() const;
> 
I'm a little bit confused where to place such a function because here we have, for example, isInstructionTriviallyDead-like functions, but we have more those within Instruction class. I move it to the class.


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

https://reviews.llvm.org/D102698



More information about the llvm-commits mailing list