qir-alliance / qat

QIR compiler tools and optimization passes for targeting QIR to different hardware backends
https://qir-alliance.github.io/qat/
MIT License
26 stars 14 forks source link

Add lower switch pass in static resource #103

Closed swernli closed 2 years ago

swernli commented 2 years ago

Since the static resource pass also performs a SimplifyCFG pass, it can have have the side effect of reintroducing switch instructions even after they've been removed by the earlier LowerSwitch pass. This adds LowerSwitch to the set of post id change passes.

troelsfr commented 2 years ago

I think it would have been great to also have a test for this scenario, but other than that, the PR is good.