[LLVMdev] indirectbr implementation for Alpha backend
Andrew Lenharth
andrewl at lenharth.org
Thu Mar 31 07:49:05 PDT 2011
On Thu, Mar 31, 2011 at 9:22 AM, Giang Hoang <ghoang84 at gmail.com> wrote:
> Hi,
> I encountered an error while trying to use the indirectbr instruction with
> Alpha backend (current build). Here's part of the code sequence that I
> tried to compile:
> bb1:
> %1 = load i32* %i, align 4
> %2 = add nsw i32 %1, 1
> store i32 %2, i32* %i, align 4
> indirectbr i8* blockaddress(@main, %bb1), [ label %bb1 ]
> br label %return
> This compiles correctly when I use the X86 or PPC backend, but results in
> the following error with Alpha backend:
> LLVM ERROR: Cannot select: 0x95a0490: i64 = BlockAddress<@main, %bb1> [ID=3]
> I also found the following line commented out in the file
> lib/Target/Alpha/AlphaISelLowering.cpp:
> // setOperationAction(ISD::BRIND, MVT::Other, Expand);
> My guess is that indirectbr is not implemented for Alpha. If that's the
> case, where do I need to make changes to implement this instruction?
What is missing is lowering block addresses to target addresses. Have
you tried uncommenting that line? Otherwise lowering directly to a
target address (if that expansion doesn't) may work.
Andrew
> Thank you,
> Giang
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
More information about the llvm-dev
mailing list