[PATCH] D93039: Introduce llvm.noalias.decl intrinsic

Jeroen Dobbelaere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 24 09:34:58 PST 2021


jeroen.dobbelaere added inline comments.


================
Comment at: llvm/lib/IR/Verifier.cpp:121
+    cl::desc("Ensure that llvm.experimental.noalias.scope.decl for identical "
+             "scopes are not dominating"));
+
----------------
nikic wrote:
> fhahn wrote:
> > jeroen.dobbelaere wrote:
> > > nikic wrote:
> > > > Can we flip this flag now, or are you aware of any further issues?
> > > I just did a test-suite run and a stage2 release build using an assertion build with the flag flipped, and both went fine. IMHO it makes sense to try it out...
> > > 
> > What's the impact on compile-time? If it is potentially expensive, it should probably be `true` for `EXPENSIVE_CHECKS` builds.
> I see no reason for it to be expensive at least.
@fhahn, @nikic, It's O(N log(N)) (sorting of N = number of scope declarations)
Next to that, it is roughly k * O((M-1)^2) * O(dominance checking) with M the the number of identical scope declarations, and k the number if different scopes.
In practice M should be pretty low (mostly 1) and O(N log(N)) should be the main part.

Is that considered to be too expensive ?




================
Comment at: llvm/lib/IR/Verifier.cpp:5586
+
+    // [ItCurrent, ItNext[ represents the declarations for the same scope.
+    // Ensure they are not dominating each other
----------------
xbolva00 wrote:
> jeroen.dobbelaere wrote:
> > asbirlea wrote:
> > > jeroen.dobbelaere wrote:
> > > > asbirlea wrote:
> > > > > s/[/]
> > > > ItCurrent inclusive, ItNext exclusive.
> > > > Or   [ ItCurrent, ItNext-1 ].
> > > > 
> > > Thank you for the clarification, I realized the interval from the code, but then didn't connect it to the comment notation.
> > > This format is new to me. I was taught the mathematical notation is `[ItCurrent, ItNext)` in this case, or, as you said, `[ItCurrent, ItNext-1]`.
> > @asbirlea Both are valid it seems https://en.wikipedia.org/wiki/Interval_(mathematics)#Including_or_excluding_endpoints
> > and https://en.wikipedia.org/wiki/ISO_31-11
> > I (and my children) learned the notation using only '[' and ']' ;)
> > 
> I would prefer more common notation too. It may look like a typo, and somebody in the future may “fix” it to ].
@xbolva00 That probably depends on what you learned and might go in both directions. Do we have an llvm guidance on what notation to use ? I have no problem with using the '[' ')' style, but it might make sense that it is documented as the preferred style for llvm ?



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93039



More information about the llvm-commits mailing list