LLVM: lib/Passes/PassBuilderPipelines.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

151

152using namespace llvm;

153

154namespace llvm {

155

158 cl::desc("Enable ML policy for inliner. Currently trained for -Oz only"),

160 "Heuristics-based inliner version"),

162 "Use development mode (runtime-loadable model)"),

164 "Use release mode (AOT-compiled model)")));

165

166

170 cl::desc("Enable inline deferral during PGO"));

171

174 cl::desc("Enable module inliner"));

175

178 cl::desc("Perform mandatory inlinings module-wide, before performing "

179 "inlining"));

180

183 cl::desc("Eagerly invalidate more analyses in default pipelines"));

184

187 cl::desc("Enable function merging as part of the optimization pipeline"));

188

191 cl::desc("Run the loop rotation transformation after PGO instrumentation"));

192

195 cl::desc("Enable inter-procedural analyses"));

196

199 cl::desc("Run Partial inlining pass"));

200

203 cl::desc("Run cleanup optimization passes after vectorization"));

204

206 cl::desc("Run the NewGVN pass"));

207

210 cl::desc("Enable the LoopInterchange Pass"));

211

214 cl::desc("Enable Unroll And Jam Pass"));

215

218 cl::desc("Enable the LoopFlatten Pass"));

219

220

221

222

223

224

227 cl::desc("Enable loop header duplication at any optimization level"));

228

231 cl::desc("Enable DFA jump threading"),

233

236 cl::desc("Enable hot-cold splitting pass"));

237

240 cl::desc("Enable ir outliner pass"));

241

244 cl::desc("Disable pre-instrumentation inliner"));

245

248 cl::desc("Control the amount of inlining in pre-instrumentation inliner "

249 "(default = 75)"));

250

253 cl::desc("Enable the GVN hoisting pass (default = off)"));

254

257 cl::desc("Enable the GVN sinking pass (default = off)"));

258

260 "enable-jump-table-to-switch",

261 cl::desc("Enable JumpTableToSwitch pass (default = off)"));

262

263

264

267 cl::desc("Enable control height reduction optimization (CHR)"));

268

271 cl::desc("Indicate the sample profile being used is flattened, i.e., "

272 "no inline hierarchy exists in the profile"));

273

276 cl::desc("Enable lowering of the matrix intrinsics"));

277

281 "Enable pass to eliminate conditions based on linear constraints"));

282

284 "attributor-enable", cl::Hidden, cl::init(AttributorRunOption::NONE),

285 cl::desc("Enable the attributor inter-procedural deduction pass"),

287 "enable all attributor runs"),

289 "enable module-wide attributor runs"),

291 "enable call graph SCC attributor runs"),

292 clEnumValN(AttributorRunOption::NONE, "none",

293 "disable attributor runs")));

294

297 cl::desc("Enable profile instrumentation sampling (default = off)"));

300 cl::desc("Enable the experimental Loop Versioning LICM pass"));

301

303 "instrument-cold-function-only-path", cl::init(""),

304 cl::desc("File path for cold function only instrumentation(requires use "

305 "with --pgo-instrument-cold-function-only)"),

307

308

309

311 "enable-devirtualize-speculatively",

312 cl::desc("Enable speculative devirtualization optimization"),

314

317

319}

320

338

339namespace llvm {

341}

342

345 for (auto &C : PeepholeEPCallbacks)

346 C(FPM, Level);

347}

350 for (auto &C : LateLoopOptimizationsEPCallbacks)

351 C(LPM, Level);

352}

355 for (auto &C : LoopOptimizerEndEPCallbacks)

356 C(LPM, Level);

357}

360 for (auto &C : ScalarOptimizerLateEPCallbacks)

361 C(FPM, Level);

362}

365 for (auto &C : CGSCCOptimizerLateEPCallbacks)

366 C(CGPM, Level);

367}

370 for (auto &C : VectorizerStartEPCallbacks)

371 C(FPM, Level);

372}

375 for (auto &C : VectorizerEndEPCallbacks)

376 C(FPM, Level);

377}

381 for (auto &C : OptimizerEarlyEPCallbacks)

382 C(MPM, Level, Phase);

383}

387 for (auto &C : OptimizerLastEPCallbacks)

388 C(MPM, Level, Phase);

389}

392 for (auto &C : FullLinkTimeOptimizationEarlyEPCallbacks)

393 C(MPM, Level);

394}

397 for (auto &C : FullLinkTimeOptimizationLastEPCallbacks)

398 C(MPM, Level);

399}

402 for (auto &C : PipelineStartEPCallbacks)

403 C(MPM, Level);

404}

407 for (auto &C : PipelineEarlySimplificationEPCallbacks)

408 C(MPM, Level, Phase);

409}

410

411

415

416

421

422

427

428

440

441

443PassBuilder::buildO1FunctionSimplificationPipeline(OptimizationLevel Level,

445

447

449 FPM.addPass(CountVisitsPass());

450

451

452

454

455

456 FPM.addPass(EarlyCSEPass(true ));

457

458

460 SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(true)));

461 FPM.addPass(InstCombinePass());

462

463 FPM.addPass(LibCallsShrinkWrapPass());

464

466

468 SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(true)));

469

470

471

472

473 FPM.addPass(ReassociatePass());

474

475

476

477

478

479

480

481

482

483

485

486

487

488

489 LPM1.addPass(LoopInstSimplifyPass());

490 LPM1.addPass(LoopSimplifyCFGPass());

491

492

493

494

495

496

497

498 LPM1.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,

499 false));

500

501 LPM1.addPass(LoopRotatePass( true,

503

504 LPM1.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,

505 true));

506 LPM1.addPass(SimpleLoopUnswitchPass());

508 LPM1.addPass(LoopFlattenPass());

509

510 LPM2.addPass(LoopIdiomRecognizePass());

511 LPM2.addPass(IndVarSimplifyPass());

512

514

515 LPM2.addPass(LoopDeletionPass());

516

517

518

519

520

521

524 LPM2.addPass(LoopFullUnrollPass(Level.getSpeedupLevel(),

525 !PTO.LoopUnrolling,

526 PTO.ForgetAllSCEVInLoopUnroll));

527

529

531 true));

533 SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(true)));

534 FPM.addPass(InstCombinePass());

535

536

538 false));

539

540

542

543

544 FPM.addPass(MemCpyOptPass());

545

546

547

548

550

551

552

553

555

556

557

558 FPM.addPass(InstCombinePass());

560

561 FPM.addPass(CoroElidePass());

562

564

565

566

567

570 SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(true)));

571 FPM.addPass(InstCombinePass());

573

574 return FPM;

575}

576

581

582

583

584 if (Level.getSpeedupLevel() == 1)

585 return buildO1FunctionSimplificationPipeline(Level, Phase);

586

588

591

592

593

595

596

600

601

604

605

610 }

611

612

614

615

618

619

624

629

630 if (!Level.isOptimizingForSize())

632

634

635

636

638 !Level.isOptimizingForSize())

640

642 isInstrumentedPGOUse()));

645

646

647

648

650

653

654

655

656

657

658

659

660

661

662

664

665

666

667

670

671

672

673

674

675

676

677 LPM1.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,

678 false));

679

680

684

685 LPM1.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,

686 true));

687 LPM1.addPass(

691

694

695 {

699 LPM2.addPass(std::move(ExtraPasses));

700 }

701

703

705

706

707

708

709

710

714 !PTO.LoopUnrolling,

715 PTO.ForgetAllSCEVInLoopUnroll));

716

718

720 true));

724

725

726

728 false));

729

730

732

733

734

736

737

741 else

743

744

745

746

748

749

750

751

753

754

755

758

759

760

763

766

767

768

769

771

772

774

777

779 LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,

780 true),

781 true));

782

784

786

788 .convertSwitchRangeToICmp(true)

789 .convertSwitchToArithmetic(true)

790 .hoistCommonInsts(true)

791 .sinkCommonInsts(true)));

794

795 return FPM;

796}

797

798void PassBuilder::addRequiredLTOPreLinkPasses(ModulePassManager &MPM) {

801}

802

808 return;

810

812

813

814

815

816

819 IP, true,

822

825 FPM.addPass(EarlyCSEPass());

826 FPM.addPass(SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(

827 true)));

828 FPM.addPass(InstCombinePass());

830

832 std::move(FPM), PTO.EagerlyInvalidateAnalyses));

833

834 MPM.addPass(std::move(MIWP));

835

836

837

838

839 MPM.addPass(GlobalDCEPass());

840}

841

845

850 false),

851 PTO.EagerlyInvalidateAnalyses));

852 }

853}

854

857 bool IsCS, bool AtomicCounterUpdate,

858 std::string ProfileFile,

859 std::string ProfileRemappingFile) {

861

862 if (!RunProfileGen) {

863 assert(!ProfileFile.empty() && "Profile use expecting a profile file!");

865 PGOInstrumentationUse(ProfileFile, ProfileRemappingFile, IsCS, FS));

866

867

868 MPM.addPass(RequireAnalysisPass<ProfileSummaryAnalysis, Module>());

869 return;

870 }

871

872

875

876 addPostPGOLoopRotation(MPM, Level);

877

878 InstrProfOptions Options;

879 if (!ProfileFile.empty())

880 Options.InstrProfileOutput = ProfileFile;

881

882 Options.DoCounterPromotion = true;

883 Options.UseBFIInPromotion = IsCS;

886

887

888 Options.DoCounterPromotion = false;

889 }

890 Options.Atomic = AtomicCounterUpdate;

891 MPM.addPass(InstrProfilingLoweringPass(Options, IsCS));

892}

893

895 bool RunProfileGen, bool IsCS,

896 bool AtomicCounterUpdate,

897 std::string ProfileFile,

898 std::string ProfileRemappingFile) {

899 if (!RunProfileGen) {

900 assert(!ProfileFile.empty() && "Profile use expecting a profile file!");

903

904

906 return;

907 }

908

909

912

914 if (!ProfileFile.empty())

915 Options.InstrProfileOutput = ProfileFile;

916

917 Options.DoCounterPromotion = false;

918 Options.UseBFIInPromotion = IsCS;

919 Options.Atomic = AtomicCounterUpdate;

921}

922

924 return getInlineParams(Level.getSpeedupLevel(), Level.getSizeLevel());

925}

926

931 if (PTO.InlinerThreshold == -1)

933 else

935

936

937

938

939

940

941

944

945 if (PGOOpt)

947

951

952

953

956

957

958 MIWP.addModulePass(

960 }

961

962

963

965

966

967

968

969

971

972

973

974

975

976

979

980

981

982

983

985

986

987

990

991

992

995

997

998

999

1002 PTO.EagerlyInvalidateAnalyses, true));

1003

1004

1005

1007

1008

1009

1010

1013

1017 }

1018

1019

1022

1023 return MIWP;

1024}

1025

1030

1032

1033

1034

1035

1036

1037

1038

1041

1042 if (PGOOpt)

1044

1045

1046

1047

1048

1049

1050

1052

1058 }

1059

1062 PTO.EagerlyInvalidateAnalyses));

1063

1069 }

1070

1071 return MPM;

1072}

1073

1078 "Should not be used for O0 pipeline");

1079

1081 "FullLTOPostLink shouldn't call buildModuleSimplificationPipeline!");

1082

1084

1085

1086

1087 if (PGOOpt && PGOOpt->PseudoProbeForProfiling &&

1090

1092

1093

1094

1095

1096 bool LoadSampleProfile =

1097 HasSampleProfile &&

1099

1100

1101

1102

1103

1104

1105

1106

1107

1108

1109

1110

1111

1112

1113

1116

1117

1118

1119

1121

1122

1125

1128

1129

1130

1138 std::move(EarlyFPM), PTO.EagerlyInvalidateAnalyses));

1139 }

1140

1141 if (LoadSampleProfile) {

1142

1143

1145 PGOOpt->ProfileFile, PGOOpt->ProfileRemappingFile, Phase, FS));

1146

1147

1149

1150

1152

1153

1154

1155

1158 }

1159

1160

1161

1163

1166

1167

1168

1169

1173

1175

1176

1177

1178

1179

1185

1186

1187

1189

1190

1192

1193

1194

1196

1200 GlobalCleanupPM.addPass(

1203 PTO.EagerlyInvalidateAnalyses));

1204

1205

1207

1208 const bool IsCtxProfGen =

1210 const bool IsPGOPreLink = !IsCtxProfGen && PGOOpt && IsPreLink;

1211 const bool IsPGOInstrGen =

1213 const bool IsPGOInstrUse =

1215 const bool IsMemprofUse = IsPGOPreLink && !PGOOpt->MemoryProfile.empty();

1216

1217

1219 "Enabling both instrumented PGO and contextual instrumentation is not "

1220 "supported.");

1221 const bool IsCtxProfUse =

1223

1226 "--instrument-cold-function-only-path is provided but "

1227 "--pgo-instrument-cold-function-only is not enabled");

1229 IsPGOPreLink &&

1231

1232 if (IsPGOInstrGen || IsPGOInstrUse || IsMemprofUse || IsCtxProfGen ||

1233 IsCtxProfUse || IsColdFuncOnlyInstrGen)

1234 addPreInlinerPasses(MPM, Level, Phase);

1235

1236

1237 if (IsPGOInstrGen || IsPGOInstrUse) {

1238 addPGOInstrPasses(MPM, Level,

1239 IsPGOInstrGen,

1240 false, PGOOpt->AtomicCounterUpdate,

1241 PGOOpt->ProfileFile, PGOOpt->ProfileRemappingFile);

1242 } else if (IsCtxProfGen || IsCtxProfUse) {

1244

1245

1246

1247

1248

1250 if (IsCtxProfUse) {

1252 return MPM;

1253 }

1254

1255

1256

1257

1258

1259

1261 addPostPGOLoopRotation(MPM, Level);

1263 } else if (IsColdFuncOnlyInstrGen) {

1264 addPGOInstrPasses(MPM, Level, true, false,

1265 false,

1267 "");

1268 }

1269

1270 if (IsPGOInstrGen || IsPGOInstrUse || IsCtxProfGen)

1272

1276

1277 if (IsMemprofUse)

1279

1283

1285

1288 else

1290

1291

1292

1294

1297

1300

1301

1304

1305 return MPM;

1306}

1307

1308

1313

1316

1317

1318

1321

1323 if (IsFullLTO) {

1324

1325

1326

1327

1328

1329

1330

1331

1336 Level.getSpeedupLevel(), !PTO.LoopUnrolling,

1339

1340

1341

1342

1343

1344

1346 }

1347

1348 if (!IsFullLTO) {

1349

1350

1352 }

1353

1354 FPM.addPass(InstCombinePass());

1355

1357 ExtraFunctionPassManager ExtraPasses;

1358

1359

1360

1361

1362

1363

1364 ExtraPasses.addPass(EarlyCSEPass());

1365 ExtraPasses.addPass(CorrelatedValuePropagationPass());

1366 ExtraPasses.addPass(InstCombinePass());

1368 LPM.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,

1369 true));

1370 LPM.addPass(SimpleLoopUnswitchPass( Level ==

1375 SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(true)));

1376 ExtraPasses.addPass(InstCombinePass());

1377 FPM.addPass(std::move(ExtraPasses));

1378 }

1379

1380

1381

1382

1383

1384

1385

1386

1387

1388

1389 FPM.addPass(SimplifyCFGPass(SimplifyCFGOptions()

1390 .forwardSwitchCondToPhi(true)

1391 .convertSwitchRangeToICmp(true)

1392 .convertSwitchToArithmetic(true)

1393 .convertSwitchToLookupTable(true)

1394 .needCanonicalLoops(false)

1395 .hoistCommonInsts(true)

1396 .sinkCommonInsts(true)));

1397

1398 if (IsFullLTO) {

1399 FPM.addPass(SCCPPass());

1400 FPM.addPass(InstCombinePass());

1401 FPM.addPass(BDCEPass());

1402 }

1403

1404

1405 if (PTO.SLPVectorization) {

1406 FPM.addPass(SLPVectorizerPass());

1408 FPM.addPass(EarlyCSEPass());

1409 }

1410 }

1411

1412 FPM.addPass(VectorCombinePass());

1413

1414 if (!IsFullLTO) {

1415 FPM.addPass(InstCombinePass());

1416

1417

1418

1419

1420

1421

1422

1425 LoopUnrollAndJamPass(Level.getSpeedupLevel())));

1426 }

1427 FPM.addPass(LoopUnrollPass(LoopUnrollOptions(

1428 Level.getSpeedupLevel(), !PTO.LoopUnrolling,

1429 PTO.ForgetAllSCEVInLoopUnroll)));

1430 FPM.addPass(WarnMissedTransformationsPass());

1431

1432

1433

1434

1435

1436

1438 }

1439

1440 FPM.addPass(InferAlignmentPass());

1441 FPM.addPass(InstCombinePass());

1442

1443

1444

1445

1446

1447

1448

1450 LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,

1451 true),

1452 true));

1453

1454

1455

1456 FPM.addPass(AlignmentFromAssumptionsPass());

1457}

1458

1462 const bool LTOPreLink = isLTOPreLink(LTOPhase);

1464

1465

1466

1469

1470

1471

1472

1473

1474

1475

1476

1477

1478

1479 if (!LTOPreLink)

1481

1482

1483

1484

1486

1487

1488

1489

1490

1491 if (!LTOPreLink && PGOOpt) {

1493 addPGOInstrPasses(MPM, Level, true,

1494 true, PGOOpt->AtomicCounterUpdate,

1495 PGOOpt->CSProfileGenFile, PGOOpt->ProfileRemappingFile);

1497 addPGOInstrPasses(MPM, Level, false,

1498 true, PGOOpt->AtomicCounterUpdate,

1499 PGOOpt->ProfileFile, PGOOpt->ProfileRemappingFile);

1500 }

1501

1502

1503

1504

1505

1506

1507

1508

1511

1513

1515

1516

1517

1518

1521

1522

1523

1524

1525

1526

1530

1532 LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,

1533 true),

1534 true));

1535 }

1536

1539

1543 }

1544

1545

1546

1549

1550

1551

1552

1553

1554

1555

1556

1558

1560

1561

1564 LTOPreLink));

1565

1566

1567

1568

1570

1571 if (PTO.LoopInterchange)

1573

1576

1577

1578

1579 if (PTO.LoopFusion)

1581

1582

1583

1584

1585

1587

1588

1589

1591

1592 addVectorPasses(Level, OptimizePM, LTOPhase);

1593

1595

1596

1597

1598

1599

1601

1602

1604

1605

1606

1607

1609

1610

1612 TailCallElimPass(isInstrumentedPGOUse()));

1613

1614

1615

1618 .convertSwitchRangeToICmp(true)

1619 .convertSwitchToArithmetic(true)

1620 .speculateUnpredictables(true)

1621 .hoistLoadsStoresWithCondFaulting(true)));

1622

1623

1625 PTO.EagerlyInvalidateAnalyses));

1626

1627

1628

1629 if (!LTOPreLink)

1631

1633

1634

1635

1636

1639

1640

1641

1642

1643

1646

1647

1648

1649

1650

1653

1654

1655

1656 if (PTO.MergeFunctions)

1658

1659 if (PTO.CallGraphProfile && !LTOPreLink)

1661

1662

1663 if (!LTOPreLink)

1665

1666

1667

1669

1670

1672 nullptr,

1673 nullptr,

1674 PTO.DevirtualizeSpeculatively));

1677

1678

1679

1680

1681

1682

1687 } else {

1690 true,

1692 }

1693 }

1694 return MPM;

1695}

1696

1702

1704

1705

1706

1708

1709

1710

1711

1714

1715

1717

1718

1720

1721 if (PGOOpt && PGOOpt->DebugInfoForProfiling)

1723

1724

1726

1727

1729

1730

1732

1733 if (PGOOpt && PGOOpt->PseudoProbeForProfiling &&

1736

1737

1739

1741 addRequiredLTOPreLinkPasses(MPM);

1742 return MPM;

1743}

1744

1747 bool EmitSummary) {

1749 if (ThinLTO)

1751 else

1754

1755

1756

1757

1758

1760

1761

1762

1763

1764

1767

1768

1771 else {

1772

1773

1774

1775 if (ThinLTO) {

1776

1777

1783 }

1784

1785

1788

1790 }

1791 return MPM;

1792}

1793

1798

1800

1801

1803

1804

1806

1807 if (PGOOpt && PGOOpt->DebugInfoForProfiling)

1809

1810

1812

1813

1814

1815

1818

1819

1820

1822 addRequiredLTOPreLinkPasses(MPM);

1823 return MPM;

1824 }

1825

1826

1827

1828

1829

1830

1831

1832

1835

1836 if (PGOOpt && PGOOpt->PseudoProbeForProfiling &&

1839

1840

1841

1842

1847

1848

1850

1851 addRequiredLTOPreLinkPasses(MPM);

1852

1853 return MPM;

1854}

1855

1859

1860

1861

1862

1865

1866 if (ImportSummary) {

1867

1868

1872

1873

1874

1875

1876

1877

1878

1879

1880

1881

1882

1883

1884

1885

1886

1887

1890 }

1891

1893

1894

1898

1899

1900

1902

1903

1904

1905

1908 return MPM;

1909 }

1913 } else {

1914

1917 }

1918

1921

1922

1924

1925 return MPM;

1926}

1927

1934

1939

1941

1942

1943

1944

1947

1948

1949

1951

1953

1954

1957

1958

1961

1963

1964

1965

1967

1969

1970

1972

1973 return MPM;

1974 }

1975

1977

1979 PGOOpt->ProfileRemappingFile,

1981

1982

1984 }

1985

1986

1988

1989

1990

1992

1993

1994

1996

1997 if (Level.getSpeedupLevel() > 1) {

2000

2001

2002

2003

2004

2007

2008

2009

2016

2017

2018

2019

2023

2024

2025

2027 }

2028

2029

2030

2031

2033

2034

2036

2037

2038

2040

2042

2044

2045

2047

2048

2049

2052

2054

2055

2056

2058

2060

2061

2063

2064 return MPM;

2065 }

2066

2067

2069

2070

2072

2073

2075

2076

2077

2079

2080

2082

2083

2084

2085

2086

2089 if (Level.getSpeedupLevel() > 1)

2092

2094 PTO.EagerlyInvalidateAnalyses));

2095

2096

2098

2099

2100

2101

2102

2103

2108 } else {

2111 true,

2114 }

2115

2116

2117

2118

2121 nullptr,

2123

2124

2126

2127

2129

2130

2132

2133

2134

2140

2142

2145

2148

2150

2151

2152

2153 if (PGOOpt) {

2155 addPGOInstrPasses(MPM, Level, true,

2156 true, PGOOpt->AtomicCounterUpdate,

2157 PGOOpt->CSProfileGenFile, PGOOpt->ProfileRemappingFile);

2159 addPGOInstrPasses(MPM, Level, false,

2160 true, PGOOpt->AtomicCounterUpdate,

2161 PGOOpt->ProfileFile, PGOOpt->ProfileRemappingFile);

2162 }

2163

2164

2166

2167

2168

2170 TailCallElimPass(isInstrumentedPGOUse()));

2171

2172

2174 PTO.EagerlyInvalidateAnalyses));

2175

2178

2179

2180

2183

2184

2187 }

2188

2191 LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap,

2192 true),

2193 true));

2194

2197 else

2199

2200

2202

2203

2207

2209

2215

2216

2217

2219 !PTO.LoopUnrolling,

2220 PTO.ForgetAllSCEVInLoopUnroll));

2221

2222

2225

2227

2229

2231

2232

2235

2239 PTO.EagerlyInvalidateAnalyses));

2240

2241

2242

2243

2244

2246

2247

2250

2251

2254

2255

2257

2258

2259

2260

2261

2263

2264

2265

2266

2268

2269

2271 .convertSwitchRangeToICmp(true)

2272 .convertSwitchToArithmetic(true)

2273 .hoistCommonInsts(true)

2274 .speculateUnpredictables(true)));

2276

2277

2279

2280

2282

2283 if (PTO.MergeFunctions)

2285

2287

2288 if (PTO.CallGraphProfile)

2290

2292

2293

2294

2296

2298

2299

2301

2302 return MPM;

2303}

2304

2309 "buildO0DefaultPipeline should only be used with O0");

2310

2312

2313

2314

2315

2316

2317 if (PGOOpt && PGOOpt->PseudoProbeForProfiling)

2319

2323 MPM,

2325 false, PGOOpt->AtomicCounterUpdate, PGOOpt->ProfileFile,

2326 PGOOpt->ProfileRemappingFile);

2327

2328

2331

2333

2334 if (PGOOpt && PGOOpt->DebugInfoForProfiling)

2336

2338

2339

2341 PGOOpt->ProfileRemappingFile,

2343 true,

2344 true));

2345

2346

2348 }

2349

2351

2352

2353

2354

2355

2357 false));

2358

2359 if (PTO.MergeFunctions)

2361

2365

2366 if (!CGSCCOptimizerLateEPCallbacks.empty()) {

2371 }

2372 if (!LateLoopOptimizationsEPCallbacks.empty()) {

2375 if (!LPM.isEmpty()) {

2378 }

2379 }

2380 if (!LoopOptimizerEndEPCallbacks.empty()) {

2383 if (!LPM.isEmpty()) {

2386 }

2387 }

2388 if (!ScalarOptimizerLateEPCallbacks.empty()) {

2393 }

2394

2396

2397 if (!VectorizerStartEPCallbacks.empty()) {

2402 }

2403

2404 if (!VectorizerEndEPCallbacks.empty()) {

2409 }

2410

2412

2413

2414

2417

2419

2421 addRequiredLTOPreLinkPasses(MPM);

2422

2424

2425 return MPM;

2426}

2427

2430

2431

2432

2433

2434

2435 if (TM)

2436 TM->registerEarlyDefaultAliasAnalyses(AA);

2437

2438

2439

2440

2441 AA.registerFunctionAnalysis<BasicAA>();

2442

2443

2444

2447

2448

2449

2450

2451

2454

2455

2456 if (TM)

2457 TM->registerDefaultAliasAnalyses(AA);

2458

2459 return AA;

2460}

2461

2462bool PassBuilder::isInstrumentedPGOUse() const {

2465}

aarch64 falkor hwpf fix Falkor HW Prefetch Fix Late Phase

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

AggressiveInstCombiner - Combine expression patterns to form expressions with fewer,...

Provides passes to inlining "always_inline" functions.

This is the interface for LLVM's primary stateless and local alias analysis.

This file provides the interface for LLVM's Call Graph Profile pass.

This header provides classes for managing passes over SCCs of the call graph.

#define clEnumValN(ENUMVAL, FLAGNAME, DESC)

This file provides the interface for a simple, fast CSE pass.

This file provides a pass which clones the current module and runs the provided pass pipeline on the ...

Super simple passes to force specific function attrs from the commandline into the IR for debugging p...

Provides passes for computing function attributes based on interprocedural analyses.

This file provides the interface for LLVM's Global Value Numbering pass which eliminates fully redund...

This is the interface for a simple mod/ref and alias analysis over globals.

AcceleratorCodeSelection - Identify all functions reachable from a kernel, removing those that are un...

This header defines various interfaces for pass management in LLVM.

Interfaces for passes which infer implicit function attributes from the name and signature of functio...

This file provides the primary interface to the instcombine pass.

Defines passes for running instruction simplification across chunks of IR.

This file provides the interface for LLVM's PGO Instrumentation lowering pass.

See the comments on JumpThreadingPass.

This file implements the Loop Fusion pass.

This header defines the LoopLoadEliminationPass object.

This header provides classes for managing a pipeline of passes over loops in LLVM IR.

The header file for the LowerConstantIntrinsics pass as used by the new pass manager.

The header file for the LowerExpectIntrinsic pass as used by the new pass manager.

This pass performs merges of loads and stores on both sides of a.

This file provides the interface for LLVM's Global Value Numbering pass.

This header enumerates the LLVM-provided high-level optimization levels.

This file provides the interface for IR based instrumentation passes ( (profile-gen,...

Define option tunables for PGO.

static void addAnnotationRemarksPass(ModulePassManager &MPM)

Definition PassBuilderPipelines.cpp:412

static InlineParams getInlineParamsFromOptLevel(OptimizationLevel Level)

Definition PassBuilderPipelines.cpp:923

static CoroConditionalWrapper buildCoroWrapper(ThinOrFullLTOPhase Phase)

Definition PassBuilderPipelines.cpp:429

static bool isLTOPreLink(ThinOrFullLTOPhase Phase)

Definition PassBuilderPipelines.cpp:417

static bool isLTOPostLink(ThinOrFullLTOPhase Phase)

Definition PassBuilderPipelines.cpp:423

This file implements relative lookup table converter that converts lookup tables to relative lookup t...

This file provides the interface for LLVM's Scalar Replacement of Aggregates pass.

This file provides the interface for the pseudo probe implementation for AutoFDO.

This file provides the interface for the sampled PGO loader pass.

This is the interface for a metadata-based scoped no-alias analysis.

This file provides the interface for the pass responsible for both simplifying and canonicalizing the...

This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...

This is the interface for a metadata-based TBAA.

Defines the virtual file system interface vfs::FileSystem.

A manager for alias analyses.

A module pass that rewrites heap allocations to use token-enabled allocation functions based on vario...

Inlines functions marked as "always_inline".

Assign a GUID to functions as metadata.

Analysis pass providing a never-invalidated alias analysis result.

Simple pass that canonicalizes aliases.

A pass that merges duplicate global constants into a single constant.

This class implements a trivial dead store elimination.

Eliminate dead arguments (and return values) from functions.

A pass that transforms external global definitions into declarations.

Pass embeds a copy of the module optimized with the provided pass pipeline into a global variable.

The core GVN pass object.

Pass to remove unused function declarations.

Optimize globals that never have their address taken.

Pass to perform split of global variables.

Analysis pass providing a never-invalidated alias analysis result.

Pass to outline cold regions.

Pass to perform interprocedural constant propagation.

Pass to outline similar regions.

Run instruction simplification across each instruction in the function.

Instrumentation based profiling lowering pass.

This pass performs 'jump threading', which looks at blocks that have multiple predecessors and multip...

Performs Loop Invariant Code Motion Pass.

Loop unroll pass that only does full loop unrolling and peeling.

Performs Loop Idiom Recognize Pass.

Performs Loop Inst Simplify Pass.

A simple loop rotation transformation.

Performs basic CFG simplifications to assist other loop passes.

A pass that does profile-guided sinking of instructions into loops.

A simple loop rotation transformation.

Loop unroll pass that will support both full and partial unrolling.

Strips MemProf attributes and metadata.

Merge identical functions.

The module inliner pass for the new pass manager.

Module pass, wrapping the inliner pass.

void addModulePass(T Pass)

Add a module pass that runs before the CGSCC passes.

Class to hold module path string table and global value map, and encapsulate methods for operating on...

bool withSupportsHotColdNew() const

Simple pass that provides a name to every anonymous globals.

Additional 'norecurse' attribute deduction during postlink LTO phase.

OpenMP optimizations pass.

static LLVM_ABI const OptimizationLevel O3

Optimize for fast execution as much as possible.

static LLVM_ABI const OptimizationLevel Oz

A very specialized mode that will optimize for code size at any and all costs.

static LLVM_ABI const OptimizationLevel O0

Disable as many optimizations as possible.

static LLVM_ABI const OptimizationLevel Os

Similar to O2 but tries to optimize for small code size instead of fast execution without triggering ...

static LLVM_ABI const OptimizationLevel O2

Optimize for fast execution as much as possible without triggering significant incremental compile ti...

static LLVM_ABI const OptimizationLevel O1

Optimize quickly without destroying debuggability.

static bool isCtxIRPGOInstrEnabled()

The instrumentation (profile-instr-gen) pass for IR based PGO.

The instrumentation (profile-instr-gen) pass for IR based PGO.

The profile annotation (profile-instr-use) pass for IR based PGO.

The profile size based optimization pass for memory intrinsics.

Pass to remove unused function declarations.

LLVM_ABI void invokeFullLinkTimeOptimizationLastEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)

Definition PassBuilderPipelines.cpp:395

LLVM_ABI ModuleInlinerWrapperPass buildInlinerPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)

Construct the module pipeline that performs inlining as well as the inlining-driven cleanups.

Definition PassBuilderPipelines.cpp:928

LLVM_ABI void invokeOptimizerEarlyEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level, ThinOrFullLTOPhase Phase)

Definition PassBuilderPipelines.cpp:378

LLVM_ABI void invokeVectorizerStartEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level)

Definition PassBuilderPipelines.cpp:368

LLVM_ABI AAManager buildDefaultAAPipeline()

Build the default AAManager with the default alias analysis pipeline registered.

Definition PassBuilderPipelines.cpp:2428

LLVM_ABI void invokeCGSCCOptimizerLateEPCallbacks(CGSCCPassManager &CGPM, OptimizationLevel Level)

Definition PassBuilderPipelines.cpp:363

LLVM_ABI ModulePassManager buildThinLTOPreLinkDefaultPipeline(OptimizationLevel Level)

Build a pre-link, ThinLTO-targeting default optimization pipeline to a pass manager.

Definition PassBuilderPipelines.cpp:1795

LLVM_ABI void addPGOInstrPassesForO0(ModulePassManager &MPM, bool RunProfileGen, bool IsCS, bool AtomicCounterUpdate, std::string ProfileFile, std::string ProfileRemappingFile)

Add PGOInstrumenation passes for O0 only.

Definition PassBuilderPipelines.cpp:894

LLVM_ABI void invokeScalarOptimizerLateEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level)

Definition PassBuilderPipelines.cpp:358

LLVM_ABI ModulePassManager buildPerModuleDefaultPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase=ThinOrFullLTOPhase::None)

Build a per-module default optimization pipeline.

Definition PassBuilderPipelines.cpp:1698

LLVM_ABI void invokePipelineStartEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)

Definition PassBuilderPipelines.cpp:400

LLVM_ABI void invokeVectorizerEndEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level)

Definition PassBuilderPipelines.cpp:373

LLVM_ABI ModulePassManager buildO0DefaultPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase=ThinOrFullLTOPhase::None)

Build an O0 pipeline with the minimal semantically required passes.

Definition PassBuilderPipelines.cpp:2306

LLVM_ABI FunctionPassManager buildFunctionSimplificationPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)

Construct the core LLVM function canonicalization and simplification pipeline.

Definition PassBuilderPipelines.cpp:578

LLVM_ABI void invokePeepholeEPCallbacks(FunctionPassManager &FPM, OptimizationLevel Level)

Definition PassBuilderPipelines.cpp:343

LLVM_ABI void invokePipelineEarlySimplificationEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level, ThinOrFullLTOPhase Phase)

Definition PassBuilderPipelines.cpp:405

LLVM_ABI void invokeLoopOptimizerEndEPCallbacks(LoopPassManager &LPM, OptimizationLevel Level)

Definition PassBuilderPipelines.cpp:353

LLVM_ABI ModulePassManager buildLTODefaultPipeline(OptimizationLevel Level, ModuleSummaryIndex *ExportSummary)

Build an LTO default optimization pipeline to a pass manager.

Definition PassBuilderPipelines.cpp:1936

LLVM_ABI ModulePassManager buildModuleInlinerPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)

Construct the module pipeline that performs inlining with module inliner pass.

Definition PassBuilderPipelines.cpp:1027

LLVM_ABI ModulePassManager buildThinLTODefaultPipeline(OptimizationLevel Level, const ModuleSummaryIndex *ImportSummary)

Build a ThinLTO default optimization pipeline to a pass manager.

Definition PassBuilderPipelines.cpp:1856

LLVM_ABI void invokeLateLoopOptimizationsEPCallbacks(LoopPassManager &LPM, OptimizationLevel Level)

Definition PassBuilderPipelines.cpp:348

LLVM_ABI void invokeFullLinkTimeOptimizationEarlyEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level)

Definition PassBuilderPipelines.cpp:390

LLVM_ABI ModulePassManager buildFatLTODefaultPipeline(OptimizationLevel Level, bool ThinLTO, bool EmitSummary)

Build a fat object default optimization pipeline.

Definition PassBuilderPipelines.cpp:1746

LLVM_ABI ModulePassManager buildModuleSimplificationPipeline(OptimizationLevel Level, ThinOrFullLTOPhase Phase)

Construct the core LLVM module canonicalization and simplification pipeline.

Definition PassBuilderPipelines.cpp:1075

LLVM_ABI ModulePassManager buildModuleOptimizationPipeline(OptimizationLevel Level, ThinOrFullLTOPhase LTOPhase)

Construct the core LLVM module optimization pipeline.

Definition PassBuilderPipelines.cpp:1460

LLVM_ABI void invokeOptimizerLastEPCallbacks(ModulePassManager &MPM, OptimizationLevel Level, ThinOrFullLTOPhase Phase)

Definition PassBuilderPipelines.cpp:384

LLVM_ABI ModulePassManager buildLTOPreLinkDefaultPipeline(OptimizationLevel Level)

Build a pre-link, LTO-targeting default optimization pipeline to a pass manager.

Definition PassBuilderPipelines.cpp:1929

LLVM_ATTRIBUTE_MINSIZE std::enable_if_t<!std::is_same_v< PassT, PassManager > > addPass(PassT &&Pass)

bool isEmpty() const

Returns if the pass manager contains any passes.

unsigned LicmMssaNoAccForPromotionCap

Tuning option to disable promotion to scalars in LICM with MemorySSA, if the number of access is too ...

bool SLPVectorization

Tuning option to enable/disable slp loop vectorization, set based on opt level.

bool DevirtualizeSpeculatively

int InlinerThreshold

Tuning option to override the default inliner threshold.

bool LoopFusion

Tuning option to enable/disable loop fusion. Its default value is false.

bool EagerlyInvalidateAnalyses

bool CallGraphProfile

Tuning option to enable/disable call graph profile.

bool MergeFunctions

Tuning option to enable/disable function merging.

bool ForgetAllSCEVInLoopUnroll

Tuning option to forget all SCEV loops in LoopUnroll.

unsigned LicmMssaOptCap

Tuning option to cap the number of calls to retrive clobbering accesses in MemorySSA,...

bool LoopInterleaving

Tuning option to set loop interleaving on/off, set based on opt level.

LLVM_ABI PipelineTuningOptions()

Constructor sets pipeline tuning defaults based on cl::opts.

Definition PassBuilderPipelines.cpp:321

bool LoopUnrolling

Tuning option to enable/disable loop unrolling. Its default value is true.

bool LoopInterchange

Tuning option to enable/disable loop interchange.

bool LoopVectorization

Tuning option to enable/disable loop vectorization, set based on opt level.

Reassociate commutative expressions.

A pass to do RPO deduction and propagation of function attributes.

This pass performs function-level constant propagation and merging.

The sample profiler data loader pass.

Analysis pass providing a never-invalidated alias analysis result.

This pass transforms loops that contain branches or switches on loop- invariant conditions to have mu...

A pass to simplify and canonicalize the CFG of a function.

Analysis pass providing a never-invalidated alias analysis result.

Optimize scalar/vector interactions in IR using target cost models.

Interfaces for registering analysis passes, producing common pass manager configurations,...

Abstract Attribute helper functions.

@ C

The default llvm calling convention, compatible with C.

ValuesClass values(OptsTy... Options)

Helper to build a ValuesClass by forwarding a variable number of arguments as an initializer list to ...

initializer< Ty > init(const Ty &Val)

@ Assume

Do not drop type tests (default).

@ All

Drop only llvm.assumes using type test value.

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI cl::opt< bool > EnableKnowledgeRetention

static cl::opt< bool > RunNewGVN("enable-newgvn", cl::init(false), cl::Hidden, cl::desc("Run the NewGVN pass"))

static cl::opt< bool > DisablePreInliner("disable-preinline", cl::init(false), cl::Hidden, cl::desc("Disable pre-instrumentation inliner"))

static cl::opt< bool > EnableJumpTableToSwitch("enable-jump-table-to-switch", cl::desc("Enable JumpTableToSwitch pass (default = off)"))

static cl::opt< bool > PerformMandatoryInliningsFirst("mandatory-inlining-first", cl::init(false), cl::Hidden, cl::desc("Perform mandatory inlinings module-wide, before performing " "inlining"))

static cl::opt< bool > RunPartialInlining("enable-partial-inlining", cl::init(false), cl::Hidden, cl::desc("Run Partial inlining pass"))

static cl::opt< bool > EnableGVNSink("enable-gvn-sink", cl::desc("Enable the GVN sinking pass (default = off)"))

static cl::opt< bool > EnableLoopHeaderDuplication("enable-loop-header-duplication", cl::init(false), cl::Hidden, cl::desc("Enable loop header duplication at any optimization level"))

static cl::opt< bool > EnableModuleInliner("enable-module-inliner", cl::init(false), cl::Hidden, cl::desc("Enable module inliner"))

static cl::opt< bool > EnableEagerlyInvalidateAnalyses("eagerly-invalidate-analyses", cl::init(true), cl::Hidden, cl::desc("Eagerly invalidate more analyses in default pipelines"))

static cl::opt< bool > EnableMatrix("enable-matrix", cl::init(false), cl::Hidden, cl::desc("Enable lowering of the matrix intrinsics"))

ModuleToFunctionPassAdaptor createModuleToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false)

A function to deduce a function pass type and wrap it in the templated adaptor.

cl::opt< std::string > UseCtxProfile("use-ctx-profile", cl::init(""), cl::Hidden, cl::desc("Use the specified contextual profile file"))

Definition PassBuilderPipelines.cpp:315

static cl::opt< bool > EnableSampledInstr("enable-sampled-instrumentation", cl::init(false), cl::Hidden, cl::desc("Enable profile instrumentation sampling (default = off)"))

static cl::opt< bool > EnableLoopFlatten("enable-loop-flatten", cl::init(false), cl::Hidden, cl::desc("Enable the LoopFlatten Pass"))

static cl::opt< InliningAdvisorMode > UseInlineAdvisor("enable-ml-inliner", cl::init(InliningAdvisorMode::Default), cl::Hidden, cl::desc("Enable ML policy for inliner. Currently trained for -Oz only"), cl::values(clEnumValN(InliningAdvisorMode::Default, "default", "Heuristics-based inliner version"), clEnumValN(InliningAdvisorMode::Development, "development", "Use development mode (runtime-loadable model)"), clEnumValN(InliningAdvisorMode::Release, "release", "Use release mode (AOT-compiled model)")))

PassManager< LazyCallGraph::SCC, CGSCCAnalysisManager, LazyCallGraph &, CGSCCUpdateResult & > CGSCCPassManager

The CGSCC pass manager.

static cl::opt< bool > EnableUnrollAndJam("enable-unroll-and-jam", cl::init(false), cl::Hidden, cl::desc("Enable Unroll And Jam Pass"))

ThinOrFullLTOPhase

This enumerates the LLVM full LTO or ThinLTO optimization phases.

@ FullLTOPreLink

Full LTO prelink phase.

@ ThinLTOPostLink

ThinLTO postlink (backend compile) phase.

@ None

No LTO/ThinLTO behavior needed.

@ FullLTOPostLink

Full LTO postlink (backend compile) phase.

@ ThinLTOPreLink

ThinLTO prelink (summary) phase.

PassManager< Loop, LoopAnalysisManager, LoopStandardAnalysisResults &, LPMUpdater & > LoopPassManager

The Loop pass manager.

static cl::opt< bool > EnableConstraintElimination("enable-constraint-elimination", cl::init(true), cl::Hidden, cl::desc("Enable pass to eliminate conditions based on linear constraints"))

ModuleToPostOrderCGSCCPassAdaptor createModuleToPostOrderCGSCCPassAdaptor(CGSCCPassT &&Pass)

A function to deduce a function pass type and wrap it in the templated adaptor.

static cl::opt< bool > EnablePGOInlineDeferral("enable-npm-pgo-inline-deferral", cl::init(true), cl::Hidden, cl::desc("Enable inline deferral during PGO"))

Flag to enable inline deferral during PGO.

FunctionToLoopPassAdaptor createFunctionToLoopPassAdaptor(LoopPassT &&Pass, bool UseMemorySSA=false)

A function to deduce a loop pass type and wrap it in the templated adaptor.

CGSCCToFunctionPassAdaptor createCGSCCToFunctionPassAdaptor(FunctionPassT &&Pass, bool EagerlyInvalidate=false, bool NoRerun=false)

A function to deduce a function pass type and wrap it in the templated adaptor.

cl::opt< bool > ForgetSCEVInLoopUnroll

PassManager< Module > ModulePassManager

Convenience typedef for a pass manager over modules.

static cl::opt< bool > EnablePostPGOLoopRotation("enable-post-pgo-loop-rotation", cl::init(true), cl::Hidden, cl::desc("Run the loop rotation transformation after PGO instrumentation"))

LLVM_ABI bool AreStatisticsEnabled()

Check if statistics are enabled.

static cl::opt< std::string > InstrumentColdFuncOnlyPath("instrument-cold-function-only-path", cl::init(""), cl::desc("File path for cold function only instrumentation(requires use " "with --pgo-instrument-cold-function-only)"), cl::Hidden)

static cl::opt< bool > EnableGlobalAnalyses("enable-global-analyses", cl::init(true), cl::Hidden, cl::desc("Enable inter-procedural analyses"))

static cl::opt< bool > EnableDFAJumpThreading("enable-dfa-jump-thread", cl::desc("Enable DFA jump threading"), cl::init(false), cl::Hidden)

static cl::opt< bool > FlattenedProfileUsed("flattened-profile-used", cl::init(false), cl::Hidden, cl::desc("Indicate the sample profile being used is flattened, i.e., " "no inline hierarchy exists in the profile"))

static cl::opt< bool > ExtraVectorizerPasses("extra-vectorizer-passes", cl::init(false), cl::Hidden, cl::desc("Run cleanup optimization passes after vectorization"))

static cl::opt< bool > EnableHotColdSplit("hot-cold-split", cl::desc("Enable hot-cold splitting pass"))

cl::opt< bool > EnableMemProfContextDisambiguation

Enable MemProf context disambiguation for thin link.

Definition PassBuilderPipelines.cpp:318

PassManager< Function > FunctionPassManager

Convenience typedef for a pass manager over functions.

LLVM_ABI InlineParams getInlineParams()

Generate the parameters to tune the inline cost analysis based only on the commandline options.

cl::opt< bool > PGOInstrumentColdFunctionOnly

static cl::opt< bool > EnableLoopInterchange("enable-loopinterchange", cl::init(false), cl::Hidden, cl::desc("Enable the LoopInterchange Pass"))

static cl::opt< bool > EnableCHR("enable-chr", cl::init(true), cl::Hidden, cl::desc("Enable control height reduction optimization (CHR)"))

static cl::opt< bool > EnableMergeFunctions("enable-merge-functions", cl::init(false), cl::Hidden, cl::desc("Enable function merging as part of the optimization pipeline"))

static cl::opt< bool > EnableDevirtualizeSpeculatively("enable-devirtualize-speculatively", cl::desc("Enable speculative devirtualization optimization"), cl::init(false))

static cl::opt< bool > EnableGVNHoist("enable-gvn-hoist", cl::desc("Enable the GVN hoisting pass (default = off)"))

cl::opt< unsigned > SetLicmMssaNoAccForPromotionCap

static cl::opt< bool > EnableIROutliner("ir-outliner", cl::init(false), cl::Hidden, cl::desc("Enable ir outliner pass"))

static cl::opt< AttributorRunOption > AttributorRun("attributor-enable", cl::Hidden, cl::init(AttributorRunOption::NONE), cl::desc("Enable the attributor inter-procedural deduction pass"), cl::values(clEnumValN(AttributorRunOption::ALL, "all", "enable all attributor runs"), clEnumValN(AttributorRunOption::MODULE, "module", "enable module-wide attributor runs"), clEnumValN(AttributorRunOption::CGSCC, "cgscc", "enable call graph SCC attributor runs"), clEnumValN(AttributorRunOption::NONE, "none", "disable attributor runs")))

static cl::opt< int > PreInlineThreshold("preinline-threshold", cl::Hidden, cl::init(75), cl::desc("Control the amount of inlining in pre-instrumentation inliner " "(default = 75)"))

static cl::opt< bool > UseLoopVersioningLICM("enable-loop-versioning-licm", cl::init(false), cl::Hidden, cl::desc("Enable the experimental Loop Versioning LICM pass"))

cl::opt< unsigned > MaxDevirtIterations("max-devirt-iterations", cl::ReallyHidden, cl::init(4))

Definition PassBuilderPipelines.cpp:340

cl::opt< unsigned > SetLicmMssaOptCap

A DCE pass that assumes instructions are dead until proven otherwise.

This pass attempts to minimize the number of assume without loosing any information.

Hoist/decompose integer division and remainder instructions to enable CFG improvements and better cod...

A simple and fast domtree-based CSE pass.

Pass which forces specific function attributes into the IR, primarily as a debugging tool.

A simple and fast domtree-based GVN pass to hoist common expressions from sibling branches.

Uses an "inverted" value numbering to decide the similarity of expressions and sinks similar expressi...

A set of parameters to control various transforms performed by IPSCCP pass.

A pass which infers function attributes from the names and signatures of function declarations in a m...

Provides context on when an inline advisor is constructed in the pipeline (e.g., link phase,...

Thresholds to tune inline cost analysis.

std::optional< int > HotCallSiteThreshold

Threshold to use when the callsite is considered hot.

int DefaultThreshold

The default threshold to start with for a callee.

std::optional< bool > EnableDeferral

Indicate whether we should allow inline deferral.

std::optional< int > HintThreshold

Threshold to use for callees with inline hint.

Options for the frontend instrumentation based profiling pass.

A no-op pass template which simply forces a specific analysis result to be invalidated.

Pass to forward loads in a loop around the backedge to subsequent iterations.

A set of parameters used to control various transforms performed by the LoopUnroll pass.

Computes function attributes in post-order over the call graph.

A utility pass template to force an analysis result to be available.