[PATCH] D146903: (WIP)[SimplifyCFG] add nuw/nsw on SwitchToLookupTable

Kohei Asano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 26 02:24:32 PDT 2023


khei4 created this revision.
khei4 added a reviewer: nikic.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
khei4 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This is the first step to resolving the following issue, no-wrap flags on switch removal. 
https://github.com/llvm/llvm-project/issues/59671

goal transformation: https://alive2.llvm.org/ce/z/GZs_dj

1. add nuw/nsw on SimplifyCFG on the cases. (to be considered) <- this revision will be

transformation: https://alive2.llvm.org/ce/z/qgMkdU

2. preserve nuw/nsw on InstCombine on the cases(to be considered)

transformation: https://alive2.llvm.org/ce/z/yMvjfr

TODO: Need to elaborate on the condition for both to add nuw/nsw.


https://reviews.llvm.org/D146903

Files:
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/Transforms/PhaseOrdering/X86/merge-functions.ll
  llvm/test/Transforms/PhaseOrdering/X86/simplifycfg-late.ll
  llvm/test/Transforms/SimplifyCFG/X86/CoveredLookupTable.ll
  llvm/test/Transforms/SimplifyCFG/X86/disable-lookup-table.ll
  llvm/test/Transforms/SimplifyCFG/X86/switch-covered-bug.ll
  llvm/test/Transforms/SimplifyCFG/X86/switch-table-bug.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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146903.508391.patch
Type: text/x-patch
Size: 19971 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230326/e80fa0e0/attachment.bin>


More information about the llvm-commits mailing list