SuccessChanges

Summary

  1. [IR][PGO] Add hot func attribute and use hot/cold attribute in func section (details)
  2. [flang] Fix -intrinsic-module-directory in flang script (details)
  3. Fix clang-ppc64le-rhel buildbot build error (details)
  4. [RISCV] Remove NoVReg to avoid compile warning messages. (details)
  5. [Transforms] Use llvm::erase_if (NFC) (details)
Commit 3733463dbb58a29892be3872bd32f93cb9af492c by xur
[IR][PGO] Add hot func attribute and use hot/cold attribute in func section

Clang FE currently has hot/cold function attribute. But we only have
cold function attribute in LLVM IR.

This patch adds support of hot function attribute to LLVM IR.  This
attribute will be used in setting function section prefix/suffix.
Currently .hot and .unlikely suffix only are added in PGO (Sample PGO)
compilation (through isFunctionHotInCallGraph and
isFunctionColdInCallGraph).

This patch changes the behavior. The new behavior is:
(1) If the user annotates a function as hot or isFunctionHotInCallGraph
    is true, this function will be marked as hot. Otherwise,
(2) If the user annotates a function as cold or
    isFunctionColdInCallGraph is true, this function will be marked as
    cold.

The changes are:
(1) user annotated function attribute will used in setting function
    section prefix/suffix.
(2) hot attribute overwrites profile count based hotness.
(3) profile count based hotness overwrite user annotated cold attribute.

The intention for these changes is to provide the user a way to mark
certain function as hot in cases where training input is hard to cover
all the hot functions.

Differential Revision: https://reviews.llvm.org/D92493
The file was addedllvm/test/CodeGen/X86/hot-unlikely-section-prefix.ll
The file was modifiedclang/lib/CodeGen/CGCall.cpp
The file was modifiedllvm/docs/LangRef.rst
The file was modifiedllvm/test/Bitcode/attributes.ll
The file was addedllvm/test/MC/AsmParser/function_hot_attr.ll
The file was modifiedllvm/include/llvm/IR/Attributes.td
The file was modifiedllvm/lib/Bitcode/Writer/BitcodeWriter.cpp
The file was modifiedclang/test/CodeGen/attributes.c
The file was modifiedllvm/lib/Bitcode/Reader/BitcodeReader.cpp
The file was modifiedllvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
The file was modifiedllvm/lib/IR/Attributes.cpp
The file was modifiedllvm/lib/IR/Verifier.cpp
The file was modifiedllvm/lib/CodeGen/CodeGenPrepare.cpp
The file was modifiedclang/lib/CodeGen/CodeGenModule.cpp
The file was modifiedllvm/include/llvm/Bitcode/LLVMBitCodes.h
The file was modifiedllvm/lib/AsmParser/LLParser.cpp
Commit f6b577ed5bf61078cdcf60e94867b75c94f540a7 by tkeith
[flang] Fix -intrinsic-module-directory in flang script

The flang wrapper script that was created as bin/flang in an in-tree
build did not have a correct -intrinsic-module-directory option.
It was correct for out-of-tree builds and for both kinds of installs.

The fix is to pick the correct directory based on what exists.

The script is no longer configured by cmake (just copied) so that
mechanism can be deleted from the cmake file.

Differential Revision: https://reviews.llvm.org/D93496
The file was removedflang/tools/f18/flang.sh.in
The file was addedflang/tools/f18/flang
The file was modifiedflang/tools/f18/CMakeLists.txt
Commit 31c0b8700b4f531b2353fbb0e72d6934f65814f8 by xur
Fix clang-ppc64le-rhel buildbot build error

ix buildbot build error due to
commit 3733463d: [IR][PGO] Add hot func attribute and use hot/cold
attribute in func section
The file was modifiedllvm/lib/Transforms/Utils/CodeExtractor.cpp
Commit 7087ae7be9f00b95d14bfba41264bbbd8f8711f2 by kai.wang
[RISCV] Remove NoVReg to avoid compile warning messages.
The file was modifiedllvm/lib/Target/RISCV/RISCVRegisterInfo.td
The file was modifiedllvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
Commit b62111671619a78e61b603493478fbac6e487df7 by kazu
[Transforms] Use llvm::erase_if (NFC)
The file was modifiedllvm/lib/Transforms/Scalar/GuardWidening.cpp
The file was modifiedllvm/lib/Transforms/Utils/InlineFunction.cpp
The file was modifiedllvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
The file was modifiedllvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp
The file was modifiedllvm/lib/Transforms/Scalar/IndVarSimplify.cpp
The file was modifiedllvm/lib/Transforms/Scalar/SROA.cpp
The file was modifiedllvm/lib/Transforms/Scalar/SpeculateAroundPHIs.cpp
The file was modifiedllvm/lib/Transforms/Utils/LowerSwitch.cpp