FastIsel, SelectionDAGISel or GlobalISel?

Hi,

I am trying to add a new hardware target in LLVM backend. I am starting from scratch based on LLVM 10.0 and wondering what the best strategy would be for my own instruction selection, FastISel, SelectionDAG, or GlobalISel? What are the factors I should consider and which existing target is a good reference for each choice?

If I understand correctly, FastIsel and GlobalISel both may fail and fall back to SelectionDAGISel. Therefore, it sounds like I cannot avoid SelectionDAG. However, I read somewhere that GlobalISel will replace SelectionDAGISel eventually. This makes me confused. If time to product is important, would FastISel + some optimizaitons a reasonable choice?

Any suggestions would be highly appreciated.

Many thanks,
PW

Hi PW,

If you’re starting from scratch, GISel is probably the best forward looking solution.
Given you will be implemented everything in GISel if something doesn’t work you would just have to fix it within GISel.

What I am saying is the fallback path to SDISel is here for the exiting targets that have put a lot of effort in SDISel in the past. You shouldn’t need to use it when you start from scratch!

Hope this helps.

Cheers,
-Quentin