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

Also update phi counts in adce pass #47181

Merged
merged 1 commit into from
Oct 17, 2022
Merged

Also update phi counts in adce pass #47181

merged 1 commit into from
Oct 17, 2022

Conversation

Keno
Copy link
Member

@Keno Keno commented Oct 16, 2022

The whole point of this pass is to compute and compare the counts of all SSA value uses vs those of only-phi uses to find SSA values that have no real uses. In #47080, I updated the code to properly account for removal of phi edges in the SSA count, but neglected to do the same in the phi-only count, leading to #47180. Fix that.

Fixes #47180

The whole point of this pass is to compute and compare the
counts of all SSA value uses vs those of only-phi uses to
find SSA values that have no real uses. In #47080, I updated
the code to properly account for removal of phi edges in
the SSA count, but neglected to do the same in the phi-only
count, leading to #47180. Fix that.

Fixes #47180
Comment on lines +1096 to +1104
# Issue #47180, incorrect phi counts in CmdRedirect
function a47180(b; stdout )
c = setenv(b, b.env)
if true
c = pipeline(c, stdout)
end
c
end
@test isa(a47180(``; stdout), Base.AbstractCmd)
Copy link
Contributor

@giordano giordano Oct 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For what is worth, by playing a bit more with creduce (more specifically, searching for "TypeError: in new" instead of the full message "TypeError: in new, expected Base.AbstractCmd, got a value of type Nothing", to give it more freedom) I've got a marginally simpler reproducer:

julia> function a(b)
           c = setenv(``, b.env)
           if true
               c = (c, )
           end
           c
       end
a (generic function with 1 method)

julia> a(``)
ERROR: TypeError: in new, expected Cmd, got a value of type Nothing
Stacktrace:
 [1] a(b::Cmd)
   @ Main ./REPL[1]:4
 [2] top-level scope
   @ REPL[2]:1
Suggested change
# Issue #47180, incorrect phi counts in CmdRedirect
function a47180(b; stdout )
c = setenv(b, b.env)
if true
c = pipeline(c, stdout)
end
c
end
@test isa(a47180(``; stdout), Base.AbstractCmd)
# Issue #47180, incorrect phi counts in Cmd
function a47180(b)
c = setenv(``, b.env)
if true
c = (c, )
end
c
end
@test isa(a47180(``), Tuple{Cmd})

@Keno Keno merged commit c2dfe1d into master Oct 17, 2022
@Keno Keno deleted the kf/47180 branch October 17, 2022 00:16
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.

CmdRedirect constructor throwing TypeError
2 participants