File: ps_call_nr.ll

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 (46 lines) | stat: -rw-r--r-- 1,252 bytes parent folder | download | duplicates (6)
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
44
45
46
; RUN: llc -mtriple=hexagon < %s | FileCheck %s

; Test that the compiler does not generate an invalid packet with three
; instructions that each requires slot 2 or 3. The specification for
; PS_call_nr was incorrect, which allowed that instrution to go in any slot.

; CHECK: extractu
; CHECK: extractu
; CHECK: {
; CHECK: call

%s.0 = type <{ ptr, ptr, i16, i8, i8, i8 }>

@g0 = external constant %s.0, section ".rodata.trace", align 1

define void @f0() local_unnamed_addr {
b0:
  %v0 = load i32, ptr undef, align 4
  %v1 = trunc i32 %v0 to i2
  switch i2 %v1, label %b4 [
    i2 1, label %b1
    i2 -1, label %b2
    i2 -2, label %b2
    i2 0, label %b3
  ]

b1:                                               ; preds = %b0
  unreachable

b2:                                               ; preds = %b0, %b0
  %v2 = load i32, ptr undef, align 4
  %v3 = lshr i32 %v2, 14
  %v4 = and i32 %v3, 2047
  %v5 = lshr i32 %v2, 3
  %v6 = and i32 %v5, 2047
  tail call void @f1(ptr nonnull @g0, i32 %v6, i32 %v4, i32 0, i32 0)
  unreachable

b3:                                               ; preds = %b0
  ret void

b4:                                               ; preds = %b0
  unreachable
}

declare void @f1(ptr, i32, i32, i32, i32) local_unnamed_addr