1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=indvars -S | FileCheck %s
4 declare void @foo(i64 noundef)
6 ; Function Attrs: mustprogress noreturn uwtable
7 define void @pr59633(ptr noundef %ptr) {
8 ; CHECK-LABEL: @pr59633(
10 ; CHECK-NEXT: [[PTR1:%.*]] = ptrtoint ptr [[PTR:%.*]] to i64
11 ; CHECK-NEXT: [[TMP0:%.*]] = trunc i64 [[PTR1]] to i4
12 ; CHECK-NEXT: [[TMP1:%.*]] = zext i4 [[TMP0]] to i64
13 ; CHECK-NEXT: br label [[WHILE_BODY:%.*]]
15 ; CHECK-NEXT: tail call void @foo(i64 noundef [[TMP1]])
16 ; CHECK-NEXT: br label [[WHILE_BODY]]
21 while.body: ; preds = %entry, %while.body
22 %ptr.addr.0 = phi ptr [ %ptr, %entry ], [ %add.ptr, %while.body ]
23 %0 = ptrtoint ptr %ptr.addr.0 to i64
24 %and = and i64 %0, 15 ; loop invariant
25 tail call void @foo(i64 noundef %and)
26 %add.ptr = getelementptr inbounds i8, ptr %ptr.addr.0, i64 16