This is an archive of the discontinued LLVM Phabricator instance.

[AggressiveInstCombine][NFC] Fix typo
ClosedPublic

Authored by kitaisreal on Jul 28 2023, 9:38 AM.

Details

Summary

Fix typo in expandStrcmp method.

Diff Detail

Event Timeline

kitaisreal created this revision.Jul 28 2023, 9:38 AM
kitaisreal requested review of this revision.Jul 28 2023, 9:38 AM
goldstein.w.n added inline comments.Jul 28 2023, 10:22 AM
llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
1026

I don't really understand this, can you add a comment explaining this.

1037

Can you join the logic earlier? Imo Should be a forward declare value for the cmp result but the BR and BB propagation should be common codes.

The general alternative here is to not make AggressiveInstCombine produce better code, but rather teach something else to optimize the pattern it does produce, with the benefit that it can also help other code.

This seems like foldOpIntoPhi() for icmps should nearly handle -- I expect the problem is that we lose the fact that the icmp of the phi is false for one incoming value, because that fact is only known on the edge, while we perform simplification at the terminator of the predecessor. Adding a special case for that based on isImpliedCond should probably be sufficient to simplify this pattern.

The general alternative here is to not make AggressiveInstCombine produce better code, but rather teach something else to optimize the pattern it does produce, with the benefit that it can also help other code.

This seems like foldOpIntoPhi() for icmps should nearly handle -- I expect the problem is that we lose the fact that the icmp of the phi is false for one incoming value, because that fact is only known on the edge, while we perform simplification at the terminator of the predecessor. Adding a special case for that based on isImpliedCond should probably be sufficient to simplify this pattern.

Thanks. Improved foldOpIntoPhi() in this revision D156620.

kitaisreal updated this revision to Diff 546381.Aug 2 2023, 3:23 AM
kitaisreal retitled this revision from [AggressiveInstCombine] Fold strcmp eq, not eq operator improvements to [AggressiveInstCombine][NFC] Fix typo.
kitaisreal edited the summary of this revision. (Show Details)

Transformed this to fix typo after https://reviews.llvm.org/D156620 was landed.

Herald added a project: Restricted Project. · View Herald Transcript
kitaisreal updated this revision to Diff 546386.Aug 2 2023, 3:25 AM

Uploaded correct patch.

Can you mark the title as NFC?

Can you mark the title as NFC?

It seems that title of revision is "[AggressiveInstCombine][NFC] Fix typo". Do you mean to put NFC at the beginning ?

goldstein.w.n accepted this revision.Aug 2 2023, 12:28 PM

Can you mark the title as NFC?

It seems that title of revision is "[AggressiveInstCombine][NFC] Fix typo". Do you mean to put NFC at the beginning ?

No its good. I just can't read.
LGTM.

This revision is now accepted and ready to land.Aug 2 2023, 12:28 PM
This revision was landed with ongoing or failed builds.Aug 7 2023, 11:58 AM
This revision was automatically updated to reflect the committed changes.