1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -loop-reduce < %s | FileCheck %s
4 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 declare void @maybe_throws()
10 define void @is_not_42(ptr %baseptr, ptr %finalptr) local_unnamed_addr align 2 personality ptr undef {
11 ; CHECK-LABEL: @is_not_42(
12 ; CHECK-NEXT: preheader:
13 ; CHECK-NEXT: br label [[HEADER:%.*]]
15 ; CHECK-NEXT: [[PTR:%.*]] = phi ptr [ [[INCPTR:%.*]], [[LATCH:%.*]] ], [ [[BASEPTR:%.*]], [[PREHEADER:%.*]] ]
16 ; CHECK-NEXT: invoke void @maybe_throws()
17 ; CHECK-NEXT: to label [[LATCH]] unwind label [[LPAD:%.*]]
19 ; CHECK-NEXT: [[TMP0:%.*]] = landingpad { ptr, i32 }
20 ; CHECK-NEXT: catch ptr inttoptr (i64 42 to ptr)
21 ; CHECK-NEXT: [[PTR_IS_NOT_42:%.*]] = icmp ne ptr [[PTR]], inttoptr (i64 42 to ptr)
22 ; CHECK-NEXT: call void @use1(i1 [[PTR_IS_NOT_42]])
23 ; CHECK-NEXT: ret void
25 ; CHECK-NEXT: [[INCPTR]] = getelementptr inbounds i8, ptr [[PTR]], i64 1
26 ; CHECK-NEXT: br label [[HEADER]]
32 %ptr = phi ptr [ %incptr, %latch ], [ %baseptr, %preheader ]
33 invoke void @maybe_throws() to label %latch unwind label %lpad
36 landingpad { ptr, i32 } catch ptr inttoptr (i64 42 to ptr)
37 %ptr_is_not_42 = icmp ne ptr %ptr, inttoptr (i64 42 to ptr)
38 call void @use1(i1 %ptr_is_not_42)
42 %incptr = getelementptr inbounds i8, ptr %ptr, i64 1