mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 12:19:53 +00:00
fb4ffccacb
Given that large parts of inst combine is restricted to instructions which have one use, getting rid of a use on the condition can help the effectiveness of the optimizer. Also, it allows the condition to potentially be deleted by instcombine rather than waiting for another pass. I noticed this completely by accident in another test case. It's not anything that actually came from a real workload. p.s. We should probably do the same thing for switch instructions. Differential Revision: http://reviews.llvm.org/D8220 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231881 91177308-0d34-0410-b5e6-96231b3b80d8
17 lines
279 B
LLVM
17 lines
279 B
LLVM
; RUN: opt -instcombine -S < %s | FileCheck %s
|
|
|
|
define i32 @test(i32 %x) {
|
|
; CHECK-LABEL: @test
|
|
entry:
|
|
; CHECK-NOT: icmp
|
|
; CHECK: br i1 undef,
|
|
%cmp = icmp ult i32 %x, 7
|
|
br i1 %cmp, label %merge, label %merge
|
|
merge:
|
|
; CHECK-LABEL: merge:
|
|
; CHECK: ret i32 %x
|
|
ret i32 %x
|
|
}
|
|
|
|
|