[PATCH] D101228: [InlineCost] CallAnalyzer: use TTI info for extractvalue - they are free (PR50099)

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 24 12:42:32 PDT 2021


aeubanks added inline comments.


================
Comment at: llvm/lib/Analysis/InlineCost.cpp:1773
+  // Usually `extractvalue` is modelled as free.
+  if (TTI.getUserCost(&I, TargetTransformInfo::TCK_SizeAndLatency) ==
+      TargetTransformInfo::TCC_Free)
----------------
lebedev.ri wrote:
> xbolva00 wrote:
> > Just question: this check is also in visitInstruction so maybe you can just return visitInstruction(I)?
> Not really, they have different side-effects.
do you mean the `disableSROA`? shouldn't that be happening anyway? or else we should handle SROA for extractvalue.


================
Comment at: llvm/lib/Analysis/InlineCost.cpp:1787
 
 bool CallAnalyzer::visitInsertValue(InsertValueInst &I) {
   // Constant folding for insert value is trivial.
----------------
should we do the same for insertvalue?


================
Comment at: llvm/test/Transforms/Inline/X86/extractvalue.ll:1
+; RUN: opt < %s -inline -inline-threshold=0 -debug-only=inline-cost -print-instruction-comments -S -mtriple=x86_64-unknown-linux-gnu 2>&1 | FileCheck %s
+; RUN: opt < %s -passes='cgscc(inline)' -inline-threshold=0 -debug-only=inline-cost -print-instruction-comments -S -mtriple=x86_64-unknown-linux-gnu 2>&1 | FileCheck %s
----------------
can the first `RUN` be deleted?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101228/new/

https://reviews.llvm.org/D101228



More information about the llvm-commits mailing list