brintos

brintos / llvm-project-archived public Read only

0
0
Text · 685 B · 7980773 Raw
24 lines · plain
1; RUN: llc -mtriple=arm64-darwin-unknown < %s | FileCheck %s2 3%T = type { i32, i32, i32, i32 }4 5; Test if the constant base address gets only materialized once.6define i32 @test1() nounwind {7; CHECK-LABEL:  test18; CHECK:        mov  w8, #491529; CHECK-NEXT:   movk  w8, #1039, lsl #1610; CHECK-NEXT:   ldp w9, w10, [x8, #4]11; CHECK:        ldr w8, [x8, #12]12  %at = inttoptr i64 68141056 to ptr13  %o1 = getelementptr %T, ptr %at, i32 0, i32 114  %t1 = load i32, ptr %o115  %o2 = getelementptr %T, ptr %at, i32 0, i32 216  %t2 = load i32, ptr %o217  %a1 = add i32 %t1, %t218  %o3 = getelementptr %T, ptr %at, i32 0, i32 319  %t3 = load i32, ptr %o320  %a2 = add i32 %a1, %t321  ret i32 %a222}23 24