2019-05-25 21:11:22 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
2019-04-17 12:52:47 +08:00
|
|
|
; RUN: opt -S -simplifycfg < %s | FileCheck %s
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
declare i32* @fn1(i32* returned)
|
|
|
|
|
|
|
|
define i32 @test1(i1 %B) {
|
2019-05-25 21:11:22 +08:00
|
|
|
; CHECK-LABEL: @test1(
|
|
|
|
; CHECK-NEXT: entry:
|
|
|
|
; CHECK-NEXT: br label [[FOR_COND_US:%.*]]
|
|
|
|
; CHECK: for.cond.us:
|
[SimplifyCFG] Added condition assumption for unreachable blocks
Summary: PR41688
Reviewers: spatel, efriedma, craig.topper, hfinkel, reames
Reviewed By: hfinkel
Subscribers: javed.absar, dmgreen, fhahn, hfinkel, reames, nikic, lebedev.ri, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61409
llvm-svn: 361707
2019-05-26 06:34:27 +08:00
|
|
|
; CHECK-NEXT: [[TMP0:%.*]] = xor i1 [[B:%.*]], true
|
|
|
|
; CHECK-NEXT: call void @llvm.assume(i1 [[TMP0]])
|
2019-05-25 21:11:22 +08:00
|
|
|
; CHECK-NEXT: br label [[FOR_COND_US]]
|
|
|
|
;
|
2019-04-17 12:52:47 +08:00
|
|
|
entry:
|
|
|
|
br label %for.cond.us
|
|
|
|
|
|
|
|
for.cond.us: ; preds = %for.cond.us, %entry
|
|
|
|
br i1 %B, label %for.cond4.preheader, label %for.cond.us
|
|
|
|
|
|
|
|
for.cond4.preheader: ; preds = %for.cond.us
|
|
|
|
br i1 %B, label %for.cond4.preheader.split.us, label %for.cond4
|
|
|
|
|
|
|
|
for.cond4.preheader.split.us: ; preds = %for.cond4.preheader
|
|
|
|
unreachable
|
|
|
|
|
|
|
|
for.cond4: ; preds = %for.end, %for.cond4.preheader
|
|
|
|
%phi = phi i32* [ %call, %for.end ], [ undef, %for.cond4.preheader ]
|
|
|
|
%call = call i32* @fn1(i32* %phi)
|
|
|
|
br label %for.cond5
|
|
|
|
|
|
|
|
for.cond5: ; preds = %for.cond5, %for.cond4
|
|
|
|
br i1 %B, label %for.cond5, label %for.end
|
|
|
|
|
|
|
|
for.end: ; preds = %for.cond5
|
|
|
|
%load = load i32, i32* %call, align 4
|
|
|
|
br label %for.cond4
|
[SimplifyCFG] Added condition assumption for unreachable blocks
Summary: PR41688
Reviewers: spatel, efriedma, craig.topper, hfinkel, reames
Reviewed By: hfinkel
Subscribers: javed.absar, dmgreen, fhahn, hfinkel, reames, nikic, lebedev.ri, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61409
llvm-svn: 361707
2019-05-26 06:34:27 +08:00
|
|
|
}
|