File: diamond_broadcast.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-6~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,418,812 kB
  • sloc: cpp: 5,290,827; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,900; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,892; xml: 953; cs: 573; fortran: 539
file content (36 lines) | stat: -rw-r--r-- 1,714 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
25
26
27
28
29
30
31
32
33
34
35
36
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -slp-vectorizer -S -mtriple=x86_64-unknown-linux -slp-threshold=-1 | FileCheck %s

define i32 @diamond_broadcast(i32* noalias nocapture %B, i32* noalias nocapture %A) {
; CHECK-LABEL: @diamond_broadcast(
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[LD:%.*]] = load i32, i32* [[A:%.*]], align 4
; CHECK-NEXT:    [[ARRAYIDX9:%.*]] = getelementptr inbounds i32, i32* [[B:%.*]], i64 1
; CHECK-NEXT:    [[ARRAYIDX15:%.*]] = getelementptr inbounds i32, i32* [[B]], i64 2
; CHECK-NEXT:    [[TMP0:%.*]] = insertelement <4 x i32> poison, i32 [[LD]], i32 0
; CHECK-NEXT:    [[TMP1:%.*]] = insertelement <4 x i32> [[TMP0]], i32 [[LD]], i32 1
; CHECK-NEXT:    [[TMP2:%.*]] = insertelement <4 x i32> [[TMP1]], i32 [[LD]], i32 2
; CHECK-NEXT:    [[TMP3:%.*]] = insertelement <4 x i32> [[TMP2]], i32 [[LD]], i32 3
; CHECK-NEXT:    [[TMP4:%.*]] = mul <4 x i32> [[TMP3]], [[TMP3]]
; CHECK-NEXT:    [[ARRAYIDX21:%.*]] = getelementptr inbounds i32, i32* [[B]], i64 3
; CHECK-NEXT:    [[TMP5:%.*]] = bitcast i32* [[B]] to <4 x i32>*
; CHECK-NEXT:    store <4 x i32> [[TMP4]], <4 x i32>* [[TMP5]], align 4
; CHECK-NEXT:    ret i32 0
;
entry:
  %ld = load i32, i32* %A, align 4
  %mul = mul i32 %ld, %ld
  store i32 %mul, i32* %B, align 4
  %mul8 = mul i32 %ld, %ld
  %arrayidx9 = getelementptr inbounds i32, i32* %B, i64 1
  store i32 %mul8, i32* %arrayidx9, align 4
  %mul14 = mul i32 %ld, %ld
  %arrayidx15 = getelementptr inbounds i32, i32* %B, i64 2
  store i32 %mul14, i32* %arrayidx15, align 4
  %mul20 = mul i32 %ld, %ld
  %arrayidx21 = getelementptr inbounds i32, i32* %B, i64 3
  store i32 %mul20, i32* %arrayidx21, align 4
  ret i32 0
}