summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-08-30 12:22:06 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-08-30 12:22:06 +0000
commit8e1989e79a49e9e246a2863ea927fdabaa150e5f (patch)
tree9ce7e1d58b671225b14bd24e4f42221046ac1645 /llvm/lib
parent68f73bf26247d1059a77465906f85d1bd69d6702 (diff)
downloadbcm5719-llvm-8e1989e79a49e9e246a2863ea927fdabaa150e5f.tar.gz
bcm5719-llvm-8e1989e79a49e9e246a2863ea927fdabaa150e5f.zip
[DAGCombine] visitMULHS - use getScalarValueSizeInBits() to make safe for vector types.
This is hidden behind a (scalar-only) isOneConstant(N1) check at the moment, but once we get around to adding vector support we need to ensure we're dealing with the scalar bitwidth, not the total. llvm-svn: 370468
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 1b98b937ca4..e22bd48fe64 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -4195,7 +4195,7 @@ SDValue DAGCombiner::visitMULHS(SDNode *N) {
// fold (mulhs x, 1) -> (sra x, size(x)-1)
if (isOneConstant(N1))
return DAG.getNode(ISD::SRA, DL, N0.getValueType(), N0,
- DAG.getConstant(N0.getValueSizeInBits() - 1, DL,
+ DAG.getConstant(N0.getScalarValueSizeInBits() - 1, DL,
getShiftAmountTy(N0.getValueType())));
// fold (mulhs x, undef) -> 0
OpenPOWER on IntegriCloud