passes: don't mark arguments live at call site
The call arguments don't need to be live at a statepoint if they
are not used later. The original code supposes to handle this,
but in fact it didn't seem to work. This CL fixes this.
Change-Id: I389f9204daf646f2eeeed6ccf0d17dbf35f8265b
Reviewed-on: https://go-review.googlesource.com/c/gollvm/+/165238
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/passes/GoStatepoints.cpp b/passes/GoStatepoints.cpp
index 6dd5708..c9e0ab5 100644
--- a/passes/GoStatepoints.cpp
+++ b/passes/GoStatepoints.cpp
@@ -2877,15 +2877,11 @@
// We want to handle the statepoint itself oddly. It's
// call result is not live (normal), nor are it's arguments
- // (unless they're used again later). This adjustment is
- // specifically what we need to relocate
- computeLiveInValues(BB->rbegin(), ++Inst->getIterator().getReverse(),
- LiveOut, AddrTakenAllocas, DVCache);
- LiveOut.remove(Inst);
-
+ // (unless they're used again later).
// The statepoint is always an invoke instruction, which is the last
- // instruction in the block. The only thing it can initialize is the
- // outgoing arg.
+ // instruction in the block. The only thing it can initialize is its
+ // result (passed directly, or indirectly as outgoing arg).
+ LiveOut.remove(Inst);
if (InvokeInst *II = dyn_cast<InvokeInst>(Inst))
if (II->hasStructRetAttr()) {
Value *Ptr = II->getOperand(0);