[PATCH] D74888: [Attributor] Use knowledge retained in llvm.assume (operand bundles)
Hideto Ueno via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 21 03:14:26 PST 2020
uenoku added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:681
bool IRPosition::hasAttr(ArrayRef<Attribute::AttrKind> AKs,
- bool IgnoreSubsumingPositions) const {
+ bool IgnoreSubsumingPositions, Attributor *A) const {
SmallVector<Attribute, 4> Attrs;
----------------
I think using `nullptr` as a flag to indicate subsuming positions seems a bit difficult to read.
Could you simply add some boolean flag and replace the argument with a reference?
================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:748-753
+ for (const Use &U : AssociatedValue.uses())
+ if (IntrinsicInst *II = dyn_cast_or_null<IntrinsicInst>(U.getUser()))
+ if (II->getIntrinsicID() == Intrinsic::assume && !II->isArgOperand(&U))
+ if (hasAttributeInAssume(*II, &AssociatedValue, AttrName, ArgValPtr))
+ if (!ArgValPtr || ArgVal > 0)
+ AssumeAttrMap[II] = Attribute::get(Ctx, AK, ArgVal);
----------------
Can't we share `AssumeAttrMap` with other AAs whose associated values are the same?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74888/new/
https://reviews.llvm.org/D74888
More information about the llvm-commits
mailing list