The loop vectorizer optimizes loops containing conditional memory accesses by generating masked load and store intrinsics.
This decision is target dependent.
I already submitted the codegen changes for the intrinsics.
Paths
| Differential D6527
Using Masked Load / Store intrinsics in Loop Vectorizer Needs ReviewPublic Authored by delena on Dec 4 2014, 6:46 AM.
Details
Summary The loop vectorizer optimizes loops containing conditional memory accesses by generating masked load and store intrinsics. I already submitted the codegen changes for the intrinsics.
Diff Detail Event Timelinedelena updated this object. Comment Actions Very nice! I only see minor fixes. Thanks!
Comment Actions Hi Elena, Thank you for working on this. + bool canPredicateStore(Type *DataType, Value *Ptr) { Can you please document these functions? The name setMaskedOp is confusing and Doxygen style comments could be useful here. Thanks, Comment Actions Hi Elena, Please see a question from me in inline comments. And thanks for doing this! Michael
Comment Actions I'm adding comments, changing function names, joining 4 tests in one.
Comment Actions Thank you all for reviewing this. I addressed all comments and applying the updated patch. Comment Actions + / Returns true if vector representation of the instruction \p I Maybe a better name would be "isMaskRequired"? Comment Actions Hi Elena, Please see my comments inline.
Comment Actions To Michael: To Nadav:
No problem delena edited edge metadata. Comment ActionsMichael is right about potentially trapping constant expression. I addressed this issue and also added a test for it. Comment Actions Some changes in the patch should go in separately. For example:
+ return false; } } This is a whitespace fix. Just commit it as is.
+ assert(MaxVectorSize <= 64 && "Did not expect to pack so many elements" " into one vector!"); Also the assert change can go in. + void SI(); What is SI() ?? I would also split the TTI changes into a separate patch. It can probably go in already. Comment Actions Hi Elena, Thank you for checking-in the first (small) part of the changes. The code looks good to me except some minor nits (see inline), but I'd wait for a LGTM from Nadav or Arnold.
Revision Contents
Diff 17150 include/llvm/Analysis/TargetTransformInfo.h
lib/Analysis/TargetTransformInfo.cpp
lib/Target/X86/X86TargetTransformInfo.cpp
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/X86/masked_load_store.ll
|
Please fix indentation here.