[PATCH] D26083: [LV] Scalarize operands of predicated instructions

Matthew Simpson via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 09:00:10 PDT 2016

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

This patch attempts to scalarize the operand expressions of predicated instructions if they were conditionally executed in the original loop. After scalarization, the expressions will be sunk inside the blocks created for the predicated instructions. The transformation essentially performs un-if-conversion on the operands.

The cost model has been updated to determine if scalarization is profitable. It compares the cost of a vectorized instruction, assuming it will be if-converted, to the cost of the scalarized instruction, assuming that the instructions corresponding to each vector lane will be sunk inside a predicated block, possibly avoiding execution. If it's more profitable to scalarize the entire expression tree feeding the predicated instruction, the expression will be scalarized; otherwise, it will be vectorized. We only consider the cost of the entire expression to accurately estimate the cost of the required insertelement and extractelement instructions.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26083.76204.patch
Type: text/x-patch
Size: 14174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161028/94ddc747/attachment.bin>

More information about the llvm-commits mailing list