[PATCH] D22867: [LV] Mark scalarized GEPs uniform

Matthew Simpson via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 08:22:31 PDT 2016


mssimpso created this revision.
mssimpso added reviewers: mkuper, wmi.
mssimpso added subscribers: llvm-commits, mcrosier.
Herald added a subscriber: mzolotukhin.

This patch refactors the logic in collectLoopUniforms and collectValuesToIgnore so that getelementptr instructions are marked uniform if they will remain scalar. Currently, such instructions are collected in collectValuesToIgnore to assist in marking induction variables as values to ignore in the cost model. With this refactoring, the logic in collectValuesToIgnore can be greatly simplified.

The patch brings about a few changes in functionality. First, it allows more instructions to be marked uniform, and therefore, places more instructions in VecValuesToIgnore. This enables the scalarization of additional induction variables for example (test included). Second, in getInstructionCost, currently all GEPs have a cost of 0 vs. 0 (scalar vs. vector). Now some of them will have a cost of 1 vs. 1, which shouldn't change the profitability decision.

https://reviews.llvm.org/D22867

Files:
  lib/Transforms/Vectorize/LoopVectorize.cpp
  test/Transforms/LoopVectorize/induction.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22867.65745.patch
Type: text/x-patch
Size: 9980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160727/e8d25fdc/attachment.bin>


More information about the llvm-commits mailing list