[PATCH] D80951: [GlobalOpt] Remove preallocated calls when possible
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 8 16:39:50 PDT 2020
efriedma added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/GlobalOpt.cpp:2334
+
+ // FIXME: This doesn't handle invoke
+ Builder.SetInsertPoint(NewCB->getNextNonDebugInstruction());
----------------
"This doesn't handle invoke" is rough...
In the normal destination, you can stick a stackrestore as the first instruction (breaking the critical edge if necessary). In the unwind destination, I'm not sure. For Itanium-style unwinding, you could just stick it immediately after the landingpad, but I'm not sure what you can do on Windows; you can't stackrestore in a funclet.
I guess ultimately, we really want to use a static alloca (in the entry block) in most cases, but it's not safe in all cases, as we've discussed before.
At the very least, this probably should bail out somehow, not crash.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80951/new/
https://reviews.llvm.org/D80951
More information about the llvm-commits
mailing list