mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
9033ba7995
It is confusing to have two ways of specifying the same pass ('simple-loop-unswitch' and 'unswitch'). This patch replaces 'unswitch' by 'simple-loop-unswitch' to get a unique identifier. Using 'simple-loop-unswitch' instead of 'unswitch' also has the advantage of matching how the pass is named in DEBUG_TYPE etc. So this makes it a bit more consistent how we refer to the pass in options such as -passes, -print-after and -debug-only. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D105628
35 lines
785 B
LLVM
35 lines
785 B
LLVM
; RUN: opt -passes='loop(simple-loop-unswitch),verify<loops>' -S < %s | FileCheck %s
|
|
; RUN: opt -verify-memoryssa -passes='loop-mssa(simple-loop-unswitch),verify<loops>' -S < %s | FileCheck %s
|
|
|
|
declare void @incf()
|
|
declare void @decf()
|
|
|
|
define i32 @test2(i32 %c) {
|
|
; CHECK-LABEL: @test2(
|
|
br label %loop_begin
|
|
|
|
; CHECK: !prof ![[MD0:[0-9]+]]
|
|
; CHECK: loop_begin:
|
|
; CHECK: !prof ![[MD1:[0-9]+]]
|
|
loop_begin:
|
|
|
|
switch i32 %c, label %default [
|
|
i32 1, label %inc
|
|
i32 2, label %dec
|
|
], !prof !{!"branch_weights", i32 99, i32 1, i32 2}
|
|
|
|
inc:
|
|
call void @incf()
|
|
br label %loop_begin
|
|
|
|
dec:
|
|
call void @decf()
|
|
br label %loop_begin
|
|
|
|
default:
|
|
ret i32 0
|
|
}
|
|
|
|
; CHECK: ![[MD0]] = !{!"branch_weights", i32 99, i32 1, i32 2}
|
|
; CHECK: ![[MD1]] = !{!"branch_weights", i32 2, i32 1}
|