mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 07:16:08 +00:00

This is part of effort in removing -enable-new-pm flag. As a prat of this effort one of example passes SimplifyCFG must be ported to new PM which will allow to remove the flag calls from the tests that are using this pass. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D137103
24 lines
868 B
LLVM
24 lines
868 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt %loadexampleirtransforms -passes=tut-simplifycfg -tut-simplifycfg-version=v1 -S < %s | FileCheck %s
|
|
; RUN: opt %loadexampleirtransforms -passes=tut-simplifycfg -tut-simplifycfg-version=v2 -S < %s | FileCheck %s
|
|
; RUN: opt %loadexampleirtransforms -passes=tut-simplifycfg -tut-simplifycfg-version=v3 -S < %s | FileCheck %s
|
|
|
|
define ptr @simp1(i32 %x) {
|
|
; CHECK-LABEL: @simp1(
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[X:%.*]], 42
|
|
; CHECK-NEXT: [[ADDR:%.*]] = select i1 [[CMP]], ptr inttoptr (i32 1 to ptr), ptr inttoptr (i32 1 to ptr)
|
|
; CHECK-NEXT: ret ptr [[ADDR]]
|
|
;
|
|
entry:
|
|
%cmp = icmp slt i32 %x, 42
|
|
%addr = select i1 %cmp, ptr blockaddress(@simp1, %bb1), ptr blockaddress(@simp1, %bb2)
|
|
ret ptr %addr
|
|
|
|
bb1:
|
|
ret ptr null
|
|
|
|
bb2:
|
|
ret ptr null
|
|
}
|