forked from OSchip/llvm-project
[SLP][NFC]Add a test for diamond match of broadcast tree nodes.
This commit is contained in:
parent
8fb4897934
commit
117a247e8e
|
@ -0,0 +1,37 @@
|
|||
; 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: [[MUL:%.*]] = mul i32 [[LD]], [[LD]]
|
||||
; CHECK-NEXT: store i32 [[MUL]], i32* [[B:%.*]], align 4
|
||||
; CHECK-NEXT: [[MUL8:%.*]] = mul i32 [[LD]], [[LD]]
|
||||
; CHECK-NEXT: [[ARRAYIDX9:%.*]] = getelementptr inbounds i32, i32* [[B]], i64 1
|
||||
; CHECK-NEXT: store i32 [[MUL8]], i32* [[ARRAYIDX9]], align 4
|
||||
; CHECK-NEXT: [[MUL14:%.*]] = mul i32 [[LD]], [[LD]]
|
||||
; CHECK-NEXT: [[ARRAYIDX15:%.*]] = getelementptr inbounds i32, i32* [[B]], i64 2
|
||||
; CHECK-NEXT: store i32 [[MUL14]], i32* [[ARRAYIDX15]], align 4
|
||||
; CHECK-NEXT: [[MUL20:%.*]] = mul i32 [[LD]], [[LD]]
|
||||
; CHECK-NEXT: [[ARRAYIDX21:%.*]] = getelementptr inbounds i32, i32* [[B]], i64 3
|
||||
; CHECK-NEXT: store i32 [[MUL20]], i32* [[ARRAYIDX21]], 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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue