Arithmetic instructions don't set EFLAGS bits OF and CF bits
authorDan Gohman <gohman@apple.com>
Sat, 7 Mar 2009 01:58:32 +0000 (01:58 +0000)
committerDan Gohman <gohman@apple.com>
Sat, 7 Mar 2009 01:58:32 +0000 (01:58 +0000)
commit3112581441cd22ac955b1af2d08effe3bab975da
tree75390e19a279468681deb75b5286359ae3a3e714
parent4b5051b0f91c35fed0d0d443ae435c51147d3d03
Arithmetic instructions don't set EFLAGS bits OF and CF bits
the same say the "test" instruction does in overflow cases,
so eliminating the test is only safe when those bits aren't
needed, as is the case for COND_E and COND_NE, or if it
can be proven that no overflow will occur. For now, just
restrict the optimization to COND_E and COND_NE and don't
do any overflow analysis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66318 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
test/CodeGen/X86/peep-test-2.ll [new file with mode: 0644]