summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-02-02 18:44:18 +0100
committerHans Wennborg <hans@chromium.org>2020-02-05 13:52:41 +0100
commit99c6a4ea9201f09e8107bb83675f1e7235456b6d (patch)
tree499e8cf52975392d143a97aacd1641f9a203e135 /llvm/lib
parent0b8a540dff86662fc9426bb4dd8797c547db5000 (diff)
downloadbcm5719-llvm-99c6a4ea9201f09e8107bb83675f1e7235456b6d.tar.gz
bcm5719-llvm-99c6a4ea9201f09e8107bb83675f1e7235456b6d.zip
[ARM] Expand vector reduction intrinsics on soft float
Followup to D73135. If the target doesn't have hard float (default for ARM), then we assert when trying to soften the result of vector reduction intrinsics. This patch marks these for expansion as well. (A bit odd to use vectors on a target without hard float ... but that's where you end up if you expose target-independent vector types.) Differential Revision: https://reviews.llvm.org/D73854 (cherry picked from commit 1cc4f8d17247cd9be88addd75d060f9321b6f8b0)
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMTargetTransformInfo.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.h b/llvm/lib/Target/ARM/ARMTargetTransformInfo.h
index 4a9a8f688ab..b860df62b78 100644
--- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.h
+++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.h
@@ -175,7 +175,14 @@ public:
case Intrinsic::experimental_vector_reduce_v2_fadd:
case Intrinsic::experimental_vector_reduce_v2_fmul:
// We don't have legalization support for ordered FP reductions.
- return !II->getFastMathFlags().allowReassoc();
+ if (!II->getFastMathFlags().allowReassoc())
+ return true;
+ LLVM_FALLTHROUGH;
+
+ case Intrinsic::experimental_vector_reduce_fmin:
+ case Intrinsic::experimental_vector_reduce_fmax:
+ // Can't legalize reductions with soft floats.
+ return TLI->useSoftFloat() || !TLI->getSubtarget()->hasFPRegs();
default:
// Don't expand anything else, let legalization deal with it.
OpenPOWER on IntegriCloud