This is an archive of the discontinued LLVM Phabricator instance.

invariant.group and invariant.group.barrier docs
ClosedPublic

Authored by Prazek on Jul 21 2015, 6:30 PM.

Diff Detail

Event Timeline

Prazek updated this revision to Diff 30303.Jul 21 2015, 6:30 PM
Prazek retitled this revision from to invariant.group stuff.
Prazek updated this object.
nlewycky added inline comments.
docs/LangRef.rst
5751

Typo "referenece"

5755

Typo "loados"

5756

Consider:
(but see the @llvm.invariant.barrier() intrinsic which affects when two pointers are considered the same).

5863

Typo "referenece"

5867

Typo "loados"

5868

Consider:
(but see the @llvm.invariant.barrier() intrinsic which affects when two pointers are considered the same).

10170–10171

I'd remove "specifies that given a pointer," and switch "the first" with "its argument" and "produces" with "returns":

The '``llvm.invariant.group.barrier``' intrinsic returns another pointer that aliases its argument but which is considered different for the purposes of load/store !invariant.group metadata.
10183–10184

Consider:
This intrinsic produces a copy of its argument, except that it is a distinct pointer for the purposes of the !invariant.group metadata.

rsmith added a subscriber: rsmith.Jul 21 2015, 6:41 PM
rsmith added inline comments.
docs/LangRef.rst
5753

existance -> existence

5755

have the same -> has the same
loados -> loads

5756

This suggests that any such call could affect the loads. I think the right model is that the @llvm.invariant.group.barrier returns a different pointer value. That makes this parenthetical redundant, since "same pointer value" is already a side-condition.

5815–5816

invariant.group.barrier -> invariant.group

5863–5868

Same comments as above.

5865

existance -> existence

5867

that have -> that has
loados -> loads

10178

might changed -> might have changed

... but I don't think that's quite what we want to say. Something like:

the pointer to the memory for which the invariant no longer holds

maybe?

10183–10184

I don't think it's accurate to say this affects the "next" load/store. The text in the "Overview" section seems like a good fit for a semantic description of the intrinsic. Maybe in the overview you could put something more general like "The <...> intrinsic can be used when an invariant established by !invariant.group metadata no longer holds, to obtain a new pointer value that does not carry the invariant information."

10186–10190

Delete this, we already have this heading on line 10151.

Prazek updated this revision to Diff 30317.Jul 21 2015, 8:57 PM
Prazek marked 16 inline comments as done.
reames added a subscriber: reames.Jul 31 2015, 2:54 PM
reames added inline comments.
docs/LangRef.rst
5754

The fact that it's the llvm::Value of a pointer that matters and not it's runtime value (aka the actual address) is non-obvious from this description.

5755

The comma in "value, that" seems misplaced. I think you intend something like the following:
"every load and store to the same pointer operand within the same invariant group (i.e. index), can be assume to load or store the same bit value..."

5762

Stray change, please submit separately.

5863

Given the repetition here, I'd suggest adding a new subsection defining the notion of an invariant group and then reference that from the per instruction description.

Prazek updated this revision to Diff 33878.Sep 2 2015, 4:24 PM
Prazek retitled this revision from invariant.group stuff to invariant.group and invariant.group.barrier docs.
Prazek added reviewers: reames, rsmith, majnemer, echristo.
Prazek marked 3 inline comments as done.
Prazek added a subscriber: llvm-commits.

Getting ready to push it to master with invariant.group.barrier implementation

nlewycky added inline comments.Sep 8 2015, 1:50 PM
docs/LangRef.rst
3765

"atached" --> "attached"

3768

"can be assume" --> "can be assumed"

3768

What does it mean to be assumed to store the same bit value? In the case of loads I think it means that the load must return the same value. Is the store stating that the store must be storing the same value, that is the value operand of the two stores is bit equivalent?

3876–3877

This should either be removed or committed independently.

10157

Either revert this newline or commit it independently if correct.

10178

"it's" --> "its"

Prazek marked 5 inline comments as done.Sep 14 2015, 4:12 PM
Prazek added inline comments.Sep 14 2015, 4:17 PM
docs/LangRef.rst
3768

I don't understand what you are saying. It means that 2 stores with the same invariant.group and same operand must store the same value

rsmith added inline comments.Sep 14 2015, 4:28 PM
docs/LangRef.rst
3768

Remove the word "bit" here, just "load or store the same value".

3782–3783

You should insert a call between these two, since otherwise we can assume they load the same value because the value cannot have changed between the two loads.

3792

Again, insert a call before this load, since otherwise we can prove that this loads 42 because we just saw a store of 42 to the same region of memory.

Prazek updated this revision to Diff 34760.Sep 14 2015, 5:09 PM
Prazek marked 5 inline comments as done.
rsmith accepted this revision.Sep 14 2015, 5:23 PM
rsmith edited edge metadata.

LGTM, I think you've addressed everyone's feedback.

docs/LangRef.rst
3765

instruction -> instructions

3768

Remove the comma here.

This revision is now accepted and ready to land.Sep 14 2015, 5:23 PM
Prazek updated this revision to Diff 34763.Sep 14 2015, 5:41 PM
Prazek edited edge metadata.
Prazek closed this revision.Sep 15 2015, 11:34 AM