[all-commits] [llvm/llvm-project] 883758: [ARM] Fix Arm block placement creating branches af...

David Green via All-commits all-commits at lists.llvm.org
Sat Sep 25 03:32:37 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 883758ed480012a875146bc206cb8bcdd384405b
      https://github.com/llvm/llvm-project/commit/883758ed480012a875146bc206cb8bcdd384405b
  Author: David Green <david.green at arm.com>
  Date:   2021-09-25 (Sat, 25 Sep 2021)

  Changed paths:
    M llvm/lib/Target/ARM/ARMBlockPlacement.cpp
    M llvm/test/CodeGen/Thumb2/mve-wls-block-placement.mir

  Log Message:
  -----------
  [ARM] Fix Arm block placement creating branches after jump tables.

Given:
 - A jump table
 - Which jumps to the next block
 - The next block ends in a WLS
 - Where the WLS conditionally jumps to block earlier in the program.

The Arm block placement pass would attempt to move the block containing
the WLS earlier, as the WLS instruction can only branch forward. In
doing so it would add a branch from the jumptable block to the WLS
block, thinking it previously fell-through.

This in itself would be fine, if a little inefficient, but the constant
island pass expects all instructions after a jump-table branch to have
been removed by analyzeBranch. So it gets confused and can assign the
same labels to multiple jump table blocks.

I've changed the condition to the same as used in analyzeBranch.




More information about the All-commits mailing list