Why nop inserted for ppc64 b/w branches
Why nop inserted for the callee's for the line 14 and 15 ,but not line 11 and 12.
https://godbolt.org/z/Kj4Y5x3o7
We need to notoc based call for the example ,how we do the same for ppc64
Its not the case for ppc32 . https://godbolt.org/z/o8nMobzPb
@llvm/issue-subscribers-backend-powerpc
Like an issue to fast-isel only. If compile with optimization(declare callee with noinline attribute), the code gen is expected, no nop after bl.
@chenzheng1030 ,agree and fast-isel should be fixed in debug mode.
Sure, we will have a look
https://reviews.llvm.org/D126205 & nfc refactor patch https://reviews.llvm.org/D126203 are posted for this issue.
What problem does the nop pose? Is this a concern due to code size? Performance shouldn't be affected and even if it is, this is restricted to -O0. I don't think it is useful to do much analysis to figure out whether a nop is needed in FastISel. Compilation at -O0 with FastISel is supposed to be fast and the generated code definitely won't be fast. There should be a reasonably high barrier to entry for optimizations into this instruction selection pipeline.
So if this isn't causing any issues but simply subjectively looks odd, I would prefer that we leave it as it is rather than adding complications to this selection pipeline.
@nemanjai
What problem does the nop pose? We have the issue with gdb testing like we step into callee and finish from the callee() ,the pc is pointing like (gdb) s callee () at step-test.c:9 9 myglob++; return 0; (gdb) finish Run till exit from #0 callee () at step-test.c:9 0x000000000400090c in main () at step-test.c:45
i.e nop and but expected is next callee() call .
Is it acceptable to add -mllvm -fast-isel=false to the command line for this type of testing to ensure we don't use Fast ISel?
Here's your example with that option added: https://godbolt.org/z/8Kv1efed1
@nemanjai ,yes we will fall back by disabling fast-isel.
@UmeshKalappa0: Could you please point to commit?
@EugeneZelenko No commit for this issue. The posted patches are abandoned. This issue can be solved by using option -mllvm -fast-isel=false.
@chenzheng1030: Thank you for clarification!