diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2019-09-23 17:05:46 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2019-09-23 17:05:46 +0000 |
commit | 8b1412a144262b8444b16ae2f2940152aec61901 (patch) | |
tree | 3997927cf42dea12b241321a27beabd348e870ae /contrib/llvm | |
parent | 6d3bb28257f65040cdb561448eb51ddf43b4c90c (diff) |
Pull in r372606 from upstream llvm trunk (by Sanjay Patel):
[x86] fix assert with horizontal math + broadcast of vector (PR43402)
https://bugs.llvm.org/show_bug.cgi?id=43402
This should fix 'Assertion failed: ((HOp.getValueType() == MVT::v2f64 ||
HOp.getValueType() == MVT::v4f64) && HOp.getValueType() == VT &&
"Unexpected type for h-op"), function foldShuffleOfHorizOp, file
contrib/llvm/lib/Target/X86/X86ISelLowering.cpp, line 33661' when
building the devel/llvm90 port with CPUTYPE=haswell.
PR: 240759
Notes
Notes:
svn path=/projects/clang900-import/; revision=352629
Diffstat (limited to 'contrib/llvm')
-rw-r--r-- | contrib/llvm/lib/Target/X86/X86ISelLowering.cpp | 8 | ||||
-rw-r--r-- | contrib/llvm/lib/Target/X86/X86ISelLowering.h | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp b/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp index 0c5b8a79dd62..1869cc9da017 100644 --- a/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -33651,14 +33651,14 @@ static SDValue foldShuffleOfHorizOp(SDNode *N, SelectionDAG &DAG) { // When the operands of a horizontal math op are identical, the low half of // the result is the same as the high half. If a target shuffle is also - // replicating low and high halves, we don't need the shuffle. + // replicating low and high halves (and without changing the type/length of + // the vector), we don't need the shuffle. if (Opcode == X86ISD::MOVDDUP || Opcode == X86ISD::VBROADCAST) { - if (HOp.getScalarValueSizeInBits() == 64) { + if (HOp.getScalarValueSizeInBits() == 64 && HOp.getValueType() == VT) { // movddup (hadd X, X) --> hadd X, X // broadcast (extract_vec_elt (hadd X, X), 0) --> hadd X, X assert((HOp.getValueType() == MVT::v2f64 || - HOp.getValueType() == MVT::v4f64) && HOp.getValueType() == VT && - "Unexpected type for h-op"); + HOp.getValueType() == MVT::v4f64) && "Unexpected type for h-op"); return updateHOp(HOp, DAG); } return SDValue(); diff --git a/contrib/llvm/lib/Target/X86/X86ISelLowering.h b/contrib/llvm/lib/Target/X86/X86ISelLowering.h index db36bcb929e3..d873edb857a8 100644 --- a/contrib/llvm/lib/Target/X86/X86ISelLowering.h +++ b/contrib/llvm/lib/Target/X86/X86ISelLowering.h @@ -422,7 +422,8 @@ namespace llvm { // Tests Types Of a FP Values for scalar types. VFPCLASSS, - // Broadcast scalar to vector. + // Broadcast (splat) scalar or element 0 of a vector. If the operand is + // a vector, this node may change the vector length as part of the splat. VBROADCAST, // Broadcast mask to vector. VBROADCASTM, |