[PATCH] D83906: [CodeGen] Emit a call instruction instead of an invoke if the called llvm function is marked nounwind

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 15 14:11:24 PDT 2020


ahatanak created this revision.
ahatanak added reviewers: vsk, rjmccall, ABataev.
ahatanak added a project: clang.
Herald added subscribers: ributzka, dexonsmith, jkorous.

This fixes cases where an invoke is emitted, despite the called llvm function being marked nounwind, because `CodeGenModule::ConstructAttributeList` failed to add the attribute to the attribute list. llvm optimization passes turn invokes into calls and optimize away the exception handling code, but it's better to avoid emitting the code in the front-end if the called function is known not to raise an exception.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83906

Files:
  clang/lib/CodeGen/CGCall.cpp
  clang/test/CodeGenCXX/debug-info-class.cpp
  clang/test/CodeGenObjCXX/arc-list-init-destruct.mm
  clang/test/CodeGenObjCXX/os_log.mm
  clang/test/OpenMP/atomic_codegen.cpp
  clang/test/OpenMP/critical_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp
  clang/test/OpenMP/distribute_parallel_for_simd_num_threads_codegen.cpp
  clang/test/OpenMP/for_codegen.cpp
  clang/test/OpenMP/for_simd_codegen.cpp
  clang/test/OpenMP/master_codegen.cpp
  clang/test/OpenMP/parallel_for_codegen.cpp
  clang/test/OpenMP/parallel_for_simd_codegen.cpp
  clang/test/OpenMP/parallel_master_codegen.cpp
  clang/test/OpenMP/parallel_num_threads_codegen.cpp
  clang/test/OpenMP/parallel_sections_codegen.cpp
  clang/test/OpenMP/sections_codegen.cpp
  clang/test/OpenMP/simd_codegen.cpp
  clang/test/OpenMP/single_codegen.cpp
  clang/test/OpenMP/taskgroup_codegen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83906.278298.patch
Type: text/x-patch
Size: 9759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200715/4416fa5d/attachment.bin>


More information about the cfe-commits mailing list