summaryrefslogtreecommitdiffstats
path: root/contrib/llvm
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-06-02 19:54:38 +0000
committerdim <dim@FreeBSD.org>2016-06-02 19:54:38 +0000
commit370a96c692d0c49681e1631cc30dfa3e99a858d4 (patch)
treedd21b0ed5ac3c807e614560ca2a3883d0802f0df /contrib/llvm
parent6f31a383cc6d2459585d754d3d30f980487df06f (diff)
downloadFreeBSD-src-370a96c692d0c49681e1631cc30dfa3e99a858d4.zip
FreeBSD-src-370a96c692d0c49681e1631cc30dfa3e99a858d4.tar.gz
Pull in r271548 from upstream llvm trunk (by me):
Only attempt to detect AVG if SSE2 is available Summary: In PR29973 Sanjay Patel reported an assertion failure when a certain loop was optimized, for a target without SSE2 support. It turned out this was because of the AVG pattern detection introduced in rL253952. Prevent the assertion failure by bailing out early in `detectAVGPattern()`, if the target does not support SSE2. Also add a minimized test case. Reviewers: congh, eli.friedman, spatel Subscribers: emaste, llvm-commits Differential Revision: http://reviews.llvm.org/D20905 This should fix assertion failures ("Requires at least SSE2!") when building the games/0ad port with CPUTYPE=pentium3. Reported by: madpilot
Diffstat (limited to 'contrib/llvm')
-rw-r--r--contrib/llvm/lib/Target/X86/X86ISelLowering.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp b/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
index 25288a7..66b12d3 100644
--- a/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -26159,6 +26159,8 @@ static SDValue detectAVGPattern(SDValue In, EVT VT, SelectionDAG &DAG,
if (InScalarVT.getSizeInBits() <= ScalarVT.getSizeInBits())
return SDValue();
+ if (!Subtarget->hasSSE2())
+ return SDValue();
if (Subtarget->hasAVX512()) {
if (VT.getSizeInBits() > 512)
return SDValue();
OpenPOWER on IntegriCloud