[PATCH] D101577: [InlineCost] Remove visitUnaryInstruction()
David Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 29 21:08:53 PDT 2021
davidxl added inline comments.
================
Comment at: llvm/lib/Analysis/InlineCost.cpp:1372
- Value *Operand = I.getOperand(0);
- if (simplifyInstruction(I, [&](SmallVectorImpl<Constant *> &COps) {
- return ConstantFoldInstOperands(&I, COps[0], DL);
----------------
aeubanks wrote:
> davidxl wrote:
> > Perhaps add a debug assert that this returns false always (for non-debug path, skip the simplification call for compile time).
> there isn't really a good place to put that assert, unless we want to define a `CallAnalyzer::visitUnaryInstruction` only in assert builds, which seems weird
The change to in visitAlloca is fine. To address the concern about future IR (mtrofin), how about keeping visitUnaryInstruction, but with a very simple body -- when it is called in the future, it will be caught and handled here.
{
assert(0);
return false;
}
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101577/new/
https://reviews.llvm.org/D101577
More information about the llvm-commits
mailing list