summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2014-03-22 01:47:22 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2014-03-22 01:47:22 +0000
commitd47cb57ab88956197c266df3353347eb31790781 (patch)
treeb09d18ac4d85405c17bbc2ab48eede93f230124a /include
parent4696def45d683f1b1ebed8d85688f4c31fce6258 (diff)
downloadllvm-d47cb57ab88956197c266df3353347eb31790781.tar.gz
llvm-d47cb57ab88956197c266df3353347eb31790781.tar.bz2
llvm-d47cb57ab88956197c266df3353347eb31790781.tar.xz
[DAG] Fix an assertion failure caused by an invalid cast in method 'BuildVectorSDNode::isConstantSplat'
This patch renames method 'isConstantSplat' as 'getConstantSplatValue' (mainly for consistency reasons), and rewrites its logic to ensure that we always perform a legal 'cast<ConstantSDNode>'. Added test shift-combine-crash.ll to verify that DAGCombiner no longer crashes with an assertion failure in the attempt to simplify a vector shift by a vector of all undef counts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index a6c72ca2d1..fd915b01d6 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -1522,10 +1522,11 @@ public:
unsigned MinSplatBits = 0,
bool isBigEndian = false) const;
- /// isConstantSplat - Simpler form of isConstantSplat. Get the constant splat
- /// when you only care about the value. Returns nullptr if this isn't a
- /// constant splat vector.
- ConstantSDNode *isConstantSplat() const;
+ /// getConstantSplatValue - Check if this is a constant splat, and if so,
+ /// return the splat value only if it is a ConstantSDNode. Otherwise
+ /// return nullptr. This is a simpler form of isConstantSplat.
+ /// Get the constant splat only if you care about the splat value.
+ ConstantSDNode *getConstantSplatValue() const;
bool isConstant() const;