Skip to content

[SYCL] Common Reference Semantics for accessor class - #63

Merged
vladimirlaz merged 1 commit into
intel:syclfrom
v-klochkov:sycl
Apr 5, 2019
Merged

vladimirlaz merged 1 commit into
intel:syclfrom
v-klochkov:sycl

Conversation

@v-klochkov

Copy link
Copy Markdown
Contributor

Signed-off-by: Vyacheslav N Klochkov [email protected]

@vladimirlaz
vladimirlaz merged commit 7e5a7aa into intel:sycl Apr 5, 2019
// ... first descriptor (translated to pointer kernel parameter):
// The parameter is a SYCL accessor object.
// The Info field of the parameter descriptor for accessor contains
// two template parameters packed into thid integer field:

@keryell keryell Apr 5, 2019 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand this sentence.

But great to have all this new documentation. I love reading a lot of comments while reading some code. :-)

By the way @vladimirlaz can you wait a little bit longer before merging the commits? Because of the different timezones we do not have time to just look at the commits before merging...
One more day should be enough.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree to wait till next working day to let everybody provide comments

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to make the comment better than it was before (it though had some misprint at L714: thid -> this).
It is sad that it causes questions and needs some rephrasing/rewriting.

Would this one be better? (I could update this place sometime in future when fix this file again).

The 2nd argument of the call H.addParamDesc() below defines what is written
to the accessor parameter descriptor and its int field 'Info'.
For the template class accessor<Type, Dimensions, Mode, Target, IsPlaceHolder>
it keeps both 'Target' and 'Dimensions' packed into that int field 'Info' as:
(Target | (Dimensions << 11)).

bb-sycl pushed a commit that referenced this pull request Jul 11, 2019
We are about to add enum attributes with AttrKind numbers >= 63. This
means we cannot use AttrKind #63 to test for an invalid attribute number
in the RAW format anymore. This patch changes the number of an invalid
attribute to #255. There is no change to the character of the tests.

Differential Revision: https://reviews.llvm.org/D64531

llvm-svn: 365722
vladimirlaz pushed a commit to vladimirlaz/llvm that referenced this pull request Oct 25, 2019
  CONFLICT (content): Merge conflict in clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp
vmaksimo pushed a commit to vmaksimo/llvm that referenced this pull request Feb 19, 2021
  CONFLICT (content): Merge conflict in clang/lib/Driver/ToolChains/Clang.cpp
Zyntax9 pushed a commit to Zyntax9/llvm that referenced this pull request Apr 1, 2021
  CONFLICT (content): Merge conflict in clang/lib/Sema/SemaLookup.cpp
iclsrc pushed a commit that referenced this pull request Jul 20, 2026
…SHL (#207628)

`select(icmp ult(amt, EltSize), shl(x, amt), 0)`, where EltSize is the
{8, 16, 32, 64} lane size, is the usual way to guard a variable vector
shift against shl poison. On AArch64 the guard is unnecessary because
USHL already returns zero once the shift amount reaches the lane size.

For v4i32:

Before:
```
	movi	v2.4s, #63
	movi	v3.4s, #32
	and	v1.16b, v1.16b, v2.16b
	ushl	v0.4s, v0.4s, v1.4s
	cmhi	v1.4s, v3.4s, v1.4s
	and	v0.16b, v1.16b, v0.16b
```
After:
```
	movi	v2.4s, #63
	and	v1.16b, v1.16b, v2.16b
	ushl	v0.4s, v0.4s, v1.4s
```

USHL reads each lane's shift amount as a signed value from its low byte
so amounts above 127 would be misread. The fold applies directly when
known bits can prove the amounts are at most 127 and otherwise the
amounts are clamped to EltSize with umin first, which is still one
instruction cheaper than the select.

NEON has no umin for 64-bit lanes so unbounded v2i64 amounts use the SVE
umin when available and otherwise keep the select.

lshr gets the same fold since it already lowers to ushl with a negated
amount.

This is the AArch64 counterpart of #86922, which added the same folds
for AVX2's variable shifts. This does the select(shift) half; the
shift(select) form will be a follow-up.

Closes #200698.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants