Don't PRE compares.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 29 Mar 2012 17:22:39 +0000 (17:22 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Thu, 29 Mar 2012 17:22:39 +0000 (17:22 +0000)
commit41e2073f623a08504e2e1e5a9fc5c9f22a03eb83
treec4f05adc3565dc1ccd4bdfd913e4a9b091e23fdb
parent73478404af7f6b6e64bdda5920ebaede6a4e7a14
Don't PRE compares.

CodeGenPrepare sinks compare instructions down to their uses to prevent
live flags and predicate registers across basic blocks.

PRE of a compare instruction prevents that, forcing the i1 compare
result into a general purpose register.  That is usually more expensive
than the redundant compare PRE was trying to eliminate in the first
place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153657 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/GVN.cpp
test/Transforms/GVN/pre-compare.ll [new file with mode: 0644]