[llvm] a7425e2 - OpenMPOpt: Use getFnAttributeAsParsedInteger
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 3 08:40:47 PST 2023
Author: Matt Arsenault
Date: 2023-01-03T11:40:42-05:00
New Revision: a7425e299e9ff8cee9290cb6ffeb5fd056e77b87
URL: https://github.com/llvm/llvm-project/commit/a7425e299e9ff8cee9290cb6ffeb5fd056e77b87
DIFF: https://github.com/llvm/llvm-project/commit/a7425e299e9ff8cee9290cb6ffeb5fd056e77b87.diff
LOG: OpenMPOpt: Use getFnAttributeAsParsedInteger
Added:
Modified:
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
index f752ff818cf0..84469ea76aba 100644
--- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -4710,10 +4710,7 @@ struct AAFoldRuntimeCallCallSiteReturned : AAFoldRuntimeCall {
// Iterate over the kernels that reach this function
for (Kernel K : CallerKernelInfoAA.ReachingKernelEntries) {
- int32_t NextAttrVal = -1;
- if (K->hasFnAttribute(Attr))
- NextAttrVal =
- std::stoi(K->getFnAttribute(Attr).getValueAsString().str());
+ int32_t NextAttrVal = K->getFnAttributeAsParsedInteger(Attr, -1);
if (NextAttrVal == -1 ||
(CurrentAttrValue != -1 && CurrentAttrValue != NextAttrVal))
More information about the llvm-commits
mailing list