[PATCH] D12559: Fix IRBuilder CreateBitOrPointerCast for vector types

Mikhail Zolotukhin via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 15:22:41 PDT 2015


Thanks, Evgeniy! Here is IR testcase:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reduced.ll
Type: application/octet-stream
Size: 2865 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150902/98bbc801/attachment.obj>
-------------- next part --------------



opt < reduced.ll -tbaa -loop-vectorize -enable-interleaved-mem-accesses=true -o /dev/null

Assertion failed: (CastInst::castIsValid(opc, C, Ty) && "Invalid constantexpr cast!"), function getCast, file /Users/buildslave/devel/llvm.git/lib/IR/Constants.cpp, line 1599.
0  opt                      0x0000000106da3b49 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 57
1  opt                      0x0000000106da3046 llvm::sys::RunSignalHandlers() + 70
2  opt                      0x0000000106da45fc SignalHandler(int) + 652
3  libsystem_platform.dylib 0x00007fff8b56bf1a _sigtramp + 26
4  libsystem_platform.dylib 0x00007fff60bd2764 _sigtramp + 3580258404
5  opt                      0x0000000106da42b6 abort + 22
6  opt                      0x0000000106da4291 __assert_rtn + 81
7  opt                      0x0000000106c08091 llvm::ConstantExpr::getCast(unsigned int, llvm::Constant*, llvm::Type*, bool) + 513
8  opt                      0x000000010664275e llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> >::CreateBitOrPointerCast(llvm::Value*, llvm::Type*, llvm::Twine const&) + 206
9  opt                      0x00000001066390c9 (anonymous namespace)::InnerLoopVectorizer::vectorizeMemoryInstruction(llvm::Instruction*) + 2921
10 opt                      0x00000001066342c2 (anonymous namespace)::InnerLoopVectorizer::vectorizeLoop() + 3986
11 opt                      0x00000001066327c9 (anonymous namespace)::InnerLoopVectorizer::vectorize((anonymous namespace)::LoopVectorizationLegality*) + 8009
12 opt                      0x000000010662acc7 (anonymous namespace)::LoopVectorize::processLoop(llvm::Loop*) + 20951
13 opt                      0x00000001066259b4 (anonymous namespace)::LoopVectorize::runOnFunction(llvm::Function&) + 1348
14 opt                      0x0000000106cf503e llvm::FPPassManager::runOnFunction(llvm::Function&) + 318
15 opt                      0x0000000106cf529b llvm::FPPassManager::runOnModule(llvm::Module&) + 43
16 opt                      0x0000000106cf5843 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1091
17 opt                      0x0000000105d161d4 main + 8484
18 libdyld.dylib            0x00007fff8ea315c9 start + 1
Stack dump:
0.      Program arguments: Release+Asserts/bin/opt -tbaa -loop-vectorize -enable-interleaved-mem-accesses=true -o /dev/null
1.      Running pass 'Function Pass Manager' on module '<stdin>'.
2.      Running pass 'Loop Vectorization' on function '@_ZNK1C5m_fn3ER1B'
Illegal instruction: 4

Michael

> On Sep 2, 2015, at 3:08 PM, Evgeniy Stepanov <eugenis at google.com> wrote:
> 
> eugenis added a comment.
> 
> Almost minimized test case, build with --target=armv7-linux-gnueabi -std=c++11 -O2 -c
> 
> class A {
> 
>  char *Data;
>  int Length;
> 
> public:
> 
>  A() : Data(), Length() {}
> 
> };
> void *operator new(unsigned, void *);
> class B {
> public:
> 
>  A *resize_I;
>  void m_fn1() {
>    for (auto E = m_fn2(); resize_I != E; ++resize_I)
>      new (resize_I) A;
>  }
>  A *m_fn2();
> 
> };
> 
> class C {
> 
>  void m_fn3(B &) const;
> 
> };
> void C::m_fn3(B &p1) const const { p1.m_fn1(); }
> 
> 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D12559&d=BQIFaQ&c=eEvniauFctOgLOKGJOplqw&r=ygVmcuuQ1MUhRUoJm-IgPtgjmvM0byfjlHDg99vufEI&m=Z2yFYsSwYOcnzFPgmZoaZCCs-6rmpZN5zZTNTrqizWE&s=2pD_TEZopGaRmZfKvvyToDU6w8UxW--uh_PJgBhh63U&e= 
> 
> 
> 



More information about the llvm-commits mailing list