[PATCH] D43536: [LV] Quick workaround for PR36311, vectorizer's isUniform() abuse triggers assert in SCEV

Hideki Saito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 27 15:36:40 PST 2018


hsaito added a comment.

In https://reviews.llvm.org/D43536#1021229, @rengolin wrote:

> Please attach this quick fix to the bug itself, so that people can use it while we fix the problem in the right place. We normally don't comment out code in LLVM, as that tends to leave code in comments all over the place.


Fair enough. Done attaching to the bug. We should then just get rid of this useless assert and be done with it. Just above, we have the following assertion, checking for unit-stride or gather/scatter.
Why bother check again for non-uniform address?, and this is on top of Legal already rejecting store to uniform address already.

  // Either Ptr feeds a vector load/store, or a vector GEP should feed a vector  
  // gather/scatter. Otherwise Decision should have been to Scalarize.           
  assert((ConsecutiveStride || CreateGatherScatter) && 
         "The instruction should be scalarized"); 

Also thought about creating a isUniform() functionality that can be invoked during vector code gen. Bulk of functionality should be already covered by
CostModel::isUniformAfterVectorization() ---- but calling such a thing after checking for the "ConsecutiveStride or GatherScatter" is rather odd.
I'm planning to do another architectural clean up, but using this bug as an excuse to do that would be a poor reasoning.


https://reviews.llvm.org/D43536





More information about the llvm-commits mailing list