44 lines · plain
1; RUN: llc -mtriple=hexagon < %s | FileCheck %s2; RUN: llc -mtriple=hexagon -disable-load-widen < %s | FileCheck %s --check-prefix=CHECK-DISABLE3 4%struct.node32 = type { ptr, ptr }5 6%struct.node16_4 = type { i16, i16, i16, i16 }7 8define void @test1(ptr nocapture %node) nounwind {9entry:10; There should be a memd and not two memw11; CHECK-LABEL: test112; CHECK: memd13 %0 = load ptr, ptr %node, align 814 %cgep = getelementptr inbounds %struct.node32, ptr %node, i32 0, i32 115 %1 = load ptr, ptr %cgep, align 416 store ptr %0, ptr %1, align 817 ret void18}19 20define void @test2(ptr nocapture %node) nounwind {21entry:22; Same as test1 but with load widening disabled.23; CHECK-DISABLE-LABEL: test224; CHECK-DISABLE: memw25; CHECK-DISABLE: memw26 %0 = load ptr, ptr %node, align 827 %cgep = getelementptr inbounds %struct.node32, ptr %node, i32 0, i32 128 %1 = load ptr, ptr %cgep, align 429 store ptr %0, ptr %1, align 830 ret void31}32 33define void @test3(ptr nocapture %node) nounwind {34entry:35; No memd because first load is not 8 byte aligned36; CHECK-LABEL: test337; CHECK-NOT: memd38 %0 = load ptr, ptr %node, align 439 %cgep = getelementptr inbounds %struct.node32, ptr %node, i32 0, i32 140 %1 = load ptr, ptr %cgep, align 441 store ptr %0, ptr %1, align 842 ret void43}44