This will avoid duplicating EstimateFunctionSizeInBytes for architectures.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Looks fine to me, but I'm not active in this part of the codebase, it would be better for others to review it.
ARM hard-coded EK_Inline as jump table encoding in rG8d3ba7349c2137f1a7f68c0ce5c1345496fc0b63. As a result, std::max(JTI->getEntrySize(DL), JTI->getEntryAlignment(DL)) always returns 1, which causes test/CodeGen/Thumb/large-fn-switch.ll to fail.
llvm/lib/Target/CSKY/CSKYFrameLowering.cpp | ||
---|---|---|
274 | CSKY function does not contain jumptable now if there is any jumpable. |
The ARM version EstimateFunctionSizeInBytes in the context of frame lowering needs to ensure that it interacts correctly with later passes that might cause the function to grow, in particular ARMConstantIslandPass. The inclusion of constant pools and jump tables is intended to account for that. On targets which don't have an equivalent pass, you probably don't want to measure them. I guess CSKY in particular does embed constant pools... but it doesn't look like it embeds jump tables?
Anyway, it isn't obvious to me that you can actually come up with an estimate that actually makes sense in a target-independent context, so I'm not sure this is worth doing.
CSKY function does not contain jumptable now if there is any jumpable.