-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[InstCombine] Instruction sink doesn't see through sink opportunities from bb0
to bb2
in bb0->bb1->bb2
#88960
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
Comments
|
@nikic @goldsteinn @dtcxzyw @vfdff To optimize the second function ( InstCombinerImpl::tryToSinkInstruction handles the sink of instructions and debug info pretty well. May I get your thoughts on moving the core logic into a standalone util library for re-use in other optimizer passes?
|
@minglotus-6 I don't really understand what you're proposing, but the most likely answer to this is going to be "no" -- we have about reached (or even exceeded) what we can do with ad-hoc sinking, as opposed to a dedicated sinking pass. |
@nikic Many thanks for the response! I'd like to make InstCombinerImpl::trySinkInstruction and its two callee functions (tryToSinkInstructionDbgValues and tryToSinkInstructionDbgVariableRecords) a utility function. This way, other passes can re-use the utility to sink instructions, without forking off the core logic of My main question is, what do you think of extracting As an example use case, say
[1] As you may well already know, it conditionally devirtualizes a function calls
[3]
[4]
[5]
|
see https://gcc.godbolt.org/z/G7Paj7h37 for two test cases.
@inst_sink
, the two instructions (load
,icmp
) in the entry block sink to the block where it is used.@inst_not_sink
, the two instructions stay in the entry block although they are used only inif.false.orig_indirect2
The text was updated successfully, but these errors were encountered: