[PATCH] D76140: [InlineFunction] update attributes during inlining
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 22 10:08:37 PDT 2020
lebedev.ri added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/InlineFunction.cpp:1172
+ if (NumInstChecked++ > MaxInstCheckedForThrow ||
+ isGuaranteedToTransferExecutionToSuccessor(&I))
+ return true;
----------------
anna wrote:
> Noticed while adding couple more tests, there are 2 bugs here:
> 1. the `isGuaranteedToTransferExecutionToSuccessor` check should be inverted
> 2. make_range should be until the return instruction - so we do not want `std::prev` on the returnInstruction. what's needed is: `make_range(RVal->getIterator(), RInst->getIterator())`
> This means that from the callsite until (and excluding) the return instruction should be guaranteed to transfer execution to successor - only then we can backward propagate the attribute to that callsite.
Are you aware of `llvm::isValidAssumeForContext()`?
All this (including pitfalls) sound awfully close to that function.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76140/new/
https://reviews.llvm.org/D76140
More information about the cfe-commits
mailing list