[IndVarSimplify] Regenerate test checks (NFC)

This commit is contained in:
Nikita Popov 2022-05-11 12:20:36 +02:00
parent ba7b6f46b3
commit b4a5340be5
1 changed files with 69 additions and 6 deletions

View File

@ -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=always -S | FileCheck %s --check-prefix=ALWAYS
; RUN: opt < %s -indvars -replexitval=never -S | FileCheck %s --check-prefix=NEVER ; 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 ; 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 @a = common global i8 0, align 1
define internal fastcc void @d(i8* %c) unnamed_addr #0 { 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: entry:
%cmp = icmp ule i8* %c, @a %cmp = icmp ule i8* %c, @a
%add.ptr = getelementptr inbounds i8, i8* %c, i64 -65535 %add.ptr = getelementptr inbounds i8, i8* %c, i64 -65535
@ -26,10 +93,6 @@ cont:
handler.pointer_overflow.i: handler.pointer_overflow.i:
%a.mux.lcssa4 = phi i8* [ %a.mux, %cont ], [ %a.mux, %cont ] %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 %x5 = ptrtoint i8* %a.mux.lcssa4 to i64
br label %while.end br label %while.end