Author: David Sherwood Date: 2021-01-13T09:42:58Z New Revision: 4cd48535eca06245c89a9158844bb177c6f8eb63
URL: https://github.com/llvm/llvm-project/commit/4cd48535eca06245c89a9158844bb177c6f8eb63 DIFF: https://github.com/llvm/llvm-project/commit/4cd48535eca06245c89a9158844bb177c6f8eb63.diff LOG: [NFC][InstructionCost] Use InstructionCost in Transforms/Scalar/RewriteStatepointsForGC.cpp In places where we calculate costs using TTI.getXXXCost() interfaces I have changed the code to use InstructionCost instead of unsigned. The change is non functional since InstructionCost behaves in the same way as an integer for valid costs. Currently the getXXXCost() functions used in this file do not return invalid costs. See this patch for the introduction of the type: https://reviews.llvm.org/D91174 See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html Differential revision: https://reviews.llvm.org/D94484 Added: Modified: llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Removed: ################################################################################ diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp index 68ddebf113d1..6a95ec3a6576 100644 --- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp +++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp @@ -2110,10 +2110,10 @@ static Value* findRematerializableChainToBasePointer( // Helper function for the "rematerializeLiveValues". Compute cost of the use // chain we are going to rematerialize. -static unsigned -chainToBasePointerCost(SmallVectorImpl<Instruction*> &Chain, +static InstructionCost +chainToBasePointerCost(SmallVectorImpl<Instruction *> &Chain, TargetTransformInfo &TTI) { - unsigned Cost = 0; + InstructionCost Cost = 0; for (Instruction *Instr : Chain) { if (CastInst *CI = dyn_cast<CastInst>(Instr)) { @@ -2220,7 +2220,7 @@ static void rematerializeLiveValues(CallBase *Call, assert(Info.LiveSet.count(AlternateRootPhi)); } // Compute cost of this chain - unsigned Cost = chainToBasePointerCost(ChainToBase, TTI); + InstructionCost Cost = chainToBasePointerCost(ChainToBase, TTI); // TODO: We can also account for cases when we will be able to remove some // of the rematerialized values by later optimization passes. I.e if // we rematerialized several intersecting chains. Or if original values _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits