Files
clang-p2996/polly/test/CodeGen/invariant_load_loop_ub.ll
rahulana-quic e1f056f692 Reland "[polly] Port polly tests to use NPM" (#92918)
Even as the NPM has been in use by Polly for a while now, the majority
of the tests continue using the LPM passes. This patch ports the tests
to use the NPM passes (for example, by replacing a flag such as
-polly-detect with -passes=polly-detect following the NPM syntax for
specifying passes) with some exceptions for some missing features in the
new passes.

Relanding #90632.
2024-05-24 13:09:34 -07:00

35 lines
1.0 KiB
LLVM

; RUN: opt %loadNPMPolly -passes=polly-codegen -polly-invariant-load-hoisting=true -polly-process-unprofitable -S < %s | FileCheck %s
;
; CHECK: polly.start
;
; void f(int *A, int *UB) {
; for (int i = 0; i < *UB; i++)
; A[i] = 0;
; }
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @f(ptr %A, ptr %UB) {
bb:
br label %bb1
bb1: ; preds = %bb6, %bb
%indvars.iv = phi i64 [ %indvars.iv.next, %bb6 ], [ 0, %bb ]
%tmp = load i32, ptr %UB, align 4
%tmp2 = sext i32 %tmp to i64
%tmp3 = icmp slt i64 %indvars.iv, %tmp2
br i1 %tmp3, label %bb4, label %bb7
bb4: ; preds = %bb1
%tmp5 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
store i32 0, ptr %tmp5, align 4
br label %bb6
bb6: ; preds = %bb4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %bb1
bb7: ; preds = %bb1
ret void
}