File: combine-extract-vector-load.mir

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (42 lines) | stat: -rw-r--r-- 1,824 bytes parent folder | download | duplicates (9)
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
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=amdgcn -run-pass=amdgpu-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s

# Tries to emit a foldable G_PTR_ADD with (p1, s32) operands.
---
name:            test_ptradd_crash__offset_smaller
tracksRegLiveness: true
body:             |
  bb.0:
    ; CHECK-LABEL: name: test_ptradd_crash__offset_smaller
    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 12
    ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p1) = G_INTTOPTR [[C]](s64)
    ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[INTTOPTR]](p1) :: (load (s32), addrspace 1)
    ; CHECK-NEXT: $sgpr0 = COPY [[LOAD]](s32)
    ; CHECK-NEXT: SI_RETURN_TO_EPILOG implicit $sgpr0
    %1:_(p1) = G_CONSTANT i64 0
    %3:_(s32) = G_CONSTANT i32 3
    %0:_(<4 x s32>) = G_LOAD %1 :: (load (<4 x s32>) from `ptr addrspace(1) null`, addrspace 1)
    %2:_(s32) = G_EXTRACT_VECTOR_ELT %0, %3
    $sgpr0 = COPY %2
    SI_RETURN_TO_EPILOG implicit $sgpr0
...

# Tries to emit a foldable G_PTR_ADD with (p1, s128) operands.
---
name:            test_ptradd_crash__offset_wider
tracksRegLiveness: true
body:             |
  bb.0:
    ; CHECK-LABEL: name: test_ptradd_crash__offset_wider
    ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 12
    ; CHECK-NEXT: [[INTTOPTR:%[0-9]+]]:_(p1) = G_INTTOPTR [[C]](s64)
    ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[INTTOPTR]](p1) :: (load (s32), addrspace 1)
    ; CHECK-NEXT: $sgpr0 = COPY [[LOAD]](s32)
    ; CHECK-NEXT: SI_RETURN_TO_EPILOG implicit $sgpr0
    %1:_(p1) = G_CONSTANT i64 0
    %3:_(s32) = G_CONSTANT i32 3
    %0:_(<4 x s32>) = G_LOAD %1 :: (load (<4 x s32>) from `ptr addrspace(1) null`, addrspace 1)
    %2:_(s32) = G_EXTRACT_VECTOR_ELT %0, %3
    $sgpr0 = COPY %2
    SI_RETURN_TO_EPILOG implicit $sgpr0
...