Currently FastISel lowers constexpr calls as indirect calls. We'd like those to direct calls, and falling back to SelectionDAGISel handles that.
Details
Diff Detail
- Build Status
Buildable 9605 Build 9605: arc lint + arc unit
Event Timeline
Are there any other constants/constexprs besides bitcast that we might encounter, that we should test? Looking at the constexprs, I don't see too much that looks likely. Maybe GEP? I guess you can indirectly call a GlobalVariable, which ought to look the same as a local function pointer, maybe we should have a test for that too (presumably dag isel handles that too).
Also that this patch really does is just bail from fast-isel when the callee is a constant (which is fine), and that has the effect of causing calls of bitcasts to be lowered as direct calls.
OK nevermind, GlobalVariable doesn't make sense because you have to load it, and similarly for GEP. We could probably do inttoptr though, and maybe select, to get a function pointer and call that.
Also looking back and my previous comment,
Also that this patch really does is just bail from fast-isel when the callee is a constant (which is fine), and that has the effect of causing calls of bitcasts to be lowered as direct calls.
it really wasn't clear what what I meant was that when you land this you should update the commit description to be more clear about what this change does (bail) and that that's why its effect is to cause calls of bitcasts to be direct.
test/CodeGen/WebAssembly/call.ll | ||
---|---|---|
163 | If the behavior of bailing from fast-isel is to go back and select the whole rest of the BB with the DAG isel, then these calls probably need to be in different BBs, so we can check that each independently causes a bail. |
This is subtle enough that it would be good to have a comment in the code itself explaining it.
If the behavior of bailing from fast-isel is to go back and select the whole rest of the BB with the DAG isel, then these calls probably need to be in different BBs, so we can check that each independently causes a bail.