File: legalize-i64-extract-insert-elements.ll

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,245,044 kB
  • sloc: cpp: 7,619,726; 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,666; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (24 lines) | stat: -rw-r--r-- 1,161 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; RUN: opt -S -passes='dxil-legalize' -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s

define noundef <4 x float> @float4_extract(<4 x float> noundef %a) {
entry:
  ; CHECK: [[ee0:%.*]] = extractelement <4 x float> %a, i32 0
  ; CHECK: [[ee1:%.*]] = extractelement <4 x float> %a, i32 1
  ; CHECK: [[ee2:%.*]] = extractelement <4 x float> %a, i32 2
  ; CHECK: [[ee3:%.*]] = extractelement <4 x float> %a, i32 3
  ; CHECK: insertelement <4 x float> poison, float [[ee0]], i32 0
  ; CHECK: insertelement <4 x float> %{{.*}}, float [[ee1]], i32 1
  ; CHECK: insertelement <4 x float> %{{.*}}, float [[ee2]], i32 2
  ; CHECK: insertelement <4 x float> %{{.*}}, float [[ee3]], i32 3

  %a.i0 = extractelement <4 x float> %a, i64 0
  %a.i1 = extractelement <4 x float> %a, i64 1
  %a.i2 = extractelement <4 x float> %a, i64 2
  %a.i3 = extractelement <4 x float> %a, i64 3
  
  %.upto0 = insertelement <4 x float> poison, float %a.i0, i64 0
  %.upto1 = insertelement <4 x float> %.upto0, float %a.i1, i64 1
  %.upto2 = insertelement <4 x float> %.upto1, float %a.i2, i64 2
  %0 = insertelement <4 x float> %.upto2, float %a.i3, i64 3
  ret <4 x float> %0
}