133 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 22; RUN: llc < %s -o - | FileCheck %s3; RUN: llc -mattr=+alu-lsl-fast --aarch64-enable-sink-fold=false < %s -o - | FileCheck %s -check-prefix=LSLFAST4target triple = "aarch64-linux"5 6declare void @g(...)7 8; Check that ADDWrs/ADDXrs with shift > 4 is considered relatively9; slow, thus CSE-d.10define void @f0(i1 %c0, i1 %c1, ptr %a, i64 %i) {11; CHECK-LABEL: f0:12; CHECK: // %bb.0: // %E13; CHECK-NEXT: tbz w0, #0, .LBB0_514; CHECK-NEXT: // %bb.1: // %A15; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill16; CHECK-NEXT: .cfi_def_cfa_offset 1617; CHECK-NEXT: .cfi_offset w30, -1618; CHECK-NEXT: add x0, x2, x3, lsl #519; CHECK-NEXT: tbz w1, #0, .LBB0_320; CHECK-NEXT: // %bb.2: // %B21; CHECK-NEXT: bl g22; CHECK-NEXT: b .LBB0_423; CHECK-NEXT: .LBB0_3: // %C24; CHECK-NEXT: mov x1, x025; CHECK-NEXT: bl g26; CHECK-NEXT: .LBB0_4:27; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload28; CHECK-NEXT: .LBB0_5: // %X29; CHECK-NEXT: ret30;31; LSLFAST-LABEL: f0:32; LSLFAST: // %bb.0: // %E33; LSLFAST-NEXT: tbz w0, #0, .LBB0_534; LSLFAST-NEXT: // %bb.1: // %A35; LSLFAST-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill36; LSLFAST-NEXT: .cfi_def_cfa_offset 1637; LSLFAST-NEXT: .cfi_offset w30, -1638; LSLFAST-NEXT: add x0, x2, x3, lsl #539; LSLFAST-NEXT: tbz w1, #0, .LBB0_340; LSLFAST-NEXT: // %bb.2: // %B41; LSLFAST-NEXT: bl g42; LSLFAST-NEXT: b .LBB0_443; LSLFAST-NEXT: .LBB0_3: // %C44; LSLFAST-NEXT: mov x1, x045; LSLFAST-NEXT: bl g46; LSLFAST-NEXT: .LBB0_4:47; LSLFAST-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload48; LSLFAST-NEXT: .LBB0_5: // %X49; LSLFAST-NEXT: ret50E:51 %p0 = getelementptr {i64, i64, i64, i64}, ptr %a, i64 %i52 br i1 %c0, label %A, label %X53 54A:55 br i1 %c1, label %B, label %C56 57B:58 call void @g(ptr %p0)59 br label %X60 61C:62 %p1 = getelementptr {i64, i64, i64, i64}, ptr %a, i64 %i63 call void @g(ptr %p1, ptr %p0)64 br label %X65 66X:67 ret void68}69 70; Check that ADDWrs/ADDXrs with shift <= 4 is considered relatively fast on sub-targets71; with feature +alu-lsl-fast, thus *not* CSE-d.72define void @f1(i1 %c0, i1 %c1, ptr %a, i64 %i) {73; CHECK-LABEL: f1:74; CHECK: // %bb.0: // %E75; CHECK-NEXT: tbz w0, #0, .LBB1_576; CHECK-NEXT: // %bb.1: // %A77; CHECK-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill78; CHECK-NEXT: .cfi_def_cfa_offset 1679; CHECK-NEXT: .cfi_offset w30, -1680; CHECK-NEXT: add x0, x2, x3, lsl #481; CHECK-NEXT: tbz w1, #0, .LBB1_382; CHECK-NEXT: // %bb.2: // %B83; CHECK-NEXT: bl g84; CHECK-NEXT: b .LBB1_485; CHECK-NEXT: .LBB1_3: // %C86; CHECK-NEXT: mov x1, x087; CHECK-NEXT: bl g88; CHECK-NEXT: .LBB1_4:89; CHECK-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload90; CHECK-NEXT: .LBB1_5: // %X91; CHECK-NEXT: ret92;93; LSLFAST-LABEL: f1:94; LSLFAST: // %bb.0: // %E95; LSLFAST-NEXT: tbz w0, #0, .LBB1_596; LSLFAST-NEXT: // %bb.1: // %A97; LSLFAST-NEXT: str x30, [sp, #-16]! // 8-byte Folded Spill98; LSLFAST-NEXT: .cfi_def_cfa_offset 1699; LSLFAST-NEXT: .cfi_offset w30, -16100; LSLFAST-NEXT: add x8, x2, x3, lsl #4101; LSLFAST-NEXT: tbz w1, #0, .LBB1_3102; LSLFAST-NEXT: // %bb.2: // %B103; LSLFAST-NEXT: mov x0, x8104; LSLFAST-NEXT: bl g105; LSLFAST-NEXT: b .LBB1_4106; LSLFAST-NEXT: .LBB1_3: // %C107; LSLFAST-NEXT: add x0, x2, x3, lsl #4108; LSLFAST-NEXT: mov x1, x8109; LSLFAST-NEXT: bl g110; LSLFAST-NEXT: .LBB1_4:111; LSLFAST-NEXT: ldr x30, [sp], #16 // 8-byte Folded Reload112; LSLFAST-NEXT: .LBB1_5: // %X113; LSLFAST-NEXT: ret114E:115 %p0 = getelementptr {i64, i64}, ptr %a, i64 %i116 br i1 %c0, label %A, label %X117 118A:119 br i1 %c1, label %B, label %C120 121B:122 call void @g(ptr %p0)123 br label %X124 125C:126 %p1 = getelementptr {i64, i64}, ptr %a, i64 %i127 call void @g(ptr %p1, ptr %p0)128 br label %X129 130X:131 ret void132}133