llvm-project/llvm/lib/CodeGen/SelectionDAG
Philip Reames 2b1084ac93 [statepoints][experimental] Add support for live-in semantics of values in deopt bundles
This is a first step towards supporting deopt value lowering and reporting entirely with the register allocator. I hope to build on this in the near future to support live-on-return semantics, but I have a use case which allows me to test and investigate code quality with just the live-in semantics so I've chosen to start there. For those curious, my use cases is our implementation of the "__llvm_deoptimize" function we bind to @llvm.deoptimize. I'm choosing not to hard code that fact in the patch and instead make it configurable via function attributes.

The basic approach here is modelled on what is done for the "Live In" values on stackmaps and patchpoints. (A secondary goal here is to remove one of the last barriers to merging the pseudo instructions.) We start by adding the operands directly to the STATEPOINT SDNode. Once we've lowered to MI, we extend the remat logic used by the register allocator to fold virtual register uses into StackMap::Indirect entries as needed. This does rely on the fact that the register allocator rematerializes. If it didn't along some code path, we could end up with more vregs than physical registers and fail to allocate.

Today, we *only* fold in the register allocator. This can create some weird effects when combined with arguments passed on the stack because we don't fold them appropriately. I have an idea how to fix that, but it needs this patch in place to work on that effectively. (There's some weird interaction with the scheduler as well, more investigation needed.)

My near term plan is to land this patch off-by-default, experiment in my local tree to identify any correctness issues and then start fixing codegen problems one by one as I find them. Once I have the live-in lowering fully working (both correctness and code quality), I'm hoping to move on to the live-on-return semantics. Note: I don't have any *known* miscompiles with this patch enabled, but I'm pretty sure I'll find at least a couple. Thus, the "experimental" tag and the fact it's off by default.

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

llvm-svn: 280250
2016-08-31 15:12:17 +00:00
..
CMakeLists.txt Rename TargetSelectionDAGInfo into SelectionDAGTargetInfo and move it to CodeGen/ 2016-01-27 16:32:26 +00:00
DAGCombiner.cpp Use SDValue::getOpcode() helper instead of via SDValue::getNode() 2016-08-20 20:04:18 +00:00
FastISel.cpp ADT: Remove all ilist_iterator => pointer casts, NFC 2016-08-12 05:05:36 +00:00
FunctionLoweringInfo.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
InstrEmitter.cpp CodeGen: Use MachineInstr& in TargetLowering, NFC 2016-06-30 22:52:52 +00:00
InstrEmitter.h Pass DebugLoc and SDLoc by const ref. 2016-06-12 15:39:02 +00:00
LLVMBuild.txt
LegalizeDAG.cpp Replace a few more "fall through" comments with LLVM_FALLTHROUGH 2016-08-17 20:30:52 +00:00
LegalizeFloatTypes.cpp [X86] Accept SELECT op code for x86-64 fp128 type 2016-07-18 17:20:09 +00:00
LegalizeIntegerTypes.cpp Fixed a bug in type legalizer for masked gather. 2016-08-29 09:12:31 +00:00
LegalizeTypes.cpp [SelectionDAG] Get rid of bool parameters in SelectionDAG::getLoad, getStore, and friends. 2016-07-15 18:27:10 +00:00
LegalizeTypes.h fix documentation comments; NFC 2016-07-09 18:52:07 +00:00
LegalizeTypesGeneric.cpp [SelectionDAG] Get rid of bool parameters in SelectionDAG::getLoad, getStore, and friends. 2016-07-15 18:27:10 +00:00
LegalizeVectorOps.cpp Replace a few more "fall through" comments with LLVM_FALLTHROUGH 2016-08-17 20:30:52 +00:00
LegalizeVectorTypes.cpp [SelectionDAG] Get rid of bool parameters in SelectionDAG::getLoad, getStore, and friends. 2016-07-15 18:27:10 +00:00
ResourcePriorityQueue.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
SDNodeDbgValue.h Apply clang-tidy's misc-move-constructor-init throughout LLVM. 2016-05-27 14:27:24 +00:00
ScheduleDAGFast.cpp Replace uint16_t with the MCPhysReg typedef in many places. A lot of physical register arrays already use this typedef. 2015-12-05 07:13:35 +00:00
ScheduleDAGRRList.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
ScheduleDAGSDNodes.cpp SelectionDAG: Avoid implicit iterator conversions in ScheduleDAGSDNodes, NFC 2016-07-08 19:07:09 +00:00
ScheduleDAGSDNodes.h [SelectionDAG] Remove dead code. NFC. 2015-10-15 17:54:06 +00:00
ScheduleDAGVLIW.cpp
SelectionDAG.cpp Propagate TBAA info in SelectionDAG::getIndexedLoad 2016-08-29 19:50:15 +00:00
SelectionDAGBuilder.cpp Reuse an SDLoc throughout a function. NFC. 2016-08-25 18:50:56 +00:00
SelectionDAGBuilder.h Local variables whose address is taken and passed on to a call are described 2016-08-15 18:18:26 +00:00
SelectionDAGDumper.cpp Fix some more asserts after r279466. 2016-08-23 16:23:45 +00:00
SelectionDAGISel.cpp [SelectionDAG] Do not run the ISel process on already selected code. 2016-08-26 22:32:55 +00:00
SelectionDAGPrinter.cpp Make the SelectionDAG graph printer use SDNode::PersistentId labels. 2015-10-27 23:09:03 +00:00
SelectionDAGTargetInfo.cpp Rename TargetSelectionDAGInfo into SelectionDAGTargetInfo and move it to CodeGen/ 2016-01-27 16:32:26 +00:00
StatepointLowering.cpp [statepoints][experimental] Add support for live-in semantics of values in deopt bundles 2016-08-31 15:12:17 +00:00
StatepointLowering.h [NFC] Header cleanup 2016-04-18 09:17:29 +00:00
TargetLowering.cpp Replace a few more "fall through" comments with LLVM_FALLTHROUGH 2016-08-17 20:30:52 +00:00