diff options
author | Jon Roelofs <jonathan_roelofs@apple.com> | 2024-06-13 18:05:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-13 18:05:52 -0700 |
commit | 785dc76c6667d0ea81c8b877dbff9c1e843918d6 (patch) | |
tree | 77536a329e962628e80b87a1dc228b18a2c48939 /llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp | |
parent | 41c50f0836439f4d53e7209cd9e9ce54341ed9a3 (diff) | |
download | llvm-785dc76c6667d0ea81c8b877dbff9c1e843918d6.zip llvm-785dc76c6667d0ea81c8b877dbff9c1e843918d6.tar.gz llvm-785dc76c6667d0ea81c8b877dbff9c1e843918d6.tar.bz2 |
[llvm][SelectionDAG] Fix up chains in lowerInvokeable. rdar://113994760 (#94004)
lowerInvokeable wasn't updating the returned chain after emitting the
lowerEndEH, which caused SwiftErrorVal-handling code to re-set the DAG
root, and thus accidentally skip the EH_LABEL node it was supposed to
have addeed. After fixing that, a few places needed to be adjusted that
assume the specific shape of the returned DAG.
Fixes: #64826
Fixes: rdar://113994760
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp index d7f4d1c..671ec84fb 100644 --- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -340,6 +340,9 @@ static std::pair<SDValue, SDNode *> lowerCallFromStatepointLoweringInfo( // to grab the return value from the return register(s), or it can be a LOAD // to load a value returned by reference via a stack slot. + if (CallEnd->getOpcode() == ISD::EH_LABEL) + CallEnd = CallEnd->getOperand(0).getNode(); + bool HasDef = !SI.CLI.RetTy->isVoidTy(); if (HasDef) { if (CallEnd->getOpcode() == ISD::LOAD) |