1 ; RUN: opt -passes='require<profile-summary>,function(codegenprepare)' -S -mtriple=x86_64-linux < %s | FileCheck %s
3 declare void @llvm.assume(i1 noundef) nounwind willreturn
5 ; Recursively deleting dead operands of assume() may result in its next
6 ; instruction deleted and the iterator pointing to the next instruction
7 ; invalidated. This prevents the following simple loop in
8 ; CodeGenPrepare::optimizeBlock() unless CurInstIterator is fixed:
10 ; CurInstIterator = BB.begin();
11 ; while (CurInstIterator != BB.end())
12 ; optimizeInst(&*CurInstIterator++, ModifiedDT);
14 define i32 @test_assume_in_loop(i1 %cond1, i1 %cond2) {
15 ; CHECK-LABEL: @test_assume_in_loop(
21 ; CHECK-NEXT: br label %loop
23 %cond3 = phi i1 [%cond1, %entry], [%cond4, %loop]
24 call void @llvm.assume(i1 %cond3)
25 %cond4 = icmp ult i1 %cond1, %cond2