[PATCH] D94893: [SimplifyCFG] Freeze the extra condition when optimizing to switch

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 17 21:02:27 PST 2021


aqjune created this revision.
aqjune added reviewers: nikic, lebedev.ri.
Herald added a subscriber: hiraditya.
aqjune requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

As discussed in D93943 <https://reviews.llvm.org/D93943>, this patch fixes the UB issue by freezing the extra condition when optimizing
`if(extracond || X == C1 || X == C2 || ...) ` into `if(extracond) { switch(X) { .. } }`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94893

Files:
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/Transforms/SimplifyCFG/switch_create-custom-dl.ll
  llvm/test/Transforms/SimplifyCFG/switch_create.ll
  llvm/test/Transforms/SimplifyCFG/switch_msan.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94893.317265.patch
Type: text/x-patch
Size: 10902 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210118/70e41bcd/attachment.bin>


More information about the llvm-commits mailing list