[PATCH] D111054: [Attributor] Introduce AAAssumptionInfo to propagate assumptions
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 9 08:02:19 PST 2021
jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.
LG, minor comments to address prior to the merge.
================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:2521
+/// value is modified using union or intersection operations.
+template <typename base_ty> struct SetState : public AbstractState {
+ /// A wrapper around a set that has semantics for handling unions and
----------------
================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:2592
+ bool isValidState() const override {
+ return Assumed.isUniversal() || !Assumed.empty();
+ }
----------------
================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:2620
+ bool setContains(const base_ty &Elem) const {
+ return Known.getSet().contains(Elem) || Assumed.getSet().contains(Elem);
+ }
----------------
================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:2626
+ bool getIntersection(const SetContents &RHS) {
+ unsigned Changed = Assumed.getSet().size();
+
----------------
================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:9786
+ if (AssumptionAA)
+ getUnion(AssumptionAA->getAssumed());
+
----------------
The parent function assumptions should always be in the assumed set, adding them here should not be necessary.
================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:9813
+ if (Function *F = IRP.getAssociatedFunction())
+ set_union(Assumptions, getAssumptions(*F));
+ return Assumptions;
----------------
Also add the scope assumptions here, all of them are known.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111054/new/
https://reviews.llvm.org/D111054
More information about the llvm-commits
mailing list