Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ZeroBundle wrapping for GlobalRef PhiNode args #212

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

topolarity
Copy link
Contributor

These are not legal to insert in-place for PhiNodes. Without this change:

272 ┄─ %3410  = φ (#270 => bsim4_vamodel.bsim4_module.NaN, #271 => %3409)::Incidence(Float64, )

is transformed into

272 ┄─ %3341  = (ZeroBundle{1})(bsim4_vamodel.bsim4_module.NaN)::Any
│      %3342  = φ (#270 => %3341, #271 => %3340)::Any

We have to reach back into the preceding basic block and insert the bundle there instead. This solution is a bit of a hack, but at least it gets things working for now.

@topolarity
Copy link
Contributor Author

This needs some tests and is a bit of hack, but I wanted to open early in case @Keno or @oxinabox feel inspired to finish it up properly.

@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

❗ No coverage uploaded for pull request base (kf/forcedar@9bed4b8). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@              Coverage Diff               @@
##             kf/forcedar     #212   +/-   ##
==============================================
  Coverage               ?   55.72%           
==============================================
  Files                  ?       28           
  Lines                  ?     2821           
  Branches               ?        0           
==============================================
  Hits                   ?     1572           
  Misses                 ?     1249           
  Partials               ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Keno
Copy link
Collaborator

Keno commented Sep 4, 2023

Only const GlobalRefs are allowed in value position, so you can take the value out and wrap it in the zero bundle and use that in value position, no needs to insert the extra call.

These are not legal to insert in-place. Thankfully, since these are just
constants anyway we can evaluate the result in-place.
@topolarity
Copy link
Contributor Author

Oh that's much better, thanks!

@oscardssmith
Copy link
Member

is this ready to merge?

@oxinabox oxinabox merged commit 91c6aa0 into JuliaDiff:kf/forcedar Sep 20, 2023
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants