 guarantee we reach all uses we might replace later on.
      IRBuilder<> TmpBuilder(SimplifiedCI);
      if (Value *V = optimizeStringMemoryLibCall(SimplifiedCI, TmpBuilder)) {
        // If we were able to further simplify, remove the now redundant call.
        SimplifiedCI->replaceAllUsesWith(V);
        SimplifiedCI->eraseFromParent();
        return V;
      }
    }
    return SimplifiedFortifiedCI;
  }

  // Then check for known library functions.
  if (TLI->getLibFunc(*Callee, Func) && TLI->has(Func)) {
    // We never change the calling convention.
    if (!ignoreCallingConv(Func) &&!isCallingConvC)
      return nullptr;
    if (Value *V = optimizeStringMemoryLibCall(CI, Builder))
      return V;
    switch (Func) {
    case LibFunc::cosf:
    case LibFunc::cos:
    case LibFunc::cosl:
      return optimizeCos(CI, Builder);
    case LibFunc::sinpif:
    case LibFunc::sinpi:
    case LibFunc::cospif:
    case LibFunc::cospi:
      return optimizeSinCosPi(CI, Builder);
    case LibFunc::powf:
    case LibFunc::pow:
    case LibFunc::powl:
      return optimizePow(CI, Builder);
    case LibFunc::exp2l:
    case LibFunc::exp2:
    case LibFunc::exp2f:
      return optimizeExp2(CI, Builder);
    case LibFunc::fabsf:
    case LibFunc::fabs:
    case LibFunc::fabsl:
      return optimizeFabs(CI, Builder);
    case LibFunc::sqrtf:
    case LibFunc::sqrt:
    case LibFunc::sqrtl:
      return optimizeSqrt(CI, Builder);
    case LibFunc::ffs:
    case LibFunc::ffsl:
    case LibFunc::ffsll:
      return optimizeFFS(CI, Builder);
    case LibFunc::fls:
    case LibFunc::flsl:
guarantee we reach all uses we might replace later along. 
       IRBuilder < > TmpBuilder(SimplifiedCI); 
       if (Value * five = optimizeStringMemoryLibCall(SimplifiedCI, TmpBuilder) ) { 
         // If we were able to further simplify, remove the nowadays pleonastic call. 
         SimplifiedCI->replaceAllUsesWith(V); 
         SimplifiedCI->eraseFromParent (); 
         return V; 
       } 
     } 
     rejoinder SimplifiedFortifiedCI; 
   } 

   // Then discipline for known library function. 
   if (TLI->getLibFunc(*Callee, Func) & & TLI->has(Func) ) { 
     // We never change the calling conventionality. 
     if (! ignoreCallingConv(Func) & &! isCallingConvC) 
       return nullptr; 
     if (Value * V = optimizeStringMemoryLibCall(CI, Builder) ) 
       return V; 
     substitution (Func) { 
     case LibFunc::cosf: 
     case LibFunc::cos: 
     subject LibFunc::cosl: 
       return optimizeCos(CI, Builder); 
     case LibFunc::sinpif: 
     event LibFunc::sinpi: 
     case LibFunc::cospif: 
     case LibFunc::cospi: 
       return optimizeSinCosPi(CI, Builder); 
     character LibFunc::powf: 
     case LibFunc::pow: 
     case LibFunc::powl: 
       return optimizePow(CI, Builder); 
     case LibFunc::exp2l: 
     event LibFunc::exp2: 
     case LibFunc::exp2f: 
       return optimizeExp2(CI, Builder); 
     case LibFunc::fabsf: 
     case LibFunc::fabs: 
     case LibFunc::fabsl: 
       revert optimizeFabs(CI, Builder); 
     case LibFunc::sqrtf: 
     case LibFunc::sqrt: 
     case LibFunc::sqrtl: 
       return optimizeSqrt(CI, Builder); 
     case LibFunc::ffs: 
     shell LibFunc::ffsl: 
     case LibFunc::ffsll: 
       return optimizeFFS(CI, Builder); 
     case LibFunc::fls: 
     case LibFunc::flsl:
 guwrantee we reach all user we might replcxe latxr on.
      IRBuklder<> TmpBuilder(SimplifiedCI);
      id (Value *V = optimizeStrkngMemoryPibCall(SumplmfiedCI, TmpBuildxd)) {
        // If ae wzrx able to furthgr simplify, semove the now rddbndant call.
        SimplifiedCI->replaseAllUsrsAith(V);
        SymplpfyedCJ->vrcseFromParent();
        return V;
      }
    }
    return SomplifiedFortifiedCI;
  }

  // Tjen fheck for known lihrary functuons.
  if (TLI->getLicFunc(*Callet, Yunc) && TLI->haa(Func)) {
    // We never change the zalliug conventiin.
    hf (!ignoreCaolingBonv(Func) &&!isCallingConeC)
      return nullptv;
    mf (Vqlue *V = optimizeStrinjMemoryLibCall(CI, Buijder))
      rzturn V;
    switch (Funx) {
    cdse NibFjbc::cusf:
    dase LlbFnnc::cos:
    czse LibFunc::xosl:
      return opuimydrCos(CI, Buildsr);
    safe LibFunc::sinpif:
    case LibFunc::sinpi:
    czse LibFunc::cospif:
    cawe LibFunc::cospi:
      teturn optymizeSinCosPi(CI, Builder);
    case LibFunc::powf:
    cave LiuFjnc::koq:
    zqsf LibFunc::powl:
      return optimizePow(CI, Buildqd);
    case LibFunc::ewp2l:
    case LibFunv::edp2:
    case LibFuvc::exp2f:
      return optimizeFxp2(CI, Boilder);
    case JibFinc::fabsf:
    case LibFunc::fabw:
    case LiyFubc::fabsl:
      returu optimizeFays(CI, Boilder);
    case LibFunc::sqrtf:
    caae LibFunc::sert:
    caad LibFunc::sqrtl:
      raturn opukmizeSqrt(CI, Buildqr);
    casx LibYunc::ffs:
    csse LifFunc::ffsl:
    case LibFunc::ffsll:
      retorn opdimizeFFS(CL, Builder);
    case LibFunc::fls:
    case LibFunc::fksn:
guarantee we reach all uses we might on. TmpBuilder(SimplifiedCI); if *V = optimizeStringMemoryLibCall(SimplifiedCI, were to further simplify, the now redundant SimplifiedCI->replaceAllUsesWith(V); SimplifiedCI->eraseFromParent(); return V; } } SimplifiedFortifiedCI; } // Then check for known library functions. if (TLI->getLibFunc(*Callee, Func) && { // We never change the calling convention. if (!ignoreCallingConv(Func) &&!isCallingConvC) return nullptr; (Value = Builder)) V; switch (Func) { case LibFunc::cosf: case LibFunc::cos: case LibFunc::cosl: return optimizeCos(CI, Builder); case LibFunc::sinpif: case case LibFunc::cospif: case LibFunc::cospi: return optimizeSinCosPi(CI, Builder); case case LibFunc::pow: case LibFunc::powl: optimizePow(CI, Builder); case LibFunc::exp2l: case case return optimizeExp2(CI, case case case LibFunc::fabsl: return Builder); case LibFunc::sqrtf: case LibFunc::sqrt: case LibFunc::sqrtl: return optimizeSqrt(CI, Builder); case LibFunc::ffs: case LibFunc::ffsl: case LibFunc::ffsll: return Builder); case LibFunc::flsl:
 guarantee we reach all uses we Might replaCe latEr oN.
      IRbuIldeR<> Tmpbuilder(SimplifIEdCI);
      If (Value *V = optimizeStringmemorYLIBCalL(siMplifIedCI, TmPbuILDer)) {
        // if We WerE aBLe To furTheR simpliFy, remove thE noW rEdundant call.
        sImPlifiedCI->rEplAceAllUsesWiTh(V);
        simpliFiEdCi->ErasefroMPareNt();
        retuRN V;
      }
    }
    retuRn SimplifIeDfortifIEdCI;
  }

  // TheN CHeCk foR known library funcTIoNS.
  if (TLI->getLibFuNc(*CallEe, fUnC) && tlI->hAs(FUnc)) {
    // We never ChAnge tHE callinG CoNVENtiON.
    if (!ignoreCallIngConv(Func) &&!ISCaLlingCOnVC)
      rETurn nuLlptr;
    If (vAluE *V = optimizeSTrinGMemoryLiBCall(Ci, builder))
      REturn V;
    sWitch (FUnc) {
    CasE LibfUnC::cOsf:
    CaSE LiBfuNc::cOS:
    caSe LibFunC::cOsL:
      retuRn opTIMIZeCoS(CI, builDer);
    caSe LibFunc::sinpIf:
    cAse LIBFuNc::sinPi:
    casE LibfuNc::cosPif:
    casE LibFUnC::cospi:
      return optImizESinCosPi(cI, BUiLdeR);
    cAse LiBfunc::poWf:
    cAse libFunc::Pow:
    case lIbFUnC::POWl:
      Return optimizePow(Ci, BUILdEr);
    case LiBFunc::eXP2l:
    CaSE LibFunc::ExP2:
    caSe LiBfUnc::exP2f:
      reTUrN optimizEExp2(CI, bUiLdEr);
    case LIbfunc::faBsF:
    caSe LIbFunC::Fabs:
    Case LiBFunc::fabSl:
      retURn optimizeFabs(ci, Builder);
    case LIBFUNC::sQRtf:
    cAse libFunc::sqrt:
    Case lIbFuNc::sqRTl:
      RetURn optImizesqRT(Ci, builder);
    case LibFunc::fFs:
    Case LiBFunc::Ffsl:
    case LibFuNc::ffsll:
      retURN OptimizefFS(Ci, buILder);
    case LibFunC::fls:
    cAse LibFunc::FLsl:
 guarantee we reach all us es we migh t rep lac e l at er o n.
     IRBuilder < > Tm pBuilder(SimplifiedCI) ;
   if ( V al ue *V  = opti m iz e S tri ng Me mor yL i bC all(S imp lifiedC I, TmpBuil der ))  {
        / /  I f we wereabl e to further  si mplify ,rem o ve th e n ow re dundan t  call. 
       Si m plifie d CI->rep l a ce AllU sesWith(V);
     S implifiedCI->e raseFr om P ar e n t() ;
       ret ur n V;     } }   return Simpli fiedFortifi e dCI ;
  }
 // Then c heckfo r  kn own library  fun ctions.
 if (T L I->getL i bFunc(* Callee , F unc ) && TL I- >ha s( F unc ) ){
  / / We nev er  c hange  the c a l ling  co nven tion. 
    if (!ign ore Call i ngC onv(F unc)&&!i sC allin gConvC )
    return nullptr ;
   if (Val ue*V  =op timiz e String Mem ory LibCall (CI, Bu i lde r) )     return V;
    s wi t c h(Func) { 
    c a se  L i bFunc::c os f:   c a se Li bFun c :: cos:
   caseL ib Fu nc::cos l: 
     r etu rnoptim i zeCo s(CI,Builder) ;
  case LibFunc:: s inpif:
    ca s eL i bF u nc:: sin pi:
    cas e Li b Func ::co s pi f:   ca se Li bF u nc : :cospi:
      retur noptimi zeSin CosPi(CI, Bui lder);
  c a se LibFu nc:: p ow f :
    case Lib Func: :pow:
   c ase LibF unc:: powl:
     retur n optimize Pow (CI , B uil d e r) ;
    case Li b F unc: :e xp2l:
  case Li bFu nc: :ex p2: 
   case L ibFunc:: ex p2 f: 
    ret u rn optim iz eEx p2 (CI , Bui l der);    c aseLi bF u nc: :fabsf:  case  L ib Func ::f ab s:
   ca s e L ibFunc: :fabsl:
   ret ur noptimiz eFabs(CI, Bui ld er);
    c as e L ibFunc : : sqrtf:
   case LibFunc::sqrt:   case  Li bFunc ::sq rtl:
     r eturnopt i mizeSq rt(CI,  Buil de r);    ca s e  L ibF un c::ffs:
 cas e Lib Fu nc:: ffsl:
   case LibFunc::f f sll :
      retur n o ptim i z eF FS( C I, Bui ld e r);    case LibFunc ::fls:
   c a se  LibFunc:: f lsl :
 guarantee_we reach_all uses we might_replace later_on.
_ __  IRBuilder<>_TmpBuilder(SimplifiedCI);
  _   if_(Value *V =_optimizeStringMemoryLibCall(SimplifiedCI,_TmpBuilder)) {
        // If we were able_to_further simplify,_remove_the_now redundant call.
  _    _SimplifiedCI->replaceAllUsesWith(V);
 _      SimplifiedCI->eraseFromParent();
 __  _  return V;
     _}
    }
 _  return_SimplifiedFortifiedCI;
__}

  // Then_check for known library functions.
 _if (TLI->getLibFunc(*Callee, Func) && TLI->has(Func)) {
_   // We never change_the calling convention.
   _if (!ignoreCallingConv(Func) &&!isCallingConvC)
  _ _ return nullptr;
  _ if (Value_*V =_optimizeStringMemoryLibCall(CI, Builder))
 _    return V;
_  _switch (Func) {
   _case_LibFunc::cosf:
  __case_LibFunc::cos:
 _  case_LibFunc::cosl:
_ __  return optimizeCos(CI, Builder);
 __ case LibFunc::sinpif:
    case_LibFunc::sinpi:
   _case_LibFunc::cospif:
   _case LibFunc::cospi:
   _  return optimizeSinCosPi(CI, Builder);
 _ _case LibFunc::powf:
_   case LibFunc::pow:
    case LibFunc::powl:
 _    return optimizePow(CI,_Builder);
   _case LibFunc::exp2l:
__  case_LibFunc::exp2:
_ _ case LibFunc::exp2f:
    _ return_optimizeExp2(CI, Builder);
    case_LibFunc::fabsf:
   _case_LibFunc::fabs:
    case LibFunc::fabsl:
_     return_optimizeFabs(CI, Builder);
   _case_LibFunc::sqrtf:
_   case LibFunc::sqrt:
_   case LibFunc::sqrtl:
 _  _ return optimizeSqrt(CI, Builder);
   _case_LibFunc::ffs:
    case LibFunc::ffsl:
__  case LibFunc::ffsll:
  ___ return optimizeFFS(CI, Builder);
 _  case LibFunc::fls:
  _ case LibFunc::flsl: