File: bug-vopc-commute.ll

package info (click to toggle)
llvm-toolchain-3.9 1%3A3.9.1-8
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 441,060 kB
  • ctags: 428,777
  • sloc: cpp: 2,546,577; ansic: 538,318; asm: 119,677; objc: 103,316; python: 102,148; sh: 27,847; pascal: 5,626; ml: 5,510; perl: 5,293; lisp: 4,801; makefile: 2,177; xml: 686; cs: 362; php: 212; csh: 117
file content (49 lines) | stat: -rw-r--r-- 1,675 bytes parent folder | download | duplicates (2)
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
47
48
49
; RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck %s
; RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck %s

target triple = "amdgcn--"

; CHECK-LABEL: {{^}}main:
;
; Test for compilation only. This generated an invalid machine instruction
; by trying to commute the operands of a V_CMP_EQ_i32_e32 instruction, both
; of which were in SGPRs.
define amdgpu_vs float @main(i32 %v) {
main_body:
  %d1 = call float @llvm.SI.load.const(<16 x i8> undef, i32 960)
  %d2 = call float @llvm.SI.load.const(<16 x i8> undef, i32 976)
  br i1 undef, label %ENDIF56, label %IF57

IF57:                                             ; preds = %ENDIF
  %v.1 = mul i32 %v, 2
  br label %ENDIF56

ENDIF56:                                          ; preds = %IF57, %ENDIF
  %v.2 = phi i32 [ %v, %main_body ], [ %v.1, %IF57 ]
  %d1.i = bitcast float %d1 to i32
  %cc1 = icmp eq i32 %d1.i, 0
  br i1 %cc1, label %ENDIF59, label %IF60

IF60:                                             ; preds = %ENDIF56
  %v.3 = mul i32 %v.2, 2
  br label %ENDIF59

ENDIF59:                                          ; preds = %IF60, %ENDIF56
  %v.4 = phi i32 [ %v.2, %ENDIF56 ], [ %v.3, %IF60 ]
  %d2.i = bitcast float %d2 to i32
  %cc2 = icmp eq i32 %d2.i, 0
  br i1 %cc2, label %ENDIF62, label %IF63

IF63:                                             ; preds = %ENDIF59
  unreachable

ENDIF62:                                          ; preds = %ENDIF59
  %r = bitcast i32 %v.4 to float
  ret float %r
}

; Function Attrs: nounwind readnone
declare float @llvm.SI.load.const(<16 x i8>, i32) #0

attributes #0 = { nounwind readnone }
attributes #1 = { readnone }