xref: /llvm-project/llvm/test/CodeGen/Mips/GlobalISel/legalizer/inttoptr_and_ptrtoint.mir (revision 48904e9452de81375bd55d830d08e51cc8f2ec7e)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
3--- |
4
5  define void @inttoptr() {entry: ret void}
6  define void @ptrtoint() {entry: ret void}
7
8...
9---
10name:            inttoptr
11alignment:       4
12tracksRegLiveness: true
13body:             |
14  bb.1.entry:
15    liveins: $a0
16
17    ; MIPS32-LABEL: name: inttoptr
18    ; MIPS32: liveins: $a0
19    ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
20    ; MIPS32: [[INTTOPTR:%[0-9]+]]:_(p0) = G_INTTOPTR [[COPY]](s32)
21    ; MIPS32: $v0 = COPY [[INTTOPTR]](p0)
22    ; MIPS32: RetRA implicit $v0
23    %0:_(s32) = COPY $a0
24    %1:_(p0) = G_INTTOPTR %0(s32)
25    $v0 = COPY %1(p0)
26    RetRA implicit $v0
27
28...
29---
30name:            ptrtoint
31alignment:       4
32tracksRegLiveness: true
33body:             |
34  bb.1.entry:
35    liveins: $a0
36
37    ; MIPS32-LABEL: name: ptrtoint
38    ; MIPS32: liveins: $a0
39    ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
40    ; MIPS32: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY]](p0)
41    ; MIPS32: $v0 = COPY [[PTRTOINT]](s32)
42    ; MIPS32: RetRA implicit $v0
43    %0:_(p0) = COPY $a0
44    %1:_(s32) = G_PTRTOINT %0(p0)
45    $v0 = COPY %1(s32)
46    RetRA implicit $v0
47
48...
49