[llvm] [TLI] Add support for inferring attr `cold`/`noreturn` on `std::terminate` and `__cxa_throw` (PR #101622)

Evgenii Kudriashov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 13:59:01 PDT 2024


================
@@ -66,6 +67,14 @@ static bool setIsCold(Function &F) {
   return true;
 }
 
+static bool setNoReturn(Function &F) {
+  if (F.hasFnAttribute(Attribute::NoReturn))
----------------
e-kud wrote:

Wouldn't it better to use `F.doesNotReturn()` and `setDoesNotReturn` as it is in `setDoesNotAccessMemory` instead of checking attributes explicitly? And rename to `setDoesNotReturn` probably...

https://github.com/llvm/llvm-project/pull/101622


More information about the llvm-commits mailing list