[llvm] 730414b - [CodeExtractor] Remove unnecessary explicit attribute handling (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 3 05:23:32 PST 2022


Author: Nikita Popov
Date: 2022-01-03T14:23:25+01:00
New Revision: 730414b3419e0b0124fa1f683ca904640727d455

URL: https://github.com/llvm/llvm-project/commit/730414b3419e0b0124fa1f683ca904640727d455
DIFF: https://github.com/llvm/llvm-project/commit/730414b3419e0b0124fa1f683ca904640727d455.diff

LOG: [CodeExtractor] Remove unnecessary explicit attribute handling (NFC)

The nounwind and uwtable attributes will get handled as part of
the loop below as well, there is no need to special-case them here.

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/CodeExtractor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
index 4669f4bb4a18..f577643f81b0 100644
--- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
@@ -871,13 +871,6 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs,
   Function *newFunction = Function::Create(
       funcType, GlobalValue::InternalLinkage, oldFunction->getAddressSpace(),
       oldFunction->getName() + "." + SuffixToUse, M);
-  // If the old function is no-throw, so is the new one.
-  if (oldFunction->doesNotThrow())
-    newFunction->setDoesNotThrow();
-
-  // Inherit the uwtable attribute if we need to.
-  if (oldFunction->hasUWTable())
-    newFunction->setHasUWTable();
 
   // Inherit all of the target dependent attributes and white-listed
   // target independent attributes.


        


More information about the llvm-commits mailing list