File: partially-dead-super-register-immediate.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,245,064 kB
  • sloc: cpp: 7,619,731; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,676; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (28 lines) | stat: -rw-r--r-- 1,027 bytes parent folder | download | duplicates (10)
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
; RUN: llc -mtriple=amdgcn -verify-machineinstrs -verify-coalescing < %s

; The original and requires materializing a 64-bit immediate for
; s_and_b64. This is split into 2 x v_and_i32, part of the immediate
; is folded through the reg_sequence into the v_and_i32 operand, and
; only half of the result is ever used.
;
; During live interval construction, the first sub register def is
; incorrectly marked as dead.

declare i32 @llvm.amdgcn.workitem.id.x() #1

define amdgpu_kernel void @dead_def_subregister(ptr addrspace(1) noalias %out, ptr addrspace(1) noalias %in) #0 {
  %tid = call i32 @llvm.amdgcn.workitem.id.x() #1
  %in.gep = getelementptr i64, ptr addrspace(1) %in, i32 %tid
  %val = load i64, ptr addrspace(1) %in.gep

  %lshr = shl i64 %val, 24
  %and1 = and i64 %lshr, 2190433320969 ; (255 << 33) | 9
  %vec = bitcast i64 %and1 to <2 x i32>
  %elt1 = extractelement <2 x i32> %vec, i32 1

  store i32 %elt1, ptr addrspace(1) %out
  ret void
}

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