[llvm-dev] {ARM} IfConversion does not detect BX instruction as a branch

Kyle Butt via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 9 11:00:59 PDT 2017


On Mon, Oct 9, 2017 at 3:10 AM, Gaƫl Jobin via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
>
> My current fix is the following:
>
> @@ -408,7 +408,8 @@ unsigned ARMBaseInstrInfo::removeBranch(MachineBasicBlock
> &MBB,
>    return 0;
>
>    if (!isUncondBranchOpcode(I->getOpcode()) &&
> -      !isCondBranchOpcode(I->getOpcode()))
> +     !isCondBranchOpcode(I->getOpcode()) &&
> +     !isIndirectBranchOpcode(I->getOpcode()))
>       return 0;
>
> Does that makes sense?
>
>
> Independent of anything else, that looks like a bug
in  ARMBaseInstrInfo::removeBranch

It probably has escaped unnoticed because there aren't many code paths that
will try to remove an indirect branch.
I'll let ARM folks chime in, but it looks correct to me.

Kyle.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171009/01adcfb9/attachment.html>


More information about the llvm-dev mailing list