SuccessChanges

Summary

  1. [SampleFDO] Add use-sample-profile function attribute. (details)
  2. [MTE] Move tagging in pipeline (details)
  3. [NFC, StackSafety] Change type of internal container (details)
  4. [NFC,MTE] Drop unneeded attribute from test (details)
  5. [JumpThreading] Simplify FindMostPopularDest (NFC) (details)
  6. [AArch64][GlobalISel] Select zip1 and zip2 (details)
Commit 7a6c89427c9babc8e4a69e8a2b61bbf4a4b80c56 by wmi
[SampleFDO] Add use-sample-profile function attribute.

When sampleFDO is enabled, people may expect they can use
-fno-profile-sample-use to opt-out using sample profile for a certain file.
That could be either for debugging purpose or for performance tuning purpose.
However, when thinlto is enabled, if a function in file A compiled with
-fno-profile-sample-use is imported to another file B compiled with
-fprofile-sample-use, the inlined copy of the function in file B may still
get its profile annotated.

The inconsistency may even introduce profile unused warning because if the
target is not compiled with explicit debug information flag, the function
in file A won't have its debug information enabled (debug information will
be enabled implicitly only when -fprofile-sample-use is used). After it is
imported into file B which is compiled with -fprofile-sample-use, profile
annotation for the outline copy of the function will fail because the
function has no debug information, and that will trigger  profile unused
warning.

We add a new attribute use-sample-profile to control whether a function
will use its sample profile no matter for its outline or inline copies.
That will make the behavior of -fno-profile-sample-use consistent.

Differential Revision: https://reviews.llvm.org/D79959
The file was modifiedllvm/include/llvm/IR/Attributes.td
The file was modifiedllvm/test/LTO/Resolution/X86/load-sample-prof-icp.ll
The file was modifiedllvm/lib/Transforms/IPO/SampleProfile.cpp
The file was modifiedllvm/test/Transforms/SampleProfile/section-accurate-samplepgo.ll
The file was modifiedllvm/test/Transforms/SampleProfile/nolocinfo.ll
The file was modifiedllvm/test/Transforms/SampleProfile/indirect-call-gcc.ll
The file was modifiedllvm/test/Transforms/SampleProfile/inline-topdown.ll
The file was modifiedllvm/test/Transforms/SampleProfile/inline.ll
The file was modifiedllvm/test/Transforms/SampleProfile/inline-callee-update.ll
The file was modifiedllvm/test/Transforms/SampleProfile/cold-indirect-call.ll
The file was modifiedllvm/test/Transforms/SampleProfile/inline-mergeprof.ll
The file was modifiedllvm/test/Transforms/SampleProfile/offset.ll
The file was addedllvm/test/Transforms/Inline/inline-incompat-attrs.ll
The file was modifiedllvm/test/Transforms/SampleProfile/branch.ll
The file was modifiedllvm/test/Transforms/SampleProfile/Inputs/profile-symbol-list.ll
The file was modifiedllvm/test/Transforms/SampleProfile/cov-zero-samples.ll
The file was modifiedllvm/test/Transforms/SampleProfile/function_metadata.ll
The file was modifiedllvm/test/Transforms/SampleProfile/remap.ll
The file was modifiedllvm/test/LTO/Resolution/X86/load-sample-prof.ll
The file was modifiedllvm/test/Transforms/SampleProfile/indirect-call.ll
The file was modifiedllvm/test/Transforms/SampleProfile/profile-format-compress.ll
The file was modifiedllvm/test/Transforms/SampleProfile/calls.ll
The file was modifiedclang/lib/CodeGen/CodeGenFunction.cpp
The file was modifiedllvm/test/Transforms/SampleProfile/fnptr.ll
The file was modifiedllvm/test/Transforms/SampleProfile/inline-combine.ll
The file was modifiedllvm/test/Transforms/SampleProfile/propagate.ll
The file was modifiedllvm/test/Transforms/SampleProfile/inline-coverage.ll
The file was modifiedllvm/test/Transforms/SampleProfile/profile-format.ll
The file was modifiedllvm/test/Transforms/SampleProfile/discriminator.ll
The file was modifiedllvm/test/Transforms/SampleProfile/syntax.ll
The file was modifiedllvm/test/Transforms/SampleProfile/warm-inline-instance.ll
The file was addedclang/test/CodeGen/use-sample-profile-attr.c
The file was addedllvm/test/Transforms/SampleProfile/Inputs/use-sample-profile-attr.prof
The file was addedllvm/test/Transforms/Inline/partial-inline-incompat-attrs.ll
The file was modifiedllvm/test/Transforms/SampleProfile/entry_counts_missing_dbginfo.ll
The file was modifiedllvm/test/Transforms/SampleProfile/inline-cold-callsite-samplepgo.ll
The file was modifiedllvm/test/Transforms/SampleProfile/profile-sample-accurate.ll
The file was addedllvm/test/Transforms/SampleProfile/use-sample-profile-attr.ll
The file was modifiedllvm/test/Transforms/SampleProfile/remarks.ll
The file was modifiedllvm/test/Transforms/SampleProfile/gcc-simple.ll
The file was modifiedllvm/test/Transforms/SampleProfile/coverage-warning.ll
The file was modifiedllvm/test/Transforms/SampleProfile/inline-cold.ll
The file was modifiedllvm/test/Transforms/SampleProfile/early-inline.ll
The file was modifiedllvm/test/Transforms/SampleProfile/entry_counts.ll
The file was modifiedllvm/test/Transforms/SampleProfile/entry_counts_cold.ll
The file was modifiedllvm/test/Transforms/SampleProfile/inline-stats.ll
The file was modifiedllvm/test/LTO/Resolution/X86/load-sample-prof-lto.ll
Commit f48bc44ace1a100bef676e630d5089779e7b87bf by Vitaly Buka
[MTE] Move tagging in pipeline

Summary:
This removes two analyses from pipeline.

Depends on D80771.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80780
The file was modifiedllvm/lib/Target/AArch64/AArch64TargetMachine.cpp
The file was modifiedllvm/test/CodeGen/AArch64/O3-pipeline.ll
Commit f62813e7eae148a6175de28bfa384524a9f2bf94 by Vitaly Buka
[NFC, StackSafety] Change type of internal container

Summary: Depends on D80771.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80847
The file was modifiedllvm/lib/Analysis/StackSafetyAnalysis.cpp
Commit 85fdec988fc55d56988d57fa88e2b870f6e0e8e9 by Vitaly Buka
[NFC,MTE] Drop unneeded attribute from test

Summary: Depends on D80847.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: hiraditya, steven_wu, dexonsmith, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D80954
The file was modifiedclang/test/Driver/memtag_lto.c
Commit f355c7fc2f8fb0db829313b8e43f974ed730cf6d by kazu
[JumpThreading] Simplify FindMostPopularDest (NFC)

Summary:
This patch simplifies FindMostPopularDest without changing the
functionality.

Given a list of jump threading destinations, the function finds the
most popular destination.  To ensure determinism when there are
multiple destinations with the highest popularity, the function picks
the first one in the successor list with the highest popularity.

Without this patch:

- The function populates DestPopularity -- a histogram mapping
  destinations to their respective occurrence counts.

- Then we iterate over DestPopularity, looking for the highest
  popularity while building a vector of destinations with the highest
  popularity.

- Finally, we iterate the successor list, looking for the destination
  with the highest popularity.

With this patch:

- We implement DestPopularity with MapVector instead of DenseMap.  We
  populate the map with popularity 0 for all successors in the order
  they appear in the successor list.

- We build the histogram in the same way as before.

- We simply use std::max_element on DestPopularity to find the most
  popular destination.  The use of MapVector ensures determinism.

Reviewers: wmi, efriedma

Reviewed By: wmi

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81030
The file was modifiedllvm/lib/Transforms/Scalar/JumpThreading.cpp
Commit 8b96703652ade915eb444b8dae91ae6a16d32d75 by Jessica Paquette
[AArch64][GlobalISel] Select zip1 and zip2

Port the code to recognize a zip1/zip2 shuffle mask from AArch64ISelLowering
and put it into the post-legalizer combiner.

Add G_ZIP1 and G_ZIP2 to AArch64InstrGISel.td and hook them up as equivalent
nodes to AArch64zip1 and AArch64zip2. This allows us to select them.

Minor code size improvements for SPECINT2000 at -O3 on 197.parser, 252.eon, and
186.crafty.

Differential Revision: https://reviews.llvm.org/D80969
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/select-zip.mir
The file was modifiedllvm/lib/Target/AArch64/AArch64PostLegalizerCombiner.cpp
The file was addedllvm/test/CodeGen/AArch64/GlobalISel/postlegalizer-combiner-zip.mir
The file was modifiedllvm/lib/Target/AArch64/AArch64Combine.td
The file was modifiedllvm/lib/Target/AArch64/AArch64InstrGISel.td