summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-09-01 18:15:06 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-09-01 18:15:06 +0000
commitf61d1c072e368327559601522f16f43bfa6431b6 (patch)
treed776526826f9a6edbe057404d45a14e1ffcc2d6a /llvm/lib
parentf39c67685bf46e46ea9734a4da205595f0abe01a (diff)
downloadbcm5719-llvm-f61d1c072e368327559601522f16f43bfa6431b6.tar.gz
bcm5719-llvm-f61d1c072e368327559601522f16f43bfa6431b6.zip
Fix vbroadcast matching logic to early unmatch if the node doesn't have
only one use. Fix PR10825. llvm-svn: 138951
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 0d454149301..706b1a2f80c 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -6409,12 +6409,16 @@ static bool isVectorBroadcast(SDValue &Op) {
if (Is256)
V = V.getOperand(1);
- if (V.hasOneUse() && V.getOpcode() != ISD::SCALAR_TO_VECTOR)
+
+ if (!V.hasOneUse())
return false;
// Check the source scalar_to_vector type. 256-bit broadcasts are
// supported for 32/64-bit sizes, while 128-bit ones are only supported
// for 32-bit scalars.
+ if (V.getOpcode() != ISD::SCALAR_TO_VECTOR)
+ return false;
+
unsigned ScalarSize = V.getOperand(0).getValueType().getSizeInBits();
if (ScalarSize != 32 && ScalarSize != 64)
return false;
OpenPOWER on IntegriCloud