[PATCH] D31710: [AMDGPU] Fix for issue in alloca to vector promotion pass

David Stuttard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 02:59:50 PDT 2017


dstuttard added a comment.

As you say, the issue actually is that non-canonical IR was being presented to the pass - the front-end has since been updated to fix this (although possibly not in the way it should).

The question is, what should this pass do when valid, but non-canonical IR is passed in. My inclination is to strip out the code to transform to vector in this case and instead just more gracefully handle instead (the tryPromoteAlloca function will just return false - as with other cases it can't handle).

Not sure what you mean with your last comment

> Similarly we give up on array allocas in the form where they are allocating N items of the element type.

If you mean that the tryPromoteAlloca gives up for N<2 or N>4 as an example of what to do - then yes, that's what I'm proposing for this case as well.


https://reviews.llvm.org/D31710





More information about the llvm-commits mailing list