[PATCH] D80047: Don't tail merge EHPads

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 16 23:19:53 PDT 2020


aeubanks added a comment.

I'm definitely not confident that this is the right thing to do, but this seems to prevent changing

  bb.9:
  ; predecessors: %bb.8
    successors: %bb.15(0x80000000); %bb.15(100.00%)
  
    renamable $eax = MOV32r0 implicit-def dead $eflags
    JMP_1 %bb.15
  
  bb.11.__except (landing-pad):
  ; predecessors: %bb.10
    successors: %bb.15(0x80000000); %bb.15(100.00%)
  
    renamable $eax = MOV32r0 implicit-def dead $eflags
    JMP_1 %bb.15

to

  bb.9:
  ; predecessors: %bb.8
    successors: %bb.11(0x80000000); %bb.11(100.00%)
  
  
  bb.11.__except (landing-pad):
  ; predecessors: %bb.10, %bb.9
    successors: %bb.15(0x80000000); %bb.15(100.00%)
  
    renamable $eax = MOV32r0 implicit-def dead $eflags
    JMP_1 %bb.15

I think you're not supposed to enter a landing pad through normal control flow, in this case a fallthrough (correct me if I'm wrong).

This causes a later pass (MachineBlockPlacement) to not properly update the terminator for a basic block, since `MachineBasicBlock::updateTerminator()` ignores landing pad basic block successors in the case where a block has an unconditional fallthrough.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80047/new/

https://reviews.llvm.org/D80047





More information about the llvm-commits mailing list