When printing the same set of statements within a different overall scope (e.g. Block vs Region), the labels assigned to SSA values (e.g. %0, %1, etc) always start with %0. This can make debugging difficult, as the same statement will have different printed SSA values depending on what else is being printed.
Possible fixes:
- global assignment of SSA indices when lowering
- @weinbe58's suggestion: when printing, figure out the SSA value index within its region, and always use that index