This is an archive of the discontinued LLVM Phabricator instance.

Pointers in Masked Load, Store, Gather, Scatter intrinsics.
ClosedPublic

Authored by delena on Oct 28 2015, 8:32 AM.

Details

Summary

The masked intrinsics support all integer and floating point data types. I added the pointer type to this list.
Added tests for CodeGen and for Loop Vectorizer.
Updated the Language Reference.

Diff Detail

Repository
rL LLVM

Event Timeline

delena updated this revision to Diff 38661.Oct 28 2015, 8:32 AM
delena retitled this revision from to Pointers in Masked Load, Store, Gather, Scatter intrinsics..
delena updated this object.
delena added reviewers: Ayal, hfinkel, mzolotukhin.
delena set the repository for this revision to rL LLVM.
delena added subscribers: llvm-commits, mkuper.
mkuper added a comment.Nov 9 2015, 7:04 AM

Hi Elena,

A few comments inline.

../docs/LangRef.rst
11266 ↗(On Diff #38661)

Can we make this one sentence? "The loaded data is a vector of any integer, floating point, or pointer data type", perhaps?

11311 ↗(On Diff #38661)

Same as above.

../lib/IR/Function.cpp
495 ↗(On Diff #38661)

Perhaps it's worth handling all vectors here, instead of checking for PointerType?
Or does the potential discrepancy with getEVTString() for MVT vector types break something?

delena updated this revision to Diff 39810.Nov 10 2015, 7:15 AM
delena marked 2 inline comments as done.

Updated according to Michael's comments.

../lib/IR/Function.cpp
495 ↗(On Diff #38661)

Yes, getEVTString() works only for simple types. I changed the patch and invoked the recursion for all vectors. In this case the mangled string will be composed for vector of functions, vector of structures, vector of vectors ..

Ayal added inline comments.Nov 10 2015, 2:59 PM
../docs/LangRef.rst
11316 ↗(On Diff #39810)

mangled ".v16f32" suffix mismatch with "<16 x i32> <value>" and "<16 x i32>* <ptr>".

11367 ↗(On Diff #39810)

"<8 x float*[*]> <ptrs>"

11415 ↗(On Diff #39810)

"an arbitrary memory address[es]".

11420 ↗(On Diff #39810)

mangled ".v16f32" suffix mismatch with "<16 x i32> <value>" and "<16 x i32*> <ptrs>".

../test/Transforms/LoopVectorize/X86/masked_load_store.ll
506 ↗(On Diff #39810)

"in[i] != 0" may look better than "in[i] > 0", as it is a pointer.

578 ↗(On Diff #39810)

same here.

delena updated this revision to Diff 40012.Nov 11 2015, 11:56 PM
delena marked 4 inline comments as done.

Addressed Ayal's comments in the documentation.

mkuper accepted this revision.Nov 18 2015, 3:56 AM
mkuper added a reviewer: mkuper.

LGTM, except that I think it may be a good idea to apply Ayal's suggestion to the test (in[i] > 0 => in[i] != 0).

This revision is now accepted and ready to land.Nov 18 2015, 3:56 AM
This revision was automatically updated to reflect the committed changes.