This is an alternative to D91343. I do not have stats for how often the shl+ashr pattern (sext-in-reg) occurs, but we have an SDAG node for that operation, so it seems common enough to warrant a dedicated fold for this pattern:
https://rise4fun.com/Alive/vI9
Details
Details
- Reviewers
lebedev.ri craig.topper Bhramar.vatsa
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I mildly prefer the other approach (D91343), because it doesn't hardcode the and instruction.
Comment Actions
Right, that's more flexible with potentially more compute known bits cost.
@Bhramar.vatsa - I committed the baseline tests shown here with 8a1e636. Please update/rebase your patch and confirm that you get the same diffs. I think you can reduce the code a bit too based on the match code shown here.
Comment Actions
Ack.
But i think the pattern isn't *that* common, i would be surprised if this fires more than ~1k times as of vanilla test-suite.
@Bhramar.vatsa - I committed the baseline tests shown here with 8a1e636. Please update/rebase your patch and confirm that you get the same diffs. I think you can reduce the code a bit too based on the match code shown here.