@@ -416,9 +416,9 @@ static bool compareFnAttributes(const CodeGenIntrinsic *L,
416416 auto TieBoolAttributes = [](const CodeGenIntrinsic *I) -> auto {
417417 // Sort throwing intrinsics after non-throwing intrinsics.
418418 return std::tie (I->canThrow , I->isNoDuplicate , I->isNoMerge , I->isNoReturn ,
419- I->isNoCallback , I->isNoSync , I->isNoFree , I->isWillReturn ,
420- I->isCold , I->isConvergent , I->isSpeculatable ,
421- I->hasSideEffects , I->isStrictFP );
419+ I->isNoRecurse , I->isNoCallback , I->isNoSync , I->isNoFree ,
420+ I->isWillReturn , I->isCold , I->isConvergent ,
421+ I->isSpeculatable , I-> hasSideEffects , I->isStrictFP );
422422 };
423423
424424 auto TieL = TieBoolAttributes (L);
@@ -440,10 +440,11 @@ static bool compareFnAttributes(const CodeGenIntrinsic *L,
440440// / NoUnwind = !canThrow, so we need to negate it's sense to test if the
441441// intrinsic has NoUnwind attribute.
442442static bool hasFnAttributes (const CodeGenIntrinsic &Int) {
443- return !Int.canThrow || Int.isNoReturn || Int.isNoCallback || Int.isNoSync ||
444- Int.isNoFree || Int.isWillReturn || Int.isCold || Int.isNoDuplicate ||
445- Int.isNoMerge || Int.isConvergent || Int.isSpeculatable ||
446- Int.isStrictFP || getEffectiveME (Int) != MemoryEffects::unknown ();
443+ return !Int.canThrow || Int.isNoReturn || Int.isNoRecurse ||
444+ Int.isNoCallback || Int.isNoSync || Int.isNoFree || Int.isWillReturn ||
445+ Int.isCold || Int.isNoDuplicate || Int.isNoMerge || Int.isConvergent ||
446+ Int.isSpeculatable || Int.isStrictFP ||
447+ getEffectiveME (Int) != MemoryEffects::unknown ();
447448}
448449
449450namespace {
@@ -572,6 +573,8 @@ static AttributeSet getIntrinsicFnAttributeSet(LLVMContext &C, unsigned ID) {
572573 addAttribute (" NoUnwind" );
573574 if (Int.isNoReturn )
574575 addAttribute (" NoReturn" );
576+ if (Int.isNoRecurse )
577+ addAttribute (" NoRecurse" );
575578 if (Int.isNoCallback )
576579 addAttribute (" NoCallback" );
577580 if (Int.isNoSync )
0 commit comments