70 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes='require<domtree>,instcombine,require<domtree>' -S < %s | FileCheck %s3; Note: The -loops above can be anything that requires the domtree, and is4; necessary to work around a pass-manager bug.5 6target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"7target triple = "x86_64-unknown-linux-gnu"8 9; Function Attrs: nounwind uwtable10define void @foo(ptr %a, ptr %b) #0 {11; CHECK-LABEL: @foo(12; CHECK-NEXT: entry:13; CHECK-NEXT: [[PTRINT:%.*]] = ptrtoint ptr [[A:%.*]] to i6414; CHECK-NEXT: [[MASKEDPTR:%.*]] = and i64 [[PTRINT]], 6315; CHECK-NEXT: [[MASKCOND:%.*]] = icmp eq i64 [[MASKEDPTR]], 016; CHECK-NEXT: tail call void @llvm.assume(i1 [[MASKCOND]])17; CHECK-NEXT: [[PTRINT1:%.*]] = ptrtoint ptr [[B:%.*]] to i6418; CHECK-NEXT: [[MASKEDPTR2:%.*]] = and i64 [[PTRINT1]], 6319; CHECK-NEXT: [[MASKCOND3:%.*]] = icmp eq i64 [[MASKEDPTR2]], 020; CHECK-NEXT: tail call void @llvm.assume(i1 [[MASKCOND3]])21; CHECK-NEXT: br label [[FOR_BODY:%.*]]22; CHECK: for.body:23; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ]24; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds nuw i32, ptr [[B]], i64 [[INDVARS_IV]]25; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARRAYIDX]], align 426; CHECK-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], 127; CHECK-NEXT: [[ARRAYIDX5:%.*]] = getelementptr inbounds nuw i32, ptr [[A]], i64 [[INDVARS_IV]]28; CHECK-NEXT: store i32 [[ADD]], ptr [[ARRAYIDX5]], align 429; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1630; CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[INDVARS_IV_NEXT]] to i3231; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[TMP1]], 164832; CHECK-NEXT: br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_END:%.*]]33; CHECK: for.end:34; CHECK-NEXT: ret void35;36entry:37 %ptrint = ptrtoint ptr %a to i6438 %maskedptr = and i64 %ptrint, 6339 %maskcond = icmp eq i64 %maskedptr, 040 tail call void @llvm.assume(i1 %maskcond)41 %ptrint1 = ptrtoint ptr %b to i6442 %maskedptr2 = and i64 %ptrint1, 6343 %maskcond3 = icmp eq i64 %maskedptr2, 044 tail call void @llvm.assume(i1 %maskcond3)45 br label %for.body46 47 48for.body: ; preds = %entry, %for.body49 %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]50 %arrayidx = getelementptr inbounds i32, ptr %b, i64 %indvars.iv51 %0 = load i32, ptr %arrayidx, align 452 %add = add nsw i32 %0, 153 %arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv54 store i32 %add, ptr %arrayidx5, align 455 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1656 %1 = trunc i64 %indvars.iv.next to i3257 %cmp = icmp slt i32 %1, 164858 br i1 %cmp, label %for.body, label %for.end59 60for.end: ; preds = %for.body61 ret void62}63 64; Function Attrs: nounwind65declare void @llvm.assume(i1) #166 67attributes #0 = { nounwind uwtable }68attributes #1 = { nounwind }69 70