[llvm-dev] How to debug instruction selection

Ehsan Ali via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 15 02:50:02 PDT 2017


The most important information is the opcode that you have to select:
means convert  the independent machine instruction to  your machine
specific instruction, this error states that opcode X86ISD::Wrapper
must be selected which you failed to do.

Instruction selection happend in xxxInstInfo.td file or using C code
in select() function.

X86ISD::Wrapper is a pseudo instruction that wraps a bunch of other
instructions.

TargetGlobalAddress is the operand to X86ISD::Wrapper and is a i32.



On 8/15/17, Alex Denisov via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> Hi there,
>
> I try to JIT compile some bitcode and seeing the following error:
>
> LLVM ERROR: Cannot select: 0x28ec830: ch,glue = X86ISD::CALL 0x28ec7c0,
> 0x28ef900, Register:i32 %EDI, Register:i8 %AL, RegisterMask:Untyped,
> 0x28ec7c0:1
>   0x28ef900: i32 = X86ISD::Wrapper TargetGlobalAddress:i32<void (i8*, ...)*
> @_ZN5FooBr7xprintfEPKcz> 0
>     0x28ec520: i32 = TargetGlobalAddress<void (i8*, ...)*
> @_ZN5FooBr7xprintfEPKcz> 0
>   0x28ec670: i32 = Register %EDI
>   0x28ec750: i8 = Register %AL
>   0x28ec360: Untyped = RegisterMask
>   0x28ec7c0: ch,glue = CopyToReg 0x28ec6e0, Register:i8 %AL, Constant:i8<0>,
> 0x28ec6e0:1
>     0x28ec750: i8 = Register %AL
>     0x28ec600: i8 = Constant<0>
>     0x28ec6e0: ch,glue = CopyToReg 0x28ec590, Register:i32 %EDI, 0x28ef820
>       0x28ec670: i32 = Register %EDI
>       0x28ef820: i32 = X86ISD::Wrapper TargetGlobalAddress:i32<[47 x i8]*
> @.str> 0
>         0x28ec910: i32 = TargetGlobalAddress<[47 x i8]* @.str> 0
> In function: _ZN5FooBr10initSystemEv
>
> I have some assumptions about this particular error.
> What is not clear to me is: how am I supposed to read this error message?
> I.e. what to look at to make some sense out of it?
>
> P.S. I have zero knowledge about instruction selection, so any suggestions
> on where I can get this knowledge are more than welcome.
> --
> AlexDenisov
> Software Engineer, https://lowlevelbits.org
>
>


More information about the llvm-dev mailing list