Skip to content

Commit 5d7fdf6

Browse files
[NFC][AArch64]Precommit test for D135102
- Run auto updater for 'trunc-to-tbl.ll' and 'build-pair-isel.ll' - Add the motivating test of D135102 to 'bitfield-insert.ll' Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D137296
1 parent fd2065b commit 5d7fdf6

File tree

3 files changed

+292
-241
lines changed

3 files changed

+292
-241
lines changed

llvm/test/CodeGen/AArch64/bitfield-insert.ll

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,3 +601,41 @@ define i64 @test_and_extended_shift_with_imm(i64 %0) {
601601
%3 = and i64 %2, 32640 ; #0x7f80
602602
ret i64 %3
603603
}
604+
605+
; orr with left-shifted operand is better than bfi, since it improves data
606+
; dependency, and orr has a smaller latency and higher throughput than bfm on
607+
; some AArch64 processors (for the rest, orr is at least as good as bfm)
608+
;
609+
; ubfx x8, x0, #8, #7
610+
; and x9, x0, #0x7f
611+
; orr x0, x9, x8, lsl #7
612+
define i64 @test_orr_not_bfxil_i64(i64 %0) {
613+
; CHECK-LABEL: test_orr_not_bfxil_i64:
614+
; CHECK: // %bb.0:
615+
; CHECK-NEXT: lsr x8, x0, #1
616+
; CHECK-NEXT: and x8, x8, #0x3f80
617+
; CHECK-NEXT: bfxil x8, x0, #0, #7
618+
; CHECK-NEXT: mov x0, x8
619+
; CHECK-NEXT: ret
620+
%2 = and i64 %0, 127
621+
%3 = lshr i64 %0, 1
622+
%4 = and i64 %3, 16256 ; 0x3f80
623+
%5 = or i64 %4, %2
624+
ret i64 %5
625+
}
626+
627+
; The 32-bit test for `test_orr_not_bfxil_i64`.
628+
define i32 @test_orr_not_bfxil_i32(i32 %0) {
629+
; CHECK-LABEL: test_orr_not_bfxil_i32:
630+
; CHECK: // %bb.0:
631+
; CHECK-NEXT: lsr w8, w0, #1
632+
; CHECK-NEXT: and w8, w8, #0x3f80
633+
; CHECK-NEXT: bfxil w8, w0, #0, #7
634+
; CHECK-NEXT: mov w0, w8
635+
; CHECK-NEXT: ret
636+
%2 = and i32 %0, 127
637+
%3 = lshr i32 %0, 1
638+
%4 = and i32 %3, 16256 ; 0x3f80
639+
%5 = or i32 %4, %2
640+
ret i32 %5
641+
}

llvm/test/CodeGen/AArch64/build-pair-isel.ll

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
12
; RUN: llc -mtriple=aarch64 -o - -O0 %s | FileCheck %s
23
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
34
target triple = "arm64-apple-ios5.0.0"
45

56
; This test checks we don't fail isel due to unhandled build_pair nodes.
6-
; CHECK: bfi
77
define void @compare_and_swap128() {
8+
; CHECK-LABEL: compare_and_swap128:
9+
; CHECK: // %bb.0:
10+
; CHECK-NEXT: //APP
11+
; CHECK-NEXT: nop
12+
; CHECK-NEXT: //NO_APP
13+
; CHECK-NEXT: // implicit-def: $x9
14+
; CHECK-NEXT: mov w9, w10
15+
; CHECK-NEXT: mov w8, w8
16+
; CHECK-NEXT: // kill: def $x8 killed $w8
17+
; CHECK-NEXT: bfi x8, x9, #32, #32
18+
; CHECK-NEXT: // implicit-def: $x9
19+
; CHECK-NEXT: str x8, [x9]
20+
; CHECK-NEXT: ret
821
%1 = call i128 asm sideeffect "nop", "=r,~{memory}"()
922
store i128 %1, i128* undef, align 16
1023
ret void

0 commit comments

Comments
 (0)