Index: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp =================================================================== --- llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -2099,6 +2099,7 @@ Module *M = Pow->getModule(); bool AllowApprox = Pow->hasApproxFunc(); bool Ignored; + AttributeList Attrs; // Attributes are only meaningful on the original call // Propagate the math semantics from the call to any created instructions. IRBuilderBase::FastMathFlagGuard Guard(B); @@ -2160,8 +2161,7 @@ return nullptr; ExpoF = &ExpoI; - Sqrt = getSqrtCall(Base, Pow->getCalledFunction()->getAttributes(), - Pow->doesNotAccessMemory(), M, B, TLI); + Sqrt = getSqrtCall(Base, Attrs, Pow->doesNotAccessMemory(), M, B, TLI); if (!Sqrt) return nullptr; }