SDNode type UNDEF in new llvm-backend

Hello!

I'm new to llvm and have the following problem trying to implement a new
backend, based on the LEG-backend by Fraser Cormack.

I used the standard clang command (under Ubuntu) to generate main.bc
from the following tiny program:

main.c:
void main() {
  volatile int a, b, c;
  c = a - b;
}

I then used the following command:
llc -march=lacore -debug -print-after-all main.bc -o main.s

The program terminated with an assertion violation, see output below.
The UNDEF node (t3) apparently causes the problem. But, according to my
understanding, this node is already generated in the IR->DAG translation
and already exisiting in the initial selection DAG (in the load and
store commands). Therefore, it is probably not related to my own,
error-prone target implementation. That makes the problem even harder to
understand. I could not find out where the UNDEF SDNode is generated.

Thank you in advance for any hints!

Best regards,
Markus

Hello!

I'm new to llvm and have the following problem trying to implement a new
backend, based on the LEG-backend by Fraser Cormack.

I used the standard clang command (under Ubuntu) to generate main.bc
from the following tiny program:

main.c:
void main() {
volatile int a, b, c;
c = a - b;
}

I then used the following command:
llc -march=lacore -debug -print-after-all main.bc -o main.s

The program terminated with an assertion violation, see output below.
The UNDEF node (t3) apparently causes the problem. But, according to my
understanding, this node is already generated in the IR->DAG translation
and already exisiting in the initial selection DAG (in the load and
store commands).

You program is loading from unallocated memory, this is what the "undef" represents here.

Therefore, it is probably not related to my own,
error-prone target implementation.

You target does not handle undef apparently.

It looks like no instruction selection has happened. By the time
"Final schedule" gets decided, these should all be your machine's
native instructions. Are you sure you've implemented
XYZISelDAGToDAG::Select properly?

Cheers.

Tim.