[PATCH] D88669: [ValueTracking] Add tracking of the alignment assume bundle

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 13 14:02:38 PDT 2020


jdoerfert added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:799
+        return;
+      }
+
----------------
You don't want to look for the bundle yourself. Use
```
  SmallVector<Attribute::AttrKind, 2> AttrKinds{Attribute::Align};
  if (RetainedKnowledge RK = getKnowledgeValidInContext(V, AttrKinds, CtxI, DT, AC)) {
    ...
  }
```
instead to account for all the interesting cases, e.g., multiple `align` bundles. Also, use braces for non trivial conditionals. I don't think the return is what you want here, other deductions might still apply. Also, I think we have alignment bundle -> Align information in the `AlignmentFromAssumptions.cpp` pass. We should create a helper function so this is less magic.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88669



More information about the llvm-commits mailing list