summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2016-10-19 11:28:15 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2016-10-19 11:28:15 +0000
commit7dcb6e572ec7d62cc6744df4452fc7ef80f20c36 (patch)
treeadda9bcd0f18ae82f17c46896691ca4b759efb56 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parentc774a23bd9b704d0c114378be0cd3a262e5628ce (diff)
downloadbcm5719-llvm-7dcb6e572ec7d62cc6744df4452fc7ef80f20c36.tar.gz
bcm5719-llvm-7dcb6e572ec7d62cc6744df4452fc7ef80f20c36.zip
[DAGCombiner] Just call isConstOrConstSplat directly. NFCI.
This will get the same ConstantSDNode scalar or vector splat value as the current separate dyn_cast<ConstantSDNode> / isVector() approach. llvm-svn: 284578
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 6a047ac0915..9384d47b641 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -4704,13 +4704,11 @@ SDValue DAGCombiner::visitSRA(SDNode *N) {
return N0;
// fold vector ops
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- if (VT.isVector()) {
+ if (VT.isVector())
if (SDValue FoldedVOp = SimplifyVBinOp(N))
return FoldedVOp;
- N1C = isConstOrConstSplat(N1);
- }
+ ConstantSDNode *N1C = isConstOrConstSplat(N1);
// fold (sra c1, c2) -> (sra c1, c2)
ConstantSDNode *N0C = getAsNonOpaqueConstant(N0);
@@ -4856,13 +4854,11 @@ SDValue DAGCombiner::visitSRL(SDNode *N) {
unsigned OpSizeInBits = VT.getScalarSizeInBits();
// fold vector ops
- ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
- if (VT.isVector()) {
+ if (VT.isVector())
if (SDValue FoldedVOp = SimplifyVBinOp(N))
return FoldedVOp;
- N1C = isConstOrConstSplat(N1);
- }
+ ConstantSDNode *N1C = isConstOrConstSplat(N1);
// fold (srl c1, c2) -> c1 >>u c2
ConstantSDNode *N0C = getAsNonOpaqueConstant(N0);
OpenPOWER on IntegriCloud