[llvm] r287064 - Fixed the lost FastMathFlags for CALL operations in SLPVectorizer.
Vyacheslav Klochkov via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 15 16:55:50 PST 2016
Author: v_klochkov
Date: Tue Nov 15 18:55:50 2016
New Revision: 287064
URL: http://llvm.org/viewvc/llvm-project?rev=287064&view=rev
Log:
Fixed the lost FastMathFlags for CALL operations in SLPVectorizer.
Reviewer: Michael Zolotukhin.
Differential Revision: https://reviews.llvm.org/D26575
Modified:
llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
llvm/trunk/test/Transforms/SLPVectorizer/X86/call.ll
llvm/trunk/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll
Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=287064&r1=287063&r2=287064&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Tue Nov 15 18:55:50 2016
@@ -2641,6 +2641,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry
ExternalUses.push_back(ExternalUser(ScalarArg, cast<User>(V), 0));
E->VectorizedValue = V;
+ propagateIRFlags(E->VectorizedValue, E->Scalars);
++NumVectorInstructions;
return V;
}
Modified: llvm/trunk/test/Transforms/SLPVectorizer/X86/call.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SLPVectorizer/X86/call.ll?rev=287064&r1=287063&r2=287064&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SLPVectorizer/X86/call.ll (original)
+++ llvm/trunk/test/Transforms/SLPVectorizer/X86/call.ll Tue Nov 15 18:55:50 2016
@@ -98,7 +98,7 @@ entry:
; CHECK: sqrt_libm
-; CHECK: call <2 x double> @llvm.sqrt.v2f64
+; CHECK: call nnan <2 x double> @llvm.sqrt.v2f64
; CHECK: ret void
define void @sqrt_libm(double* %a, double* %b, double* %c) {
entry:
Modified: llvm/trunk/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll?rev=287064&r1=287063&r2=287064&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll (original)
+++ llvm/trunk/test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll Tue Nov 15 18:55:50 2016
@@ -398,5 +398,42 @@ define void @fcmp_no_fast(double* %x) #1
ret void
}
-attributes #1 = { "target-features"="+avx" }
+declare double @llvm.fabs.f64(double) nounwind readnone
+
+;CHECK-LABEL: @call_fast(
+;CHECK: call fast <2 x double> @llvm.fabs.v2f64
+define void @call_fast(double* %x) {
+ %idx1 = getelementptr inbounds double, double* %x, i64 0
+ %idx2 = getelementptr inbounds double, double* %x, i64 1
+
+ %load1 = load double, double* %idx1, align 8
+ %load2 = load double, double* %idx2, align 8
+
+ %call1 = tail call fast double @llvm.fabs.f64(double %load1) nounwind readnone
+ %call2 = tail call fast double @llvm.fabs.f64(double %load2) nounwind readnone
+
+ store double %call1, double* %idx1, align 8
+ store double %call2, double* %idx2, align 8
+
+ ret void
+}
+;CHECK-LABEL: @call_no_fast(
+;CHECK: call <2 x double> @llvm.fabs.v2f64
+define void @call_no_fast(double* %x) {
+ %idx1 = getelementptr inbounds double, double* %x, i64 0
+ %idx2 = getelementptr inbounds double, double* %x, i64 1
+
+ %load1 = load double, double* %idx1, align 8
+ %load2 = load double, double* %idx2, align 8
+
+ %call1 = tail call fast double @llvm.fabs.f64(double %load1) nounwind readnone
+ %call2 = tail call double @llvm.fabs.f64(double %load2) nounwind readnone
+
+ store double %call1, double* %idx1, align 8
+ store double %call2, double* %idx2, align 8
+
+ ret void
+}
+
+attributes #1 = { "target-features"="+avx" }
More information about the llvm-commits
mailing list