aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/GlobalISel/legalize-const.mir
blob: 612d33a77fc96acde2fba65d1d4921afa4777f11 (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
41
42
43
# RUN: llc -mtriple=i386-linux-gnu   -global-isel -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32
# RUN: llc -mtriple=x86_64-linux-gnu -global-isel -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64

--- | 
  define void @constInt_check() {
    ret void
  }

...
---
name:            constInt_check
# ALL-LABEL: name:            constInt_check
registers:       
  - { id: 0, class: _ }
  - { id: 1, class: _ }
  - { id: 2, class: _ }
  - { id: 3, class: _ }
  - { id: 4, class: _ }
body:             |
  bb.1 (%ir-block.0):
    ; ALL: %5(s8) = G_CONSTANT i8 -1
    ; ALL: %0(s1) = G_TRUNC %5(s8)
    %0(s1) = G_CONSTANT i1 1

    ; ALL: %1(s8) = G_CONSTANT i8 8    
    %1(s8) = G_CONSTANT i8 8   

    ; ALL: %2(s16) = G_CONSTANT i16 16
    %2(s16) = G_CONSTANT i16 16

    ; ALL: %3(s32) = G_CONSTANT i32 32
    %3(s32) = G_CONSTANT i32 32

    ; X64: %4(s64) = G_CONSTANT i64 64
    
    ; X32: %6(s32) = G_CONSTANT i32 64
    ; X32: %7(s32) = G_CONSTANT i32 0
    ; X32: %4(s64) = G_MERGE_VALUES %6(s32), %7(s32) 
    %4(s64) = G_CONSTANT i64 64

    RET 0
...