diff --git a/bolt/include/bolt/Passes/BinaryPasses.h b/bolt/include/bolt/Passes/BinaryPasses.h --- a/bolt/include/bolt/Passes/BinaryPasses.h +++ b/bolt/include/bolt/Passes/BinaryPasses.h @@ -142,6 +142,8 @@ /// LT_OPTIMIZE_CACHE piggybacks on the idea from Ispike paper (CGO '04) /// that suggests putting frequently executed chains first in the layout. LT_OPTIMIZE_CACHE, + // CACHE_PLUS and EXT_TSP are synonyms, emit warnings of depreciation. + LT_OPTIMIZE_CACHE_PLUS, /// Block reordering guided by the extended TSP metric. LT_OPTIMIZE_EXT_TSP, /// Create clusters and use random order for them. diff --git a/bolt/lib/Passes/BinaryPasses.cpp b/bolt/lib/Passes/BinaryPasses.cpp --- a/bolt/lib/Passes/BinaryPasses.cpp +++ b/bolt/lib/Passes/BinaryPasses.cpp @@ -176,13 +176,21 @@ clEnumValN(bolt::ReorderBasicBlocks::LT_OPTIMIZE_CACHE, "cache", "perform optimal layout prioritizing I-cache " "behavior"), - clEnumValN(bolt::ReorderBasicBlocks::LT_OPTIMIZE_EXT_TSP, "cache+", + clEnumValN(bolt::ReorderBasicBlocks::LT_OPTIMIZE_CACHE_PLUS, "cache+", "perform layout optimizing I-cache behavior"), clEnumValN(bolt::ReorderBasicBlocks::LT_OPTIMIZE_EXT_TSP, "ext-tsp", "perform layout optimizing I-cache behavior"), clEnumValN(bolt::ReorderBasicBlocks::LT_OPTIMIZE_SHUFFLE, "cluster-shuffle", "perform random layout of clusters")), - cl::ZeroOrMore, cl::cat(BoltOptCategory)); + cl::ZeroOrMore, + cl::cat(BoltOptCategory), + cl::callback([&](bolt::ReorderBasicBlocks::LayoutType& option) = { + if (option == bolt::ReorderBasicBlocks::LT_OPTIMIZE_CACHE_PLUS) { + option = bolt::ReorderBasicBlocks::LT_OPTIMIZE_EXT_TSP; + WithColor::warning() << "option cache+ is deprecated, automatically" + << "switch to option ext-tsp.\n"; + } + }); static cl::opt ReportBadLayout("report-bad-layout",