diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-16 18:46:06 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-16 18:46:06 +0000 |
commit | dafa9c6e859cfdeed7488ec7fa6a5baf694e2f66 (patch) | |
tree | d25c0e4012394fadd0ad63825e1119c4f153c421 /llvm/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp | |
parent | 0ecb53a421da0750ad289674812ac676fc7664bc (diff) | |
download | bcm5719-llvm-dafa9c6e859cfdeed7488ec7fa6a5baf694e2f66.tar.gz bcm5719-llvm-dafa9c6e859cfdeed7488ec7fa6a5baf694e2f66.zip |
Improve instcombine's handling of integer min and max in two ways:
- Recognize expressions like "x > -1 ? x : 0" as min/max and turn them
into expressions like "x < 0 ? 0 : x", which is easily recognizable
as a min/max operation.
- Refrain from folding expression like "y/2 < 1" to "y < 2" when the
comparison is being used as part of a min or max idiom, like
"y/2 < 1 ? 1 : y/2". In that case, the division has another use, so
folding doesn't eliminate it, and obfuscates the min/max, making it
harder to recognize as a min/max operation.
These benefit ScalarEvolution, CodeGen, and anything else that wants to
recognize integer min and max.
llvm-svn: 56246
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/ScheduleDAGEmit.cpp')
0 files changed, 0 insertions, 0 deletions