Optimize code placement in loop to eliminate unconditional branches or move unconditi...
commit67bf8e2b3944b74e0a0c483c54b12f2c02a4b758
authorEvan Cheng <evan.cheng@apple.com>
Fri, 8 May 2009 06:34:09 +0000 (8 06:34 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 8 May 2009 06:34:09 +0000 (8 06:34 +0000)
treec3a66d59799b3626327d15ebc0391fc49f1dfe1f
parent9fb109a1a060895f0e6be87eb73c98bf387ba84d
Optimize code placement in loop to eliminate unconditional branches or move unconditional branch to the outside of the loop. e.g.

///       A:
///       ...
///       <fallthrough to B>
///
///       B:  --> loop header
///       ...
///       jcc <cond> C, [exit]
///
///       C:
///       ...
///       jmp B
///
/// ==>
///
///       A:
///       ...
///       jmp B
///
///       C:  --> new loop header
///       ...
///       <fallthough to B>
///
///       B:
///       ...
///       jcc <cond> C, [exit]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71209 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CodePlacementOpt.cpp
lib/Target/X86/X86InstrInfo.cpp
test/CodeGen/X86/code_placement.ll [new file with mode: 0644]