1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/test/CodeGen/Hexagon/swp-carried-dep2.mir
Matt Arsenault cc12b285b6 CodeGen: Print/parse LLTs in MachineMemOperands
This will currently accept the old number of bytes syntax, and convert
it to a scalar. This should be removed in the near future (I think I
converted all of the tests already, but likely missed a few).

Not sure what the exact syntax and policy should be. We can continue
printing the number of bytes for non-generic instructions to avoid
test churn and only allow non-scalar types for generic instructions.

This will currently print the LLT in parentheses, but accept parsing
the existing integers and implicitly converting to scalar. The
parentheses are a bit ugly, but the parser logic seems unable to deal
without either parentheses or some keyword to indicate the start of a
type.
2021-06-30 16:54:13 -04:00

71 lines
2.0 KiB
YAML

# RUN: llc -mtriple=hexagon -run-pass pipeliner -debug-only=pipeliner %s -o /dev/null 2>&1 -pipeliner-experimental-cg=true | FileCheck %s
# REQUIRES: asserts
# Test that the loop carried dependence check correctly identifies a recurrence
# when the loop variable decreases and the array index offset is negative.
# CHECK: Rec NodeSet
# CHECK: Rec NodeSet
# CHECK: SU(3)
# CHECK: SU(4)
# CHECK: SU(5)
--- |
define void @test() {
b0:
br label %b3
b3:
%lsr.iv = phi [9 x i32]* [ %0, %b3 ], [ undef, %b0 ]
%v0 = phi i32 [ %v8, %b3 ], [ 7, %b0 ]
%v1 = phi i32 [ %v6, %b3 ], [ undef, %b0 ]
%v2 = phi i32 [ %v1, %b3 ], [ undef, %b0 ]
%lsr.iv1 = bitcast [9 x i32]* %lsr.iv to i32*
%cgep = getelementptr i32, i32* %lsr.iv1, i32 -2
%v6 = load i32, i32* %cgep, align 4
%v7 = tail call i32 @llvm.hexagon.A2.subsat(i32 %v2, i32 %v6)
store i32 %v7, i32* %lsr.iv1, align 4
%v8 = add i32 %v0, -1
%cgep3 = getelementptr [9 x i32], [9 x i32]* %lsr.iv, i32 0, i32 -1
%0 = bitcast i32* %cgep3 to [9 x i32]*
%v9 = icmp sgt i32 %v8, 1
br i1 %v9, label %b3, label %b4
b4:
unreachable
}
declare i32 @llvm.hexagon.A2.subsat(i32, i32) #0
declare void @llvm.stackprotector(i8*, i8**) #1
...
---
name: test
tracksRegLiveness: true
body: |
bb.0:
successors: %bb.1
%10:intregs = IMPLICIT_DEF
%11:intregs = IMPLICIT_DEF
J2_loop0i %bb.1, 6, implicit-def $lc0, implicit-def $sa0, implicit-def $usr
bb.1 (address-taken):
successors: %bb.1, %bb.2
%0:intregs = PHI %11, %bb.0, %6, %bb.1
%2:intregs = PHI %10, %bb.0, %4, %bb.1
%3:intregs = PHI %10, %bb.0, %2, %bb.1
%4:intregs = L2_loadri_io %0, -8 :: (load (s32) from %ir.cgep)
%12:intregs = A2_subsat %3, %4, implicit-def dead $usr_ovf
S2_storeri_io %0, 0, %12 :: (store (s32) into %ir.lsr.iv1)
%6:intregs = A2_addi %0, -4
ENDLOOP0 %bb.1, implicit-def $pc, implicit-def $lc0, implicit $sa0, implicit $lc0
J2_jump %bb.2, implicit-def dead $pc
bb.2:
...