summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineFunctionPass.cpp
diff options
context:
space:
mode:
authorMatthew Simpson <mssimpso@codeaurora.org>2016-08-23 20:48:50 +0000
committerMatthew Simpson <mssimpso@codeaurora.org>2016-08-23 20:48:50 +0000
commitdf2ab917ad82577fc9efe128f0819123518d9f64 (patch)
tree0d9b3c76cca8dcf6ead5cc265a78af87cec3b27c /llvm/lib/CodeGen/MachineFunctionPass.cpp
parentf6884a1aac98077314176151e61cd82273062738 (diff)
downloadbcm5719-llvm-df2ab917ad82577fc9efe128f0819123518d9f64.tar.gz
bcm5719-llvm-df2ab917ad82577fc9efe128f0819123518d9f64.zip
[SLP] Avoid signed integer overflow
The test case included with r279125 exposed an existing signed integer overflow. Since getTreeCost can return INT_MAX, we can't sum this cost together with other costs, such as getReductionCost. This patch removes the possibility of assigning a cost of INT_MAX. Since we were previously using INT_MAX as an indicator for "should not vectorize", we now explicitly check this condition with "isTreeTinyAndNotFullyVectorizable" before computing a cost. This patch adds a run-line to the test case used for r279125 that ensures we don't vectorize. Previously, this line would vectorize the test case by chance due to undefined behavior in the cost calculation. Differential Revision: https://reviews.llvm.org/D23723 llvm-svn: 279562
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunctionPass.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud