83 lines · plain
1# RUN: llc -mtriple=hexagon -run-pass pipeliner -debug-only=pipeliner %s -o /dev/null 2>&1 -pipeliner-experimental-cg=true | FileCheck %s2# REQUIRES: asserts3 4# Test that the loop carried dependence check correctly identifies dependences5# when the loop variable decreases and the array index offset is negative.6 7# No dependence from the store to the load.8# CHECK: Overlap check:9# CHECK-NEXT: BaseMI: S2_storeri_io %{{[0-9]+}}:intregs, 0, %{{[0-9]+}}:intregs :: (store (s32) into %ir.lsr.iv1)10# CHECK-NEXT: Base + 0 + I * -4, Len: 411# CHECK-NEXT: OtherMI: %{{[0-9]+}}:intregs = L2_loadri_io %{{[0-9]+}}:intregs, -8 :: (load (s32) from %ir.cgep)12# CHECK-NEXT: Base + -8 + I * -4, Len: 413# CHECK-NEXT: Result: No overlap14 15# TODO: There is a loop carried dependence from the load to the store but it16# is not recognised. addLoopCarriedDependences() should be modified to17# recognise the dependence and enable the following checks.18# CHECK-AFTER-FIX: Overlap check:19# CHECK-AFTER-FIX-NEXT: BaseMI: %{{[0-9]+}}:intregs = L2_loadri_io %{{[0-9]+}}:intregs, -8 :: (load (s32) from %ir.cgep)20# CHECK-AFTER-FIX-NEXT: Base + -8 + I * -4, Len: 421# CHECK-AFTER-FIX-NEXT: OtherMI: S2_storeri_io %{{[0-9]+}}:intregs, 0, %{{[0-9]+}}:intregs :: (store (s32) into %ir.lsr.iv1)22# CHECK-AFTER-FIX-NEXT: Base + 0 + I * -4, Len: 423# CHECK-AFTER-FIX-NEXT: Result: Overlap!24 25--- |26 27 define void @test() {28 b0:29 br label %b330 31 b3:32 %lsr.iv = phi ptr [ %0, %b3 ], [ undef, %b0 ]33 %v0 = phi i32 [ %v8, %b3 ], [ 7, %b0 ]34 %v1 = phi i32 [ %v6, %b3 ], [ undef, %b0 ]35 %v2 = phi i32 [ %v1, %b3 ], [ undef, %b0 ]36 %lsr.iv1 = bitcast ptr %lsr.iv to ptr37 %cgep = getelementptr i32, ptr %lsr.iv1, i32 -238 %v6 = load i32, ptr %cgep, align 439 %v7 = tail call i32 @llvm.hexagon.A2.subsat(i32 %v2, i32 %v6)40 store i32 %v7, ptr %lsr.iv1, align 441 %v8 = add i32 %v0, -142 %cgep3 = getelementptr [9 x i32], ptr %lsr.iv, i32 0, i32 -143 %0 = bitcast ptr %cgep3 to ptr44 %v9 = icmp sgt i32 %v8, 145 br i1 %v9, label %b3, label %b446 47 b4:48 unreachable49 }50 51 declare i32 @llvm.hexagon.A2.subsat(i32, i32) #052 declare void @llvm.stackprotector(ptr, ptr) #153 54...55---56name: test57tracksRegLiveness: true58 59body: |60 bb.0:61 successors: %bb.162 63 %10:intregs = IMPLICIT_DEF64 %11:intregs = IMPLICIT_DEF65 J2_loop0i %bb.1, 6, implicit-def $lc0, implicit-def $sa0, implicit-def $usr66 67 bb.1 (machine-block-address-taken):68 successors: %bb.1, %bb.269 70 %0:intregs = PHI %11, %bb.0, %6, %bb.171 %2:intregs = PHI %10, %bb.0, %4, %bb.172 %3:intregs = PHI %10, %bb.0, %2, %bb.173 %4:intregs = L2_loadri_io %0, -8 :: (load (s32) from %ir.cgep)74 %12:intregs = A2_subsat %3, %4, implicit-def dead $usr_ovf75 S2_storeri_io %0, 0, %12 :: (store (s32) into %ir.lsr.iv1)76 %6:intregs = A2_addi %0, -477 ENDLOOP0 %bb.1, implicit-def $pc, implicit-def $lc0, implicit $sa0, implicit $lc078 J2_jump %bb.2, implicit-def dead $pc79 80 bb.2:81 82...83