diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-08-30 12:22:06 +0000 | 
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-08-30 12:22:06 +0000 | 
| commit | 8e1989e79a49e9e246a2863ea927fdabaa150e5f (patch) | |
| tree | 9ce7e1d58b671225b14bd24e4f42221046ac1645 | |
| parent | 68f73bf26247d1059a77465906f85d1bd69d6702 (diff) | |
| download | bcm5719-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
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 | 
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  | 

