For full conference details, see the website: http://llvm.org/devmtg/2019-10/
Back To Schedule
Tuesday, October 22 • 2:35pm - 3:10pm
LLVM-Canon: Shooting for Clear Diffs

Sign up or log in to save this to your schedule, view media, leave feedback and see who's attending!

Comparing intermediate representation dumps after various transformations can be extremely laborious. This is especially true when reasoning through differences in shaders or compute modules which have undergone several optimization passes. Most of these differences tend to be semantically equivalent and are just a consequence of irregular instruction ordering and naming. In the need to save time we have developed a tool called llvm-canon which transforms the code into a canonical form. Thereby in ideal conditions, canonicalized semantically identical code should result in a clear diff, making important semantic differences stand out.
The challenges we faced during the development of this project gave us many sleepless nights. Puzzling over the right point of reference for canonicalization, calculating the odds of similarity, and finding the golden mean between precision and being human-friendly resulted in a very useful tool. A tool with broad possibilities for further expansion and improvements.
In this talk I will go through countless ideas for what is known today as llvm-canon (including ditched ones). Discuss the algorithms behind all the transformations, including instruction reordering and all the magic behind naming values. Yet more importantly I will demonstrate the benefits of diffing canonical code and what we have learned from this interesting experiment.


Tuesday October 22, 2019 2:35pm - 3:10pm
Breakout Room-1 (LL21AB)

Attendees (44)