1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
llvm-mirror/lib/Transforms/Vectorize
Robert Lougher 75ef160b89 [LoopVectorizer] When estimating reg usage, unused insts may "end" another use
The register usage algorithm incorrectly treats instructions whose value is
not used within the loop (e.g. those that do not produce a value).

The algorithm first calculates the usages within the loop.  It iterates over
the instructions in order, and records at which instruction index each use
ends (in fact, they're actually recorded against the next index, as this is
when we want to delete them from the open intervals).

The algorithm then iterates over the instructions again, adding each
instruction in turn to a list of open intervals.  Instructions are then
removed from the list of open intervals when they occur in the list of uses
ended at the current index.

The problem is, instructions which are not used in the loop are skipped.
However, although they aren't used, the last use of a value may have been
recorded against that instruction index.  In this case, the use is not deleted
from the open intervals, which may then bump up the estimated register usage.

This patch fixes the issue by simply moving the "is used" check after the loop
which erases the uses at the current index.

Differential Revision: https://reviews.llvm.org/D26554

llvm-svn: 286969
2016-11-15 14:27:33 +00:00
..
BBVectorize.cpp IR: Remove Value::intersectOptionalDataWith, replace all calls with calls to Instruction::andIRFlags. 2016-09-07 23:39:04 +00:00
CMakeLists.txt Add LoadStoreVectorizer pass 2016-06-30 23:11:38 +00:00
LLVMBuild.txt
LoadStoreVectorizer.cpp Add new target hooks for LoadStoreVectorizer 2016-10-03 10:31:34 +00:00
LoopVectorize.cpp [LoopVectorizer] When estimating reg usage, unused insts may "end" another use 2016-11-15 14:27:33 +00:00
SLPVectorizer.cpp Fixed the lost FastMathFlags for FCmp operations in SLPVectorizer. 2016-11-11 19:55:29 +00:00
Vectorize.cpp Add LoadStoreVectorizer pass 2016-06-30 23:11:38 +00:00