1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/Transforms/StructurizeCFG/switch.ll
Arthur Eubanks 77ffdb3e3c [StructurizeCFG][NewPM] Port -structurizecfg to NPM
This doesn't support -structurizecfg-skip-uniform-regions since that
would require porting LegacyDivergenceAnalysis.

The NPM doesn't support adding a non-analysis pass as a dependency of
another, so I had to add -lowerswitch to some tests or pin them to the
legacy PM.

This is the only RegionPass in tree, so I simply copied the logic for
finding all Regions from the legacy PM's RGManager into
StructurizeCFG::run().

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D89026
2020-10-23 15:54:03 -07:00

24 lines
581 B
LLVM

; RUN: opt -S -structurizecfg %s -o - -enable-new-pm=0 | FileCheck %s
; The structurizecfg pass cannot handle switch instructions, so we need to
; make sure the lower switch pass is always run before structurizecfg.
; CHECK-LABEL: @switch
define void @switch(i32 addrspace(1)* %out, i32 %cond) nounwind {
entry:
; CHECK: icmp
switch i32 %cond, label %done [ i32 0, label %zero]
; CHECK: zero:
zero:
; CHECK: store i32 7, i32 addrspace(1)* %out
store i32 7, i32 addrspace(1)* %out
; CHECK: br label %done
br label %done
; CHECK: done:
done:
; CHECK: ret void
ret void
}