Machine Intermediate Representation for Arm8 machine

Convert the Intermediate Representation (IR) of LLVM to the Machine Intermediate Representation (MIR) of a target machine ARM-8. Also when I check LLC version it doesn’t have target of Arm8.

Example :Convert this C++ program into MIR of ARM8.
int add ( int x , int y ) {
x = x + y ;
return x ;
}
I used clang to get IR but I am unable to use this command of llc:
llc -march=arm-8 -mcpu=cortex-a53 -filetype=asm add.ll -o add_arm8.s
Its shows error of Invalid target

When you build LLVM there is a cmake option: -DLLVM_TARGETS_TO_BUILD="X86;AArch64"
You have to build you LLVM with Arm8 support, otherwise your example with fail.

I think you may have the wrong naming here, arm-8 is not an Arm architecture version but armv8-a is.

If you’re targeting cortex-a53 that’s a 64 bit core ARM Cortex-A53 - Wikipedia. So I think you want armv8-a here. In which case as long as llc reports it supports AArch64 then you’re fine.

That said, I can’t figure out what names llc actually wants because they don’t seem to match clang’s -march. I see some tests passing -march=arm64 and that seems to work (as does -march=aarch64). AArch64’s default version is armv8-a so it works out in the end. Compiler Explorer