From b4a5340be55863c0b2d0ebea92188fb42948bcd1 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 11 May 2022 12:20:36 +0200 Subject: [PATCH] [IndVarSimplify] Regenerate test checks (NFC) --- .../test/Transforms/IndVarSimplify/pr45835.ll | 75 +++++++++++++++++-- 1 file changed, 69 insertions(+), 6 deletions(-) diff --git a/llvm/test/Transforms/IndVarSimplify/pr45835.ll b/llvm/test/Transforms/IndVarSimplify/pr45835.ll index 01fba87e92b3..f9fb50e3e8f1 100644 --- a/llvm/test/Transforms/IndVarSimplify/pr45835.ll +++ b/llvm/test/Transforms/IndVarSimplify/pr45835.ll @@ -1,3 +1,4 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt < %s -indvars -replexitval=always -S | FileCheck %s --check-prefix=ALWAYS ; RUN: opt < %s -indvars -replexitval=never -S | FileCheck %s --check-prefix=NEVER ; RUN: opt < %s -indvars -replexitval=cheap -scev-cheap-expansion-budget=1 -S | FileCheck %s --check-prefix=CHEAP @@ -9,6 +10,72 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16 @a = common global i8 0, align 1 define internal fastcc void @d(i8* %c) unnamed_addr #0 { +; ALWAYS-LABEL: @d( +; ALWAYS-NEXT: entry: +; ALWAYS-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[C:%.*]], i64 -65535 +; ALWAYS-NEXT: [[TMP0:%.*]] = icmp ugt i8* [[C]], @a +; ALWAYS-NEXT: [[UMAX:%.*]] = select i1 [[TMP0]], i8* [[C]], i8* @a +; ALWAYS-NEXT: br label [[WHILE_COND:%.*]] +; ALWAYS: while.cond: +; ALWAYS-NEXT: br i1 false, label [[CONT:%.*]], label [[WHILE_END_LOOPEXIT:%.*]] +; ALWAYS: cont: +; ALWAYS-NEXT: switch i64 0, label [[WHILE_COND]] [ +; ALWAYS-NEXT: i64 -1, label [[HANDLER_POINTER_OVERFLOW_I:%.*]] +; ALWAYS-NEXT: i64 0, label [[HANDLER_POINTER_OVERFLOW_I]] +; ALWAYS-NEXT: ] +; ALWAYS: handler.pointer_overflow.i: +; ALWAYS-NEXT: [[A_MUX_LCSSA4:%.*]] = phi i8* [ [[UMAX]], [[CONT]] ], [ [[UMAX]], [[CONT]] ] +; ALWAYS-NEXT: [[X5:%.*]] = ptrtoint i8* [[A_MUX_LCSSA4]] to i64 +; ALWAYS-NEXT: br label [[WHILE_END:%.*]] +; ALWAYS: while.end.loopexit: +; ALWAYS-NEXT: br label [[WHILE_END]] +; ALWAYS: while.end: +; ALWAYS-NEXT: ret void +; +; NEVER-LABEL: @d( +; NEVER-NEXT: entry: +; NEVER-NEXT: [[CMP:%.*]] = icmp ule i8* [[C:%.*]], @a +; NEVER-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[C]], i64 -65535 +; NEVER-NEXT: br label [[WHILE_COND:%.*]] +; NEVER: while.cond: +; NEVER-NEXT: br i1 false, label [[CONT:%.*]], label [[WHILE_END_LOOPEXIT:%.*]] +; NEVER: cont: +; NEVER-NEXT: [[A_MUX:%.*]] = select i1 [[CMP]], i8* @a, i8* [[C]] +; NEVER-NEXT: switch i64 0, label [[WHILE_COND]] [ +; NEVER-NEXT: i64 -1, label [[HANDLER_POINTER_OVERFLOW_I:%.*]] +; NEVER-NEXT: i64 0, label [[HANDLER_POINTER_OVERFLOW_I]] +; NEVER-NEXT: ] +; NEVER: handler.pointer_overflow.i: +; NEVER-NEXT: [[A_MUX_LCSSA4:%.*]] = phi i8* [ [[A_MUX]], [[CONT]] ], [ [[A_MUX]], [[CONT]] ] +; NEVER-NEXT: [[X5:%.*]] = ptrtoint i8* [[A_MUX_LCSSA4]] to i64 +; NEVER-NEXT: br label [[WHILE_END:%.*]] +; NEVER: while.end.loopexit: +; NEVER-NEXT: br label [[WHILE_END]] +; NEVER: while.end: +; NEVER-NEXT: ret void +; +; CHEAP-LABEL: @d( +; CHEAP-NEXT: entry: +; CHEAP-NEXT: [[CMP:%.*]] = icmp ule i8* [[C:%.*]], @a +; CHEAP-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i8, i8* [[C]], i64 -65535 +; CHEAP-NEXT: br label [[WHILE_COND:%.*]] +; CHEAP: while.cond: +; CHEAP-NEXT: br i1 false, label [[CONT:%.*]], label [[WHILE_END_LOOPEXIT:%.*]] +; CHEAP: cont: +; CHEAP-NEXT: [[A_MUX:%.*]] = select i1 [[CMP]], i8* @a, i8* [[C]] +; CHEAP-NEXT: switch i64 0, label [[WHILE_COND]] [ +; CHEAP-NEXT: i64 -1, label [[HANDLER_POINTER_OVERFLOW_I:%.*]] +; CHEAP-NEXT: i64 0, label [[HANDLER_POINTER_OVERFLOW_I]] +; CHEAP-NEXT: ] +; CHEAP: handler.pointer_overflow.i: +; CHEAP-NEXT: [[A_MUX_LCSSA4:%.*]] = phi i8* [ [[A_MUX]], [[CONT]] ], [ [[A_MUX]], [[CONT]] ] +; CHEAP-NEXT: [[X5:%.*]] = ptrtoint i8* [[A_MUX_LCSSA4]] to i64 +; CHEAP-NEXT: br label [[WHILE_END:%.*]] +; CHEAP: while.end.loopexit: +; CHEAP-NEXT: br label [[WHILE_END]] +; CHEAP: while.end: +; CHEAP-NEXT: ret void +; entry: %cmp = icmp ule i8* %c, @a %add.ptr = getelementptr inbounds i8, i8* %c, i64 -65535 @@ -20,16 +87,12 @@ while.cond: cont: %a.mux = select i1 %cmp, i8* @a, i8* %c switch i64 0, label %while.cond [ - i64 -1, label %handler.pointer_overflow.i - i64 0, label %handler.pointer_overflow.i + i64 -1, label %handler.pointer_overflow.i + i64 0, label %handler.pointer_overflow.i ] handler.pointer_overflow.i: %a.mux.lcssa4 = phi i8* [ %a.mux, %cont ], [ %a.mux, %cont ] -; ALWAYS: [ %umax, %cont ], [ %umax, %cont ] -; NEVER: [ %a.mux, %cont ], [ %a.mux, %cont ] -; In cheap mode, use either one as long as it's consistent. -; CHEAP: [ %[[VAL:.*]], %cont ], [ %[[VAL]], %cont ] %x5 = ptrtoint i8* %a.mux.lcssa4 to i64 br label %while.end