This is an archive of the discontinued LLVM Phabricator instance.

[LSV] Avoid adding vectors of pointers as candidates
ClosedPublic

Authored by bjope on Oct 25 2017, 9:26 AM.

Details

Summary

We no longer add vectors of pointers as candidates for
load/store vectorization. It does not seem to work anyway,
but without this patch we can end up in asserts when trying
to create casts between an integer type and the pointer of
vectors type.

The test case I've added used to assert like this when trying to
cast between i64 and <2 x i16*>:
opt: ../lib/IR/Instructions.cpp:2565: Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed.
#0 PrintStackTraceSignalHandler(void*)
#1 SignalHandler(int)
#2 restore_rt
#3
GI_raise
#4 GI_abort
#5
GI___assert_fail
#6 llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&, llvm::Instruction*)
#7 llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>::CreateBitOrPointerCast(llvm::Value*, llvm::Type*, llvm::Twine const&)
#8 Vectorizer::vectorizeStoreChain(llvm::ArrayRef<llvm::Instruction*>, llvm::SmallPtrSet<llvm::Instruction*, 16u>*)

Diff Detail

Repository
rL LLVM

Event Timeline

bjope created this revision.Oct 25 2017, 9:26 AM
arsenm accepted this revision.Oct 25 2017, 5:29 PM

LGTM, except missing check lines

test/Transforms/LoadStoreVectorizer/AMDGPU/merge-stores.ll
635 ↗(On Diff #120271)

Add check lines

This revision is now accepted and ready to land.Oct 25 2017, 5:29 PM
This revision was automatically updated to reflect the committed changes.