[llvm] [SimplifyCFG] Supporting hoisting/sinking callbases with differing attrs (PR #109472)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 08:31:45 PDT 2024


================
@@ -1591,10 +1591,150 @@ static void hoistLockstepIdenticalDbgVariableRecords(
   }
 }
 
+// See if we can intersect the attributes for two callbases (used for
+// hoisting/sinking).
+static std::optional<AttributeList> tryIntersectAttrs(const CallBase *CB0,
+                                                      const CallBase *CB1) {
----------------
goldsteinn wrote:

Agreed these aren't really relevant to a call-site, but there is nothing correctness related to dropping `optnone` is there? So AFAICT the only argument against `optnone` being dropable is related to "would we want to?" which is based on the usage, hence having the code in simplifycfg where we can actually answer that question. But like you said, its not too difficult to have add a profitability check in the API.

https://github.com/llvm/llvm-project/pull/109472


More information about the llvm-commits mailing list