diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-11-21 14:26:19 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-11-21 14:26:19 +0000 |
commit | 5448339889039a0e9c6753073c257d9741c1d577 (patch) | |
tree | 688fe23cc642eeeae6f9a639e2799884e49f670b /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | b6f76002d9158628e78b315858694fd36c96d0e0 (diff) | |
download | bcm5719-llvm-5448339889039a0e9c6753073c257d9741c1d577.tar.gz bcm5719-llvm-5448339889039a0e9c6753073c257d9741c1d577.zip |
[TargetLowering] SimplifyDemandedBits - only reduce known bits for integer constants
Avoids fuzzing crash found by Mikael Holmén.
llvm-svn: 347393
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 47c363f3143..0a7ba894866 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1361,7 +1361,9 @@ bool TargetLowering::SimplifyDemandedBits(SDValue Op, if (C->isOpaque()) return false; } - return TLO.CombineTo(Op, TLO.DAG.getConstant(Known.One, dl, VT)); + // TODO: Handle float bits as well. + if (VT.isInteger()) + return TLO.CombineTo(Op, TLO.DAG.getConstant(Known.One, dl, VT)); } return false; |