aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/GlobalISel/legalize-sub.mir
blob: 26ef285929a689fdf2e795549cf7bdf6db27e8e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=legalizer %s -o - | FileCheck %s

--- |
  ; ModuleID = '<stdin>'
  source_filename = "<stdin>"
  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  target triple = "x86_64--linux-gnu"

  define i32 @test_sub_i32(i32 %arg1, i32 %arg2) {
    %ret = sub i32 %arg1, %arg2
    ret i32 %ret
  }

...
---
name:            test_sub_i32
alignment:       4
legalized:       false
regBankSelected: false
selected:        false
tracksRegLiveness: true
registers:
  - { id: 0, class: _ }
  - { id: 1, class: _ }
  - { id: 2, class: _ }
body:             |
  bb.1 (%ir-block.0):
    liveins: %edi, %esi
    ;  CHECK-LABEL: name: test_sub_i32
    ;  CHECK: [[VAL1:%.*]](s32) = COPY %edi
    ;  CHECK: [[VAL2:%.*]](s32) = COPY %esi
    ;  CHECK: [[RES:%.*]](s32) = G_SUB [[VAL1:%.*]], [[VAL2:%.*]]

    %0(s32) = COPY %edi
    %1(s32) = COPY %esi
    %2(s32) = G_SUB %0, %1
    %eax = COPY %2(s32)
    RET 0, implicit %eax

...