Details
- Reviewers
spatel craig.topper AndreiGrischenko zvi hfinkel efriedma lebedev.ri kparzysz - Commits
- rG374c27a4de76: Merging r330345:
rG82ef8e19ef1d: [InstCombine] Adjusting bswap pattern matching to hold for And/Shift mixed case
rGfbee8574ab2e: [if-converter] Handle BBs that terminate in ret during diamond conversion
rL333561: Merging r330345:
rL331257: [InstCombine] Adjusting bswap pattern matching to hold for And/Shift mixed case
rL330345: [if-converter] Handle BBs that terminate in ret during diamond conversion
Diff Detail
Event Timeline
Thanks for coming back to this. I think this patch is fine as one more match of a potential IR variant, but...
Since the time we started the discussion in D41353, there was a proposal to improve matching for ctpop and ctlz in D45173. I'm curious what others think about the fact that we match bswap/bitreverse in regular instcombine. Would it be better to match all of those intrinsics in the same place? Do we distinguish these based on how often we expect them to occur?
@opaparo Please commandeer this revision, I only took over to restore the diff that got accidentally overwritten.
I haven't seen anything. For reference, I mentioned ctpop/ctlz in the context of D45986 too, so I think we should do something to organize these optimizations, but I'm not sure what's best.
That said, I think this patch is fine as an enhancement of the existing code, so LGTM.
Sorry, I was away last week. My understanding is that the distinction between the regular and the aggressive instcombine is based on how expensive the individual transformations are. If we had an infinite computational power, everything would be included in the regular instcombine. Based on that, I think that this patch is ok as is.