[llvm] 33125cf - [CostModel] fill in arguments as part of intrinsic attribute constructor

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 12:28:04 PDT 2020


Author: Sanjay Patel
Date: 2020-09-28T15:27:45-04:00
New Revision: 33125cffda96fd5c5d2b80eebfa89fbf4f6b76a6

URL: https://github.com/llvm/llvm-project/commit/33125cffda96fd5c5d2b80eebfa89fbf4f6b76a6
DIFF: https://github.com/llvm/llvm-project/commit/33125cffda96fd5c5d2b80eebfa89fbf4f6b76a6.diff

LOG: [CostModel] fill in arguments as part of intrinsic attribute constructor

This appears to be an error of code duplication - instead of
one constructor variant calling another, we have N similar
but not identical versions.

I think this is 'NFC' based on the current callers, but it's
hard to tell or guess the intent in all cases.

Added: 
    

Modified: 
    llvm/lib/Analysis/TargetTransformInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/TargetTransformInfo.cpp b/llvm/lib/Analysis/TargetTransformInfo.cpp
index 4836d80ddb2d..07894a75c124 100644
--- a/llvm/lib/Analysis/TargetTransformInfo.cpp
+++ b/llvm/lib/Analysis/TargetTransformInfo.cpp
@@ -71,6 +71,7 @@ IntrinsicCostAttributes::IntrinsicCostAttributes(Intrinsic::ID Id,
   if (const auto *FPMO = dyn_cast<FPMathOperator>(&CI))
     FMF = FPMO->getFastMathFlags();
 
+  Arguments.insert(Arguments.begin(), CI.arg_begin(), CI.arg_end());
   FunctionType *FTy =
     CI.getCalledFunction()->getFunctionType();
   ParamTys.insert(ParamTys.begin(), FTy->param_begin(), FTy->param_end());


        


More information about the llvm-commits mailing list