Outreachy 2021 intern at LLVM

Hello everyone,

I am an Outreachy intern at LLVM and I will be working on implementing
GlobaliSel for M68k backend. I have wired up globalisel for M68k up to
the point where we can select return void. But M68k is big endian and
globalisel doesn't support big endian.

I have created a test case to test my implementation:

; RUN: llc -mtriple=m68k -global-isel -stop-after=irtranslator < %s |
FileCheck %s

; CHECK: name: f
; CHECK: RTS
define void @f() {
  ret void
}

But I get an error:

LLVM ERROR: unable to translate in big endian mode (in function: f)

How do I convert this error into a warning?

Hi Sushma,

I think many people have provided really useful tips in https://reviews.llvm.org/D101819.
If you still find difficulties fixing this issue, I’ll suggest starting from searching the error message string in the code base and trace the code from there. It should tell you which line of code prevents GlobalISel from supporting big endian.
After you (temporarily) lift the restriction (of big endian), you can run the test program again to see if it crashes any part of GlobalISel due to big endian.
In other words the whole process is try-and-error: Using the crash/error as a hint for missing big endian features.

-Min