diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-06-05 20:48:05 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-06-05 20:48:05 +0000 |
commit | f6e138d794977f2dada8c15fed8de338d99f328d (patch) | |
tree | 6a8ae68ca766cb221e67a52fbffd02f8adbcff8f /llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp | |
parent | 7953e62f2eec40d5a6ba6be725e49eadd9c218cd (diff) | |
download | bcm5719-llvm-f6e138d794977f2dada8c15fed8de338d99f328d.tar.gz bcm5719-llvm-f6e138d794977f2dada8c15fed8de338d99f328d.zip |
[ConstantRange] Remove costly udivrem from ConstantRange::truncate
Truncate currently uses a udivrem call which is going to be slow particularly for larger than 64-bit widths.
As far as I can tell all we were trying to do was modulo LowerDiv by (MaxValue+1) and make sure whatever value was effectively subtracted from LowerDiv was also subtracted from UpperDiv.
This patch recognizes that MaxValue+1 is a power of 2 so we can just use a bitwise AND to accomplish a modulo operation or isolate the upper bits.
Differential Revision: https://reviews.llvm.org/D32672
llvm-svn: 304733
Diffstat (limited to 'llvm/lib/ObjectYAML/CodeViewYAMLDebugSections.cpp')
0 files changed, 0 insertions, 0 deletions