brintos

brintos / llvm-project-archived public Read only

0
0
Text · 880 B · 6da3b5d Raw
30 lines · plain
1; RUN: llc < %s -mtriple=lanai-unknown-unknown | FileCheck %s2 3; Test scheduling of subwords.4 5%struct.X = type { i16, i16 }6 7define void @f(ptr inreg nocapture %c) #0 {8entry:9  %a = getelementptr inbounds %struct.X, ptr %c, i32 0, i32 010  %0 = load i16, ptr %a, align 211  %inc = add i16 %0, 112  store i16 %inc, ptr %a, align 213  %b = getelementptr inbounds %struct.X, ptr %c, i32 0, i32 114  %1 = load i16, ptr %b, align 215  %dec = add i16 %1, -116  store i16 %dec, ptr %b, align 217  ret void18}19 20; Verify that the two loads occur before the stores. Without memory21; disambiguation and subword schedule, the resultant code was a per subword22; load-modify-store sequence instead of the more optimal schedule where all23; loads occurred before modification and storage.24; CHECK:      uld.h25; CHECK-NEXT: uld.h26; CHECK-NEXT: add27; CHECK-NEXT: st.h28; CHECK-NEXT: sub29; CHECK-NEXT: st.h30