[PATCH] D40979: [DWARF] Allow duplication of tails with CFI instructions

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 8 10:07:36 PST 2018


MatzeB added a comment.

Ok I didn't realize where/how our code fails to deal with duplicated CFI.

In https://reviews.llvm.org/D40979#961256, @djokov wrote:

> Ok, then I would suggest that instead of this code we
>
> 1. make CFI instructions duplicable;


I would advise to keep the `NotDuplicable` instruction attribute for now as long as our code cannot handle it. But moving the duplication logic into MachineInstr/MCCFIInstruction is a good idea anyway.

> 2. let TailDuplicator::shouldTailDuplicate return false for CFI and Darwin, or better yet -
> 3. fix generateCompactUnwindEncoding in ARM, AArch64 and x86 backends to fallback to DWARF when the info cannot fit into compact encoding.
> 
>   Still, we should probably use 3. only for corner cases like Reid's example.
> 
>   If I'm not missing something, if we used it for CFI instructions in epilogue (which will start appearing when Violeta resubmits r317579) then practically every function would fallback to DWARF so compact unwind would become quite meaningless.

Hmm yeah, I guess compact unwind is important for code size. So we would prefer to stay with the current behavior on darwin as you did with this patch. (Though I've never seen actual numbers of how big an impact it has).


Repository:
  rL LLVM

https://reviews.llvm.org/D40979





More information about the llvm-commits mailing list