[PATCH] D53554: [Argument Promotion] Only promote args when function attributes are compatible

Eric Christopher via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 14:30:46 PST 2018


echristo added inline comments.


================
Comment at: lib/Transforms/IPO/ArgumentPromotion.cpp:813
+/// Test that there are no attribute conflicts between Caller and Callee
+static bool functionsHaveCompatibleAttributes(const CallSite &CS,
+                                              const TargetTransformInfo &TTI) {
----------------
tstellar wrote:
> echristo wrote:
> > Seems like we should expose this on TTI and that way backends can override and keep a single copy between here and InlineCost.cpp.
> These are the only callers of TTI.areInlineCompatible().  Should we just roll it into that or create something new like?  Also, eventually won't we want different call-backs for InlineCost and ArgumentPromotion?
I'd be more inclined to go with a TTI::functionsHaveCompatibleAttributes that wraps the existing behavior.

And that's a good question. I think the answer is probably, but keep in mind that areInlineCompatible is already pulled out for X86.

Mostly I'd like to avoid the same static function duplicated - at that point let's just move the whole thing to TTI and then figure out the best way of specializing per target?


Repository:
  rL LLVM

https://reviews.llvm.org/D53554





More information about the llvm-commits mailing list