Skip to content
Commit 34a7a945 authored by Pete Cooper's avatar Pete Cooper
Browse files

Don't generate unnecessary signed ConstantRange during multiply. NFC

r231483 taught ConstantRange::multiply to be clever about signed vs unsigned ranges. For example, an unsigned range could be full-set while the signed range is more specific than that.

In looking at the allocations trace for LTO'ing verify-uselistorder (see r236629 for details), millions of allocations are from APInt, many of which come from ConstantRange's.

This change tries to avoid some (3.2 million) allocations by returning the unsigned range if its suitable. The checks here are that it should not be a wrapping range, and should be positive. That should be enough to check for ranges such as [1, 10) which the signed range will be equal to, if we were to calculate it.

Differential Revision: http://reviews.llvm.org/D20723

Reviewed by James Molloy

llvm-svn: 271020
parent 32b4d15e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment