[llvm] r294980 - [SLP] Test for extractelement cost fix.
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 13 11:08:20 PST 2017
Author: abataev
Date: Mon Feb 13 13:08:19 2017
New Revision: 294980
URL: http://llvm.org/viewvc/llvm-project?rev=294980&view=rev
Log:
[SLP] Test for extractelement cost fix.
Added:
llvm/trunk/test/Transforms/SLPVectorizer/X86/extractelement.ll
Added: llvm/trunk/test/Transforms/SLPVectorizer/X86/extractelement.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SLPVectorizer/X86/extractelement.ll?rev=294980&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/SLPVectorizer/X86/extractelement.ll (added)
+++ llvm/trunk/test/Transforms/SLPVectorizer/X86/extractelement.ll Mon Feb 13 13:08:19 2017
@@ -0,0 +1,20 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -slp-vectorizer -S -mtriple=x86_64-unknown-linux -march=core-avx2 | FileCheck %s
+
+define float @f(<2 x float> %x) {
+; CHECK-LABEL: @f(
+; CHECK-NEXT: [[X0:%.*]] = extractelement <2 x float> [[X:%.*]], i32 0
+; CHECK-NEXT: [[X1:%.*]] = extractelement <2 x float> [[X]], i32 1
+; CHECK-NEXT: [[X0X0:%.*]] = fmul float [[X0]], [[X0]]
+; CHECK-NEXT: [[X1X1:%.*]] = fmul float [[X1]], [[X1]]
+; CHECK-NEXT: [[ADD:%.*]] = fadd float [[X0X0]], [[X1X1]]
+; CHECK-NEXT: ret float [[ADD]]
+;
+ %x0 = extractelement <2 x float> %x, i32 0
+ %x1 = extractelement <2 x float> %x, i32 1
+ %x0x0 = fmul float %x0, %x0
+ %x1x1 = fmul float %x1, %x1
+ %add = fadd float %x0x0, %x1x1
+ ret float %add
+}
+
More information about the llvm-commits
mailing list