• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -O0 -run-pass=legalizer %s -o - | FileCheck %s
3
4--- |
5  target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
6  target triple = "aarch64--"
7  define void @test_div() {
8  entry:
9    ret void
10  }
11...
12
13---
14name:            test_div
15registers:
16  - { id: 0, class: _ }
17  - { id: 1, class: _ }
18  - { id: 2, class: _ }
19  - { id: 3, class: _ }
20  - { id: 4, class: _ }
21  - { id: 5, class: _ }
22body: |
23  bb.0.entry:
24    liveins: $x0, $x1, $x2, $x3
25    ; CHECK-LABEL: name: test_div
26    ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
27    ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
28    ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
29    ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
30    ; CHECK: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[TRUNC]], [[C]]
31    ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]]
32    ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
33    ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
34    ; CHECK: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[TRUNC1]], [[C1]]
35    ; CHECK: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C1]]
36    ; CHECK: [[SDIV:%[0-9]+]]:_(s32) = G_SDIV [[ASHR]], [[ASHR1]]
37    ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SDIV]](s32)
38    ; CHECK: $w0 = COPY [[COPY2]](s32)
39    ; CHECK: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
40    ; CHECK: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
41    ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC2]], [[C2]]
42    ; CHECK: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
43    ; CHECK: [[TRUNC3:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
44    ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC3]], [[C3]]
45    ; CHECK: [[UDIV:%[0-9]+]]:_(s32) = G_UDIV [[AND]], [[AND1]]
46    ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UDIV]](s32)
47    ; CHECK: $w0 = COPY [[COPY3]](s32)
48    %0(s64) = COPY $x0
49    %1(s64) = COPY $x1
50    %2(s8) = G_TRUNC %0
51    %3(s8) = G_TRUNC %1
52
53
54    %4(s8) = G_SDIV %2, %3
55    %6:_(s32) = G_ANYEXT %4
56    $w0 = COPY %6
57
58
59    %5(s8) = G_UDIV %2, %3
60    %7:_(s32) = G_ANYEXT %5
61    $w0 = COPY %7
62
63...
64