-
Notifications
You must be signed in to change notification settings - Fork 12k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SimplifyCFG] Delete the unnecessary range check for small mask opera…
…tion When the small mask value little than 64, we can eliminate the checking for upper limit of the range by enlarge the lookup table size to the maximum index value. (Then the final table size grows to the next pow2 value) ``` bool f(unsigned x) { switch (x % 8) { case 0: return 1; case 1: return 0; case 2: return 0; case 3: return 1; case 4: return 1; case 5: return 0; case 6: return 1; // This would remove the range check: case 7: return 0; } return 0; } ``` Use WouldFitInRegister instead of fitsInLegalInteger to support more result type beside bool. Fixes #65120 Reviewed By: zmodem, nikic, RKSimon
- Loading branch information
Showing
2 changed files
with
30 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5e07481
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change has broken 2 stage AArch64 builds:
https://lab.llvm.org/buildbot/#/builders/176/builds/6529
https://lab.llvm.org/buildbot/#/builders/198/builds/5563
https://lab.llvm.org/buildbot/#/builders/179/builds/8212
I'll get you the reproducer from the non-sve AArch64 build as it's the simplest.
5e07481
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I see a revert already. Let me know if you still need the reproducer.
5e07481
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is great if you can help to reproduce, thanks very much
5e07481
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see anything from above link, need I request some extra right ? @DavidSpickett
5e07481
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the AArch64 reproducer: Attributor-bcec6c.zip
Same steps as the https://lab.llvm.org/buildbot/#/builders/179/builds/8212 build, but checked out at
5e07481d4240b5e8fd85f9b92df30849606c2af0
.5e07481
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can reproduce now, thanks very much