summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-16 18:46:06 +0000
committerDan Gohman <gohman@apple.com>2008-09-16 18:46:06 +0000
commitdafa9c6e859cfdeed7488ec7fa6a5baf694e2f66 (patch)
treed25c0e4012394fadd0ad63825e1119c4f153c421 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
parent0ecb53a421da0750ad289674812ac676fc7664bc (diff)
downloadbcm5719-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/SelectionDAGBuild.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud