]> granicus.if.org Git - llvm/commitdiff
[Attributor][NFC] Create some attributes earlier
authorJohannes Doerfert <jdoerfert@anl.gov>
Sun, 4 Aug 2019 18:40:01 +0000 (18:40 +0000)
committerJohannes Doerfert <jdoerfert@anl.gov>
Sun, 4 Aug 2019 18:40:01 +0000 (18:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367793 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/Attributor.cpp

index 45db73028dde2a1f9049b1293a8f14b09ff9b8b1..cea8cffa5c69109fcc6b49514a84a41061641766 100644 (file)
@@ -2488,6 +2488,12 @@ void Attributor::identifyDefaultAbstractAttributes(
     Function &F, InformationCache &InfoCache,
     DenseSet</* Attribute::AttrKind */ unsigned> *Whitelist) {
 
+  // Check for dead BasicBlocks in every function.
+  registerAA(*new AAIsDeadFunction(F, InfoCache));
+
+  // Every function might be "will-return".
+  registerAA(*new AAWillReturnFunction(F, InfoCache));
+
   // Every function can be nounwind.
   registerAA(*new AANoUnwindFunction(F, InfoCache));
 
@@ -2542,12 +2548,6 @@ void Attributor::identifyDefaultAbstractAttributes(
     }
   }
 
-  // Every function might be "will-return".
-  registerAA(*new AAWillReturnFunction(F, InfoCache));
-
-  // Check for dead BasicBlocks in every function.
-  registerAA(*new AAIsDeadFunction(F, InfoCache));
-
   // Walk all instructions to find more attribute opportunities and also
   // interesting instructions that might be queried by abstract attributes
   // during their initialization or update.