Add a routine to TargetTransformInfo that will allow targets to look
[oota-llvm.git] / include / llvm / Analysis / TargetTransformInfoImpl.h
index e6a8a769082061daabcb2fd26dc3f2e2ae15396b..403175acae0281f3645a0b19034c79013d5f0b33 100644 (file)
@@ -335,6 +335,14 @@ public:
                                            Type *ExpectedType) {
     return nullptr;
   }
+
+  bool hasCompatibleFunctionAttributes(const Function *Caller,
+                                       const Function *Callee) const {
+    return (Caller->getFnAttribute("target-cpu") ==
+            Callee->getFnAttribute("target-cpu")) &&
+           (Caller->getFnAttribute("target-features") ==
+            Callee->getFnAttribute("target-features"));
+  }
 };
 
 /// \brief CRTP base class for use as a mix-in that aids implementing