From df8264c46ab1c554b2b0046122a28a40567d6b3f Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 11 Oct 2022 11:41:28 +0200 Subject: [PATCH] [SimplifyLibCalls] Use helper methods to query attributes (NFC) --- llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp index 3616186..8f25e80 100644 --- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -2515,8 +2515,7 @@ static bool isTrigLibCall(CallInst *CI) { // We can only hope to do anything useful if we can ignore things like errno // and floating-point exceptions. // We already checked the prototype. - return CI->hasFnAttr(Attribute::NoUnwind) && - CI->hasFnAttr(Attribute::ReadNone); + return CI->doesNotThrow() && CI->doesNotAccessMemory(); } static bool insertSinCosCall(IRBuilderBase &B, Function *OrigCallee, Value *Arg, -- 2.7.4