When converting the switch to BitMap lookup table, its shift amount calculation is guaranteed to never overflow when deciding to use BitMap, on WouldFitInRegister.
This is part of https://reviews.llvm.org/D146903.
| Paths 
 |  Differential  D150838  
[SimplifyCFG] add nuw/nsw on BuildLookuptable BitMap shiftwidth calculation ClosedPublic Authored by khei4 on May 17 2023, 9:35 PM. 
Details Summary When converting the switch to BitMap lookup table, its shift amount calculation is guaranteed to never overflow when deciding to use BitMap, on WouldFitInRegister. This is part of https://reviews.llvm.org/D146903. 
Diff Detail 
Unit TestsFailed 
 Event TimelineHerald added subscribers: luke, • pcwang-thead, frasercrmck and 21 others.  ·  View Herald TranscriptMay 17 2023, 10:00 PM Comment Actions LGTM 
 This revision is now accepted and ready to land.May 18 2023, 7:10 AM 
 This revision was landed with ongoing or failed builds.May 18 2023, 10:17 PM Closed by commit rGe21a90f09172: [SimplifyCFG] add nuw/nsw on BuildLookuptable BitMap shiftwidth calculation (authored by khei4).  ·  Explain Why This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
Diff 523260 llvm/lib/Transforms/Utils/SimplifyCFG.cpp
 
 llvm/test/Transforms/SimplifyCFG/RISCV/switch_to_lookup_table-rv32.ll
 llvm/test/Transforms/SimplifyCFG/RISCV/switch_to_lookup_table-rv64.ll
 llvm/test/Transforms/SimplifyCFG/X86/CoveredLookupTable.ll
 llvm/test/Transforms/SimplifyCFG/X86/switch-to-lookup-large-types.ll
 llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll
 llvm/test/Transforms/SimplifyCFG/rangereduce.ll
 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Does this comply with clang-format?