1 ; RUN: llc -mtriple=hexagon < %s | FileCheck %s
2 ; RUN: llc -mtriple=hexagon -disable-load-widen < %s | FileCheck %s --check-prefix=CHECK-DISABLE
4 %struct.node32 = type { ptr, ptr }
6 %struct.node16_4 = type { i16, i16, i16, i16 }
8 define void @test1(ptr nocapture %node) nounwind {
10 ; There should be a memd and not two memw
13 %0 = load ptr, ptr %node, align 8
14 %cgep = getelementptr inbounds %struct.node32, ptr %node, i32 0, i32 1
15 %1 = load ptr, ptr %cgep, align 4
16 store ptr %0, ptr %1, align 8
20 define void @test2(ptr nocapture %node) nounwind {
22 ; Same as test1 but with load widening disabled.
23 ; CHECK-DISABLE-LABEL: test2
26 %0 = load ptr, ptr %node, align 8
27 %cgep = getelementptr inbounds %struct.node32, ptr %node, i32 0, i32 1
28 %1 = load ptr, ptr %cgep, align 4
29 store ptr %0, ptr %1, align 8
33 define void @test3(ptr nocapture %node) nounwind {
35 ; No memd because first load is not 8 byte aligned
38 %0 = load ptr, ptr %node, align 4
39 %cgep = getelementptr inbounds %struct.node32, ptr %node, i32 0, i32 1
40 %1 = load ptr, ptr %cgep, align 4
41 store ptr %0, ptr %1, align 8