llvm-project/llvm/lib/CodeGen/SelectionDAG
Simon Pilgrim 8424df7dea Fix constant folding of fp2int to large integers
We make the assumption in most of our constant folding code that a fp2int will target an integer of 128-bits or less, calling the APFloat::convertToInteger with only uint64_t[2] of raw bits for the result.

Fuzz testing (PR24662) showed that we don't handle other cases at all, resulting in stack overflows and all sorts of crashes.

This patch uses the APSInt version of APFloat::convertToInteger instead to better handle such cases.

Differential Revision: https://reviews.llvm.org/D31074

llvm-svn: 298226
2017-03-19 16:50:25 +00:00
..
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
DAGCombiner.cpp [SelectionDAG] Optimize VSELECT->SETCC of incompatible or illegal types. 2017-03-16 07:17:12 +00:00
FastISel.cpp Fix constant folding of fp2int to large integers 2017-03-19 16:50:25 +00:00
FunctionLoweringInfo.cpp Simplify FunctionLoweringInfo.cpp with range for loops 2016-12-30 00:21:38 +00:00
InstrEmitter.cpp Removing a redundant assignment 2017-02-14 14:44:01 +00:00
InstrEmitter.h Pass DebugLoc and SDLoc by const ref. 2016-06-12 15:39:02 +00:00
LLVMBuild.txt
LegalizeDAG.cpp Make library calls sensitive to regparm module flag (Fixes PR3997). 2017-03-18 00:44:07 +00:00
LegalizeFloatTypes.cpp [legalizetypes] Push fp16 -> fp32 extension node to worklist. 2017-02-01 13:01:33 +00:00
LegalizeIntegerTypes.cpp Make library calls sensitive to regparm module flag (Fixes PR3997). 2017-03-18 00:44:07 +00:00
LegalizeTypes.cpp Make library calls sensitive to regparm module flag (Fixes PR3997). 2017-03-18 00:44:07 +00:00
LegalizeTypes.h [SelectionDAG] Optimize VSELECT->SETCC of incompatible or illegal types. 2017-03-16 07:17:12 +00:00
LegalizeTypesGeneric.cpp [SelectionDAG] Optimize VSELECT->SETCC of incompatible or illegal types. 2017-03-16 07:17:12 +00:00
LegalizeVectorOps.cpp DAG: Do not scalarize fsub if fneg is legal 2017-02-15 22:02:42 +00:00
LegalizeVectorTypes.cpp [SelectionDAG] Optimize VSELECT->SETCC of incompatible or illegal types. 2017-03-16 07:17:12 +00:00
ResourcePriorityQueue.cpp Add iterator_range<regclass_iterator> to {Target,MC}RegisterInfo, NFC 2017-01-25 19:29:04 +00:00
SDNodeDbgValue.h Apply clang-tidy's misc-move-constructor-init throughout LLVM. 2016-05-27 14:27:24 +00:00
ScheduleDAGFast.cpp
ScheduleDAGRRList.cpp Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
ScheduleDAGSDNodes.cpp Remove redundant call to GluedNodes.back() [NFC] 2017-02-19 16:56:18 +00:00
ScheduleDAGSDNodes.h [Target] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-01-11 01:45:03 +00:00
ScheduleDAGVLIW.cpp
SelectionDAG.cpp Fix constant folding of fp2int to large integers 2017-03-19 16:50:25 +00:00
SelectionDAGBuilder.cpp Make library calls sensitive to regparm module flag (Fixes PR3997). 2017-03-18 00:44:07 +00:00
SelectionDAGBuilder.h [DAG] improve documentation comments; NFC 2017-03-02 20:48:08 +00:00
SelectionDAGDumper.cpp [SelectionDAG] Add a signed integer absolute ISD node 2017-03-14 21:26:58 +00:00
SelectionDAGISel.cpp Recommitting Craig Topper's patch now that r296476 has been recommitted. 2017-03-14 01:42:23 +00:00
SelectionDAGPrinter.cpp
SelectionDAGTargetInfo.cpp
StatepointLowering.cpp [Statepoints] Reuse stack slots more than once within a basic block 2016-12-13 01:21:15 +00:00
StatepointLowering.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
TargetLowering.cpp Make library calls sensitive to regparm module flag (Fixes PR3997). 2017-03-18 00:44:07 +00:00