[llvm-dev] Use Global ISel or SelectionDAG

360 views
Skip to first unread message

floris westermann via llvm-dev

unread,
Feb 13, 2020, 5:09:10 PM2/13/20
to llvm...@lists.llvm.org
Hi llvm-dev,

I am currently writing a backend for an architecture I am designing in my bachelor's thesis and recently came across the GlobalISel Selection Framework. 
Should already start using this over the more common Selection DAG?
Being new llvm backend development, I am not sure if GlobalISel would be "easier" to implement than ISelDAG and if there is any decent documentation on how to do so.

Cheers,
Floris

Luís Marques via llvm-dev

unread,
Feb 13, 2020, 5:52:14 PM2/13/20
to floris westermann, llvm...@lists.llvm.org
Hi Floris,

For a bachelor thesis I would probably recommend going with the safest choice of SelectionDAG. When I started doing LLVM development I was surprised by how common it is to have to solve LLVM issues that other architectures didn't happen to run into, despite me working on a very conventional target arch (RISC-V). You don't want to spend all your time budget on incidental problems that aren't core to your thesis. That said, GlobalISel is cool, so if you can make it work for you... ¯\_(ツ)_/¯

Alex Bradbury did some great work on creating a series of patches that show how to create the RISC-V target in a piecemeal and systematic way, so you might want to check that out:


Cheers,
Luis

_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Matt Arsenault via llvm-dev

unread,
Feb 13, 2020, 5:59:24 PM2/13/20
to floris westermann, llvm...@lists.llvm.org

I think it depends on how much you care about optimization, how weird your target is, and how long you plan to maintain it. If you don’t care about optimization, and have a very strange target, you would probably be better off with GlobalISel. There will be fewer examples to work with however.

-Matt

floris westermann via llvm-dev

unread,
Feb 13, 2020, 6:06:26 PM2/13/20
to Matt Arsenault, llvm...@lists.llvm.org
Hi matt,
Thanks for your advice, ill stick to SelectionDAG then, since my target isn't that strange and I'll have more examples to look at.

Cheers,
Floris

Francois Pichet via llvm-dev

unread,
Feb 17, 2020, 12:30:25 PM2/17/20
to Matt Arsenault, llvm-dev
Another thing to consider is that GlobalISel will report an error if your target is big-endian.
Reply all
Reply to author
Forward
0 new messages