This generalizes the unwinding check during scalar promotion with the new semantics from D116998. I've extracted a common isNotVisibleOnUnwind() helper into AliasAnalysis, which handles allocas, byval arguments, sret arguments and noalias calls, as we have a few more places that need basically the same logic (DSE and MemCpyOpt at least). The noalias call case is a bit different from the others, because it also requires that the object is not captured.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM now if you remove the sret check (i.e invert the stack). LGTM once the sret patch lands otherwise.
llvm/lib/Transforms/Scalar/LICM.cpp | ||
---|---|---|
1937 | I find compound conditions more confusing that an extra if check. I'd turn this into a series of early return if-clauses personally. |
I find compound conditions more confusing that an extra if check. I'd turn this into a series of early return if-clauses personally.