Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
SDAG doesn't seem to mark the call as returned with the same example. Is this a new optimization?
https://clang.godbolt.org/z/K49z51zoo
IIRC thisreturn comes up as a result of the returned attribute in IR, right? Should the frontend be marking memory functions as returned instead? (I guess that we'd need a patch like this either way...?)
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | ||
---|---|---|
594 | Why change to unreachable? This is an unrelated change. |
Godbolt is using c++ by default so we need to extern C the source: https://clang.godbolt.org/z/594M46vYs
But it seems the difference is that SDAG can tail call it while GISel doesn't.
It doesn't, but it must know something about this property since it doesn't restore $x0 afterward.
Is this a new optimization?
rdar://77466123
https://clang.godbolt.org/z/K49z51zoo
IIRC thisreturn comes up as a result of the returned attribute in IR, right? Should the frontend be marking memory functions as returned instead? (I guess that we'd need a patch like this either way...?)
Exactly. The thing that's special here is that these three functions have their own GISel Opcodes, which don't have that returned behavior that the call had, so it wasn't being transferred automatically like it would for other calls with the attribute.
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | ||
---|---|---|
594 | The one call site only passes these four opcodes, so I figured this was a useful drive-by improvement. Happy to take it out if you think it should stay generic. |
Why change to unreachable? This is an unrelated change.