This is an archive of the discontinued LLVM Phabricator instance.

[DAG] SimplifyDemandedBits - ISD::OR - attempt to simplify Op1 again once we have KnownBits from Op0
AbandonedPublic

Authored by RKSimon on May 21 2022, 5:49 AM.

Details

Reviewers
foad
craig.topper
Summary

We already use the KnownBits of Op1 (which is more likely to be a constant) to improve the demanded bits of Op0. But we can repeat the process back on Op1 again if the demanded bits have further improved.

Something else I noticed while investigating D125836 and D77804....

Diff Detail

Event Timeline

RKSimon created this revision.May 21 2022, 5:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2022, 5:49 AM
RKSimon requested review of this revision.May 21 2022, 5:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2022, 5:49 AM
RKSimon edited the summary of this revision. (Show Details)May 21 2022, 5:50 AM

Digging back through the history here, it looks like the two test cases here were explicitly broken by D116270 which prevented the OR from reassociating the constant to the outer OR.

I'm not necessarily opposed to this patch. I'm just not sure these test changes are the right demonstration of it. Does it help with other cases after the patches you mentioned?

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
1421

Needs to be indented 1 more space

llvm/test/CodeGen/AMDGPU/permute.ll
194

This doesn't match what comes out of instcombine, and with the instcombine version we already get v_perm

RKSimon planned changes to this revision.May 21 2022, 2:02 PM

No it doesn't specifically help the UXTB regression that I'm still chasing - it was just one of the things I tried.

I'll leave this on hold for now.

foad added a subscriber: alex-t.Jun 13 2022, 2:04 AM

Digging back through the history here, it looks like the two test cases here were explicitly broken by D116270 which prevented the OR from reassociating the constant to the outer OR.

@alex-t FYI.

RKSimon abandoned this revision.Jul 6 2023, 9:18 AM