1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/test/CodeGen/PowerPC/ppc64-pre-inc-no-extra-phi.ll
Stefan Pintilie ea90a707df [PowerPC] Check if the pre-increment PHI Node already exists
Preparations to use the per-increment are sometimes done in the target
independent pass Loop Strength Reduction. We try to detect them in the PowerPC
specific pass so that they are not done twice and so that we do not add PHIs
that are not required.

Differential Revision: https://reviews.llvm.org/D36736

llvm-svn: 311332
2017-08-21 13:36:18 +00:00

31 lines
1.1 KiB
LLVM

; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr9 -verify-machineinstrs | FileCheck %s
; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr9 -verify-machineinstrs | FileCheck %s
; RUN: llc < %s -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 -verify-machineinstrs | FileCheck %s
; RUN: llc < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -verify-machineinstrs | FileCheck %s
@perm = common local_unnamed_addr global [100 x i64] zeroinitializer, align 8
define void @sort_basket() local_unnamed_addr {
entry:
br label %while.cond
while.cond:
%l.0 = phi i64 [ 0, %entry ], [ %inc, %while.cond ]
%arrayidx = getelementptr inbounds [100 x i64], [100 x i64]* @perm, i64 0, i64 %l.0
%0 = load i64, i64* %arrayidx, align 8
%cmp = icmp sgt i64 %0, 0
%inc = add nuw nsw i64 %l.0, 1
br i1 %cmp, label %while.cond, label %while.end
while.end:
store i64 0, i64* %arrayidx, align 8
ret void
; CHECK-LABEL: sort_basket
; CHECK: addi {{[0-9]+}}, {{[0-9]+}}, -8
; CHECK-NOT: addi {{[0-9]+}}, {{[0-9]+}}, 8
; CHECK: ldu {{[0-9]+}}, 8({{[0-9]+}})
; CHECK-NOT: addi {{[0-9]+}}, {{[0-9]+}}, 8
; CHECK: blr
}