[llvm-dev] "BL" or "B" when compiling ARM

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Thu May 23 04:30:51 PDT 2019


Hi Muhui,

On Thu, 23 May 2019 at 12:23, Muhui Jiang via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> I am really curious when the compiler would choose to use BL and when the compiler would choose to use B when the target is a basic block. I noticed sometimes there might be no differences between these two branch instructions.

BL is one of the very few instructions that's 32-bits wide on CPUs
that only support the Thumb1 instruction set (usually Cortex-M0 these
days). Because of that it's got a much larger range than any other
branch so LLVM uses it instead of a string of intermediate branches
when a target block would be out of range of the usual unconditional
branches.

Cheers.

Tim.


More information about the llvm-dev mailing list