From 2aff4f7f5772f186eb04898ef2e2b143d9e3cbe7 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Mon, 19 Apr 2021 19:10:55 +0300 Subject: [PATCH] [polly] Fix check-polly after SCEVExpander PtrToInt fixes --- polly/test/ScopInfo/int2ptr_ptr2int.ll | 8 +++++--- polly/test/ScopInfo/int2ptr_ptr2int_2.ll | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/polly/test/ScopInfo/int2ptr_ptr2int.ll b/polly/test/ScopInfo/int2ptr_ptr2int.ll index 2a0b69c7536f..c2bedff91e7f 100644 --- a/polly/test/ScopInfo/int2ptr_ptr2int.ll +++ b/polly/test/ScopInfo/int2ptr_ptr2int.ll @@ -16,6 +16,9 @@ ; CHECK-NEXT: MustWriteAccess := [Reduction Type: +] [Scalar: 0] ; CHECK-NEXT: [val, ptr] -> { Stmt_for_body[i0] -> MemRef_A[9 + ptr] }; ; +; IR: entry: +; IR-NEXT: %ptr1 = ptrtoint i64* %ptr to i32 +; ; IR: polly.stmt.for.body: ; IR-NEXT: %p_tmp1 = inttoptr i64 %14 to i64* ; IR-NEXT: %p_add.ptr2 = getelementptr inbounds i64, i64* %p_tmp1, i64 1 @@ -31,9 +34,8 @@ ; ; IR: polly.loop_preheader: ; IR-NEXT: %14 = add i64 %val, 1 -; IR-NEXT: %15 = ptrtoint i64* %ptr to i32 -; IR-NEXT: %16 = add i32 %15, 9 -; IR-NEXT: %scevgep = getelementptr i64, i64* %A, i32 %16 +; IR-NEXT: %15 = add i32 %ptr1, 9 +; IR-NEXT: %scevgep = getelementptr i64, i64* %A, i32 %15 ; IR-NEXT: br label %polly.loop_header ; diff --git a/polly/test/ScopInfo/int2ptr_ptr2int_2.ll b/polly/test/ScopInfo/int2ptr_ptr2int_2.ll index c0bd80b1e242..e84118ca7459 100644 --- a/polly/test/ScopInfo/int2ptr_ptr2int_2.ll +++ b/polly/test/ScopInfo/int2ptr_ptr2int_2.ll @@ -19,6 +19,9 @@ ; CHECK-NEXT: [val, ptr] -> { Stmt_for_body[i0] -> MemRef_A[9 + ptr] }; ; CHECK-NEXT: MustWriteAccess := [Reduction Type: +] [Scalar: 0] ; CHECK-NEXT: [val, ptr] -> { Stmt_for_body[i0] -> MemRef_A[9 + ptr] }; + +; IR: entry: +; IR-NEXT: %ptr13 = ptrtoint i64* %ptr to i16 ; ; IR: polly.stmt.for.body: ; IR-NEXT: %tmp4_p_scalar_ = load i64, i64* %scevgep, align 8, !alias.scope !3, !noalias !4 @@ -30,9 +33,8 @@ ; IR: polly.loop_preheader: ; IR-NEXT: %41 = add i16 %val, 1 -; IR-NEXT: %42 = ptrtoint i64* %ptr to i16 -; IR-NEXT: %43 = add i16 %42, 9 -; IR-NEXT: %scevgep = getelementptr i64, i64* %A, i16 %43 +; IR-NEXT: %42 = add i16 %ptr13, 9 +; IR-NEXT: %scevgep = getelementptr i64, i64* %A, i16 %42 ; IR-NEXT: br label %polly.loop_header ; target datalayout = "e-p:16:16:16-m:e-i64:64-f80:128-n8:16:16:64-S128"