[PATCH] D106299: [Local] Flag to decide if a trap should be placed before unreachable

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 19 12:06:03 PDT 2021


jdoerfert created this revision.
jdoerfert added reviewers: RKSimon, lebedev.ri, nikic.
Herald added subscribers: ormris, lxfind, okura, kuter, zzheng, bollu, hiraditya.
jdoerfert requested review of this revision.
Herald added a reviewer: sstefan1.
Herald added subscribers: bbn, sstefan1.
Herald added a reviewer: baziotis.
Herald added a project: LLVM.

Before we used "custom heuristics" to determine if a newly placed
unreachable should be preceded by a trap (`llvm.trap`) or not. This was
undesirable for multiple reasons, mainly it causes traps where we might
really want to avoid them (GPU targets), and it didn't allow to insert
more traps with proper debug information for debugging. The new scheme
allows the user to overwrite the standard "context decision" and force
or disallow traps instead.

This patch should not change the behavior on it's own but just provide
more options. The plan is to update the default for OpenMP GPU targets.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106299

Files:
  llvm/include/llvm/Transforms/Utils/Local.h
  llvm/lib/CodeGen/WinEHPrepare.cpp
  llvm/lib/Transforms/Coroutines/CoroSplit.cpp
  llvm/lib/Transforms/Coroutines/Coroutines.cpp
  llvm/lib/Transforms/IPO/Attributor.cpp
  llvm/lib/Transforms/IPO/PruneEH.cpp
  llvm/lib/Transforms/Scalar/SCCP.cpp
  llvm/lib/Transforms/Utils/InlineFunction.cpp
  llvm/lib/Transforms/Utils/Local.cpp
  llvm/lib/Transforms/Utils/LoopSimplify.cpp
  llvm/lib/Transforms/Utils/LoopUnroll.cpp
  llvm/lib/Transforms/Utils/LoopUtils.cpp
  llvm/test/Transforms/SimplifyCFG/assume.ll
  llvm/test/Transforms/SimplifyCFG/trapping-load-unreachable.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106299.359874.patch
Type: text/x-patch
Size: 15679 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210719/6f0ccd58/attachment.bin>


More information about the llvm-commits mailing list