[PATCH] D66126: [Attributor] Towards a more structured deduction pattern

Hideto Ueno via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 01:08:54 PDT 2019


uenoku added a comment.

Basically, I like the idea.

You have ported `nonnull` and `align` using this pattern. I want to make other attributes(willreturn, dereferenceable, nofree) deduction use this pattern. Should I wait for this patch being developed more?



================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:466
+  auto Assumed = S.getAssumed();
+  S ^= R;
+  return Assumed == S.getAssumed() ? ChangeStatus::UNCHANGED
----------------
Where `^=` and `&=` are defined? Are these operators already defined?


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:2127
                        SmallVectorImpl<Attribute> &Attrs) const override {
-    Attrs.emplace_back(Attribute::getWithAlignment(Ctx, getAssumedAlign()));
+    if (getAssumedAlign() > 1)
+      Attrs.emplace_back(Attribute::getWithAlignment(Ctx, getAssumedAlign()));
----------------
Why is this condition necessary?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66126





More information about the llvm-commits mailing list