summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-06-18 04:38:31 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-06-18 04:38:31 +0000
commite8fd9561cb16d9d8398276e8c4ca836199b7699c (patch)
tree87338a5f276ac96b69740a92fa8c45a4d14dd75f /llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
parentdc62be191503c932a2025b2489c2da0c55d46ec3 (diff)
downloadbcm5719-llvm-e8fd9561cb16d9d8398276e8c4ca836199b7699c.tar.gz
bcm5719-llvm-e8fd9561cb16d9d8398276e8c4ca836199b7699c.zip
[SCEV] Fix incorrect trip count computation
The way we elide max expressions when computing trip counts is incorrect -- it breaks cases like this: ``` static int wrapping_add(int a, int b) { return (int)((unsigned)a + (unsigned)b); } void test() { volatile int end_buf = 2147483548; // INT_MIN - 100 int end = end_buf; unsigned counter = 0; for (int start = wrapping_add(end, 200); start < end; start++) counter++; print(counter); } ``` Note: the `NoWrap` variable that was being tested has little to do with the values flowing into the max expression; it is a property of the induction variable. test/Transforms/LoopUnroll/nsw-tripcount.ll was added to solely test functionality I'm reverting in this change, so I've deleted the test fully. llvm-svn: 273079
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud