[PATCH] D40455: Teach InlineCost about address spaces

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 21:13:06 PST 2018


skatkov added a comment.

Dear Bjorn, your added test in byvall.ll expose the problem in inliner causing an assert.

Specifically if I excerpt you test in separate file and run:
$ opt -S -inline -instcombine test.ll
I've got a 
opt: ../../lib/Analysis/ValueTracking.cpp:1551: void computeKnownBits(const llvm::Value*, llvm::KnownBits&, unsigned int, const {anonymous}::Query&): Assertion `Q.DL.getTypeSizeInBits(V->getType()->getScalarType()) == BitWidth && "V and Known should have same BitWidth"' failed.

The reason of this is that %p is substituted with
 %d = alloca %struct.S1, align 8
which is from addrspace(0) and has a different pointer size than %p.

I'm far from thinking that your patch is causing this issue but probably it is long standing issue in inliner. But it causes the crash in our custom pipeline. 
I do not want to revert your patch if you can quickly update the patch or simply revert the patch itself.

A separate bug against inliner can be filed...

Does it make sense to you?


Repository:
  rL LLVM

https://reviews.llvm.org/D40455





More information about the llvm-commits mailing list