SuccessChanges

Summary

  1. [AArch64] __builtin_return_address for PAuth. (details)
  2. [CUDA] Added conversion functions to builtin vars. (details)
  3. [CodeGen] Postprocess PHI nodes for callbr (details)
  4. Fix testcase. (details)
  5. Revert "[CodeGen] Postprocess PHI nodes for callbr" (details)
  6. [NFCI][IR] ConstantRangeTest: refactor operation range gatherers (details)
  7. [NFCI][IR] ConstantRangeTest: add basic scaffolding for next-gen precision/correctness testing (details)
  8. Reland [CodeGen] emit CG profile for COFF object file (details)
  9. Temporary fix for D85085 debug_loc bug with basic block sections. (details)
  10. [DebugInfo] Fix bug in constructor homing with classes with trivial (details)
  11. [LLDB] Add a defensive check for member__f_ (details)
  12. [WebAssembly] Make SjLj lowering globals thread-local (details)
  13. [Instruction] Add dropLocation and updateLocationAfterHoist helpers (details)
  14. [lld-macho][re-land] Initial support for common symbols (details)
  15. [lld-macho][re-land] Implement and test resolution of common symbols (details)
  16. [lld] Make -z keep-text-section-prefix recognize .text.split. as a prefix. (details)
  17. Fix regex in test. (details)
  18. [OpenMP] OpenMPOpt Support for Globalization Remarks (details)
  19. [llvm] Add -bbsections-cold-text-prefix to emit cold clusters to a different section. (details)
  20. [RISCV] Merge the pipeline models for Rocket (details)
  21. [AMDGPU] Fixes typo in the test. NFC. (details)
  22. [MS] Simplify rules for passing C++ records (details)
  23. [MS] For unknown ISAs, pass non-trivially copyable arguments indirectly (details)
  24. [intel-pt] Refactor the JSON parsing (details)
  25. Add a static_assert confirming that DiagnosticBuilder is small (details)
  26. Revert "Add a static_assert confirming that DiagnosticBuilder is small" (details)
  27. Revert "[NFCI][IR] ConstantRangeTest: add basic scaffolding for next-gen precision/correctness testing" (details)
Commit 2a96f47c5ffca84cd774ad402cacd137f4bf45e2 by daniel.kiss
[AArch64] __builtin_return_address for PAuth.

This change adds the support for __builtin_return_address
for ARMv8.3A Pointer Authentication.
Location of the authentication code in the pointer depends on
the system configuration, therefore a dedicated instruction is used for
effectively removing the authentication code without
authenticating the pointer.

Reviewed By: chill

Differential Revision: https://reviews.llvm.org/D75044
The file was modifiedllvm/test/CodeGen/AArch64/arm64_32.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64ISelLowering.cpp
The file was addedllvm/test/CodeGen/AArch64/aarch64-signedreturnaddress.ll
The file was modifiedllvm/test/CodeGen/AArch64/returnaddr.ll
The file was modifiedllvm/test/CodeGen/AArch64/arm64-returnaddr.ll
The file was modifiedllvm/include/llvm/CodeGen/ISDOpcodes.h
Commit 30514f0afa3ee1e6da6bf9c41e83c28e884f0740 by tra
[CUDA] Added conversion functions to builtin vars.

This is needed to compile some headers in CUDA-11 that assume that threadIdx is
implicitly convertible to dim3. With NVCC, threadIdx is uint3 and there's
dim3(uint3) constructor. Clang uses a special type for the builtin variables, so
that path does not work. Instead, this patch adds conversion function to the
builtin variable classes. that will allow them to be converted to dim3 and uint3.

Differential Revision: https://reviews.llvm.org/D88250
The file was modifiedclang/lib/Headers/__clang_cuda_runtime_wrapper.h
The file was modifiedclang/lib/Headers/__clang_cuda_builtin_vars.h
Commit 7f4c940bd0b526f25e11c51bb4d58a85024330ae by isanbard
[CodeGen] Postprocess PHI nodes for callbr

When processing PHI nodes after a callbr, we need to make sure that the
PHI nodes on the default branch are resolved after the callbr
(inserted after INLINEASM_BR). The PHI node values on the indirect
branches are processed before the INLINEASM_BR.

Differential Revision: https://reviews.llvm.org/D86260
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
The file was addedllvm/test/CodeGen/X86/callbr-asm-phi-nodes.ll
Commit f97b68ef4ddd28a685e502653768c2a34c314cba by isanbard
Fix testcase.
The file was modifiedclang/test/Modules/asm-goto.c
Commit 0c0c57f7b21bee1cda0fce83d9919a57764bd74e by isanbard
Revert "[CodeGen] Postprocess PHI nodes for callbr"

Accidental commit.

This reverts commit 7f4c940bd0b526f25e11c51bb4d58a85024330ae.
The file was removedllvm/test/CodeGen/X86/callbr-asm-phi-nodes.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Commit 31177949cb1d88d7dd32078d09a265b828d40826 by lebedev.ri
[NFCI][IR] ConstantRangeTest: refactor operation range gatherers

We do the same dance to acquire the "exact" range of an op via
an exhaustive approach in many places.
Let's not invent the wheel each time.
The file was modifiedllvm/unittests/IR/ConstantRangeTest.cpp
Commit 9bcf7b1c7a139a455400df109d81c638b9e75150 by lebedev.ri
[NFCI][IR] ConstantRangeTest: add basic scaffolding for next-gen precision/correctness testing

I have long complained that while we have exhaustive tests
for ConstantRange, they are, uh, not good.

The approach of groking our own constant range
via exhaustive enumeration is, mysterious.

It neither tells us without doubt that the result is
conservatively correct, nor the precise match to the ConstantRange
result tells us that the result is precise.
But yeah, it's fast, i give it that.

In short, there are three things that we need to check:
1. That ConstantRange result is conservatively correct
2. That ConstantRange range is reasonable
3. That ConstantRange result is reasonably precise

So let's not just check the middle one, but all three.

This provides precision test coverage for D88178.
The file was modifiedllvm/unittests/IR/ConstantRangeTest.cpp
Commit 506b6170cb513f1cb6e93a3b690c758f9ded18ac by zequanwu
Reland [CodeGen] emit CG profile for COFF object file

This reverts commit 90242caca2074dab5a9b76e5bc36d9fafd2179a7.

Error fixed at f5435399e823746bbe1737b95c853d77a42e1ac3

Differential Revision: https://reviews.llvm.org/D87811
The file was modifiedllvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
The file was modifiedllvm/lib/Target/TargetLoweringObjectFile.cpp
The file was modifiedllvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
The file was modifiedllvm/include/llvm/Target/TargetLoweringObjectFile.h
The file was addedllvm/test/MC/COFF/cgprofile.ll
Commit e39286510deb59730c40fa662a44e73f484ea1c2 by tmsriram
Temporary fix for D85085 debug_loc bug with basic block sections.

Until then, this one line fix removes the assert fail with basic block sections
with debug info. Bug tracking this: #47549
This fix does not generate loc list or DW_AT_const_value if the argument is
mentioned in a different section than the start of the function.

Temporarily fixes bugzilla : https://bugs.llvm.org/show_bug.cgi?id=47549

Differential Revision: https://reviews.llvm.org/D87787
The file was addedllvm/test/DebugInfo/X86/basic-block-sections-debug-loc.ll
The file was modifiedllvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
Commit c8df781e54a43593eafd993a5a5cd647866955f8 by akhuang
[DebugInfo] Fix bug in constructor homing with classes with trivial
constructors.

This changes the code to avoid using constructor homing for aggregate
classes and classes with trivial default constructors, instead of trying
to loop through the constructors.

Differential Revision: https://reviews.llvm.org/D87808
The file was modifiedclang/lib/CodeGen/CGDebugInfo.cpp
The file was modifiedclang/test/CodeGenCXX/debug-info-limited-ctor.cpp
Commit a079f619b5a1959af8af37cabdea27ae542903db by shafik
[LLDB] Add a defensive check for member__f_

I only have a crash log and was not able to come up with a test case for this.

rdar://problem/69403150
The file was modifiedlldb/source/Plugins/LanguageRuntime/CPlusPlus/CPPLanguageRuntime.cpp
Commit 1c5a3c4d382353e582ecf4913e338599028e267f by tlively
[WebAssembly] Make SjLj lowering globals thread-local

Emscripten's longjump and exception mechanism depends on two global variables,
`__THREW__` and `__threwValue`, which are changed to be defined as thread-local
in https://github.com/emscripten-core/emscripten/pull/12056. This patch updates
the corresponding code in the WebAssembly backend to properly declare these
globals as thread-local as well.

Differential Revision: https://reviews.llvm.org/D88262
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
The file was modifiedllvm/test/CodeGen/WebAssembly/lower-em-exceptions.ll
The file was modifiedllvm/test/CodeGen/WebAssembly/lower-em-sjlj.ll
Commit dfc5a9eb57aaaac972764bf731503419284bd3dc by Vedant Kumar
[Instruction] Add dropLocation and updateLocationAfterHoist helpers

Introduce a helper which can be used to update the debug location of an
Instruction after the instruction is hoisted. This can be used to safely
drop a source location as recommended by the docs.

For more context, see the discussion in https://reviews.llvm.org/D60913.

Differential Revision: https://reviews.llvm.org/D85670
The file was modifiedllvm/lib/IR/DebugInfo.cpp
The file was modifiedllvm/test/Transforms/LICM/hoisting-preheader-debugloc.ll
The file was modifiedllvm/unittests/IR/InstructionsTest.cpp
The file was modifiedllvm/test/Transforms/GVN/PRE/phi-translate.ll
The file was modifiedllvm/include/llvm/IR/Instruction.h
The file was modifiedllvm/lib/Transforms/Scalar/GVN.cpp
The file was modifiedllvm/lib/Transforms/Scalar/LICM.cpp
The file was modifiedllvm/test/DebugInfo/Generic/licm-hoist-debug-loc.ll
Commit c32e69b2ce7abfb151a87ba363ac9e25abf7d417 by jezng
[lld-macho][re-land] Initial support for common symbols

Fix earlier build break via a static_cast.

This reverts commit 8112d494d344dc0935d5c078f066a43d7c984e0c.

Differential Revision: https://reviews.llvm.org/D86909
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/MachO/SymbolTable.cpp
The file was modifiedlld/MachO/SyntheticSections.h
The file was modifiedlld/MachO/Symbols.h
The file was modifiedlld/MachO/InputFiles.cpp
The file was modifiedlld/MachO/SymbolTable.h
The file was addedlld/test/MachO/common-symbol-coalescing.s
Commit 5213576fa25e6deb7c649032b2893726de2f8b6c by jezng
[lld-macho][re-land] Implement and test resolution of common symbols

Earlier build break fixed in c32e69b2ce7abfb151a87ba363ac9e25abf7d417.

This reverts commit c367f93e8539c4d0bcdc86ad7ea7923e06231a93.
The file was addedlld/test/MachO/common-symbol-resolution.s
The file was modifiedlld/MachO/SymbolTable.cpp
The file was modifiedlld/test/MachO/nonweak-definition-override.s
Commit 070555c6c008c57c408c1e99025b12c5d71c9848 by snehasishk
[lld] Make -z keep-text-section-prefix recognize .text.split. as a prefix.

".text.split." holds symbols which are split out from functions in
other input sections. For example, with -fsplit-machine-functions,
placing the cold parts in .text.split instead of .text.unlikely mitigates
against poor profile inaccuracy. Techniques such as hugepage remapping can
make conservative decisions at the section granularity.

Differential Revision: https://reviews.llvm.org/D87840
The file was modifiedlld/test/ELF/text-section-prefix.s
The file was modifiedlld/ELF/Writer.cpp
Commit c9b53b3bf20d20d5752876be32a9e5887c702e53 by isanbard
Fix regex in test.
The file was modifiedclang/test/Modules/asm-goto.c
Commit a22814194e8ea8d581a26992bb27f808e53bbbde by jhuber6
[OpenMP] OpenMPOpt Support for Globalization Remarks

Summary:
This patch add support for printing analysis messages relating to data
globalization on the GPU. This occurs when data is shared between the
threads in a GPU context and must be pushed to global or shared memory.

Reviewers: jdoerfert

Subscribers: guansong hiraditya llvm-commits ormris sstefan1 yaxunl

Tags: #OpenMP #LLVM

Differential Revision: https://reviews.llvm.org/D88243
The file was addedllvm/test/Transforms/OpenMP/globalization_remarks.ll
The file was modifiedllvm/include/llvm/Frontend/OpenMP/OMPKinds.def
The file was modifiedllvm/lib/Transforms/IPO/OpenMPOpt.cpp
Commit d2696dec45cdcff791cd53b8b8288d33a0d8dddb by snehasishk
[llvm] Add -bbsections-cold-text-prefix to emit cold clusters to a different section.

This change adds an option to basic block sections to allow cold
clusters to be assigned a custom text prefix. With a custom prefix such
as ".text.split." (D87840), lld can place them in a separate output section.
The benefits are -

* Empirically shown to improve icache and itlb metrics by 3-5%
(absolute) compared to placing split parts in .text.unlikely.
* Mitigates against poor profiles, eg samplePGO profiles used with the
machine function splitter. Optimizations such as hugepage remapping can
make different decisions at the section granularity.
* Enables section granularity hotness monitoring (checking on the
decisions made during compilation vs sample data from production).

Differential Revision: https://reviews.llvm.org/D87813
The file was modifiedllvm/lib/CodeGen/BasicBlockSections.cpp
The file was modifiedllvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
The file was modifiedllvm/test/CodeGen/X86/basic-block-sections-cold.ll
The file was modifiedllvm/include/llvm/CodeGen/BasicBlockSectionUtils.h
Commit 1e66e723eb66c19080f259ca7b4c165bfc1f8d08 by ebahapo
[RISCV] Merge the pipeline models for Rocket

Merge the 32 and 64 bit pipeline models for Rocket into a single file.

Differential Revision: https://reviews.llvm.org/D87873
The file was removedllvm/lib/Target/RISCV/RISCVSchedRocket32.td
The file was modifiedllvm/lib/Target/RISCV/RISCV.td
The file was addedllvm/lib/Target/RISCV/RISCVSchedRocket.td
The file was removedllvm/lib/Target/RISCV/RISCVSchedRocket64.td
Commit 43804364e2bc2bd586740dbb0b7aae2137c130cc by Stanislav.Mekhanoshin
[AMDGPU] Fixes typo in the test. NFC.

denormal-fp-math-fp32 -> denormal-fp-math-f32
The file was modifiedllvm/test/CodeGen/AMDGPU/global-atomics-fp.ll
Commit b8a50e920704436ddcbe0cc9d2020935d7e37095 by rnk
[MS] Simplify rules for passing C++ records

Regardless of the target architecture, we should always use the C rules
(RAA_Default) for records that "canBePassedInRegisters". Those are
trivially copyable things, and things marked with [[trivial_abi]].

This should be NFC, although it changes where the final decision about
x86_32 overaligned records is made. The current x86_32 C rules say that
overaligned things are passed indirectly, so there is no functional
difference.
The file was modifiedclang/lib/CodeGen/MicrosoftCXXABI.cpp
The file was modifiedclang/test/CodeGenCXX/inalloca-overaligned.cpp
Commit ecfc9b971269a86b101cddf1fd9f0976be4096d0 by rnk
[MS] For unknown ISAs, pass non-trivially copyable arguments indirectly

Passing them directly is likely to be non-conforming, since it usually
involves copying the bytes of the record. For unknown architectures, we
don't know what MSVC does or will do, but we should at least try to
conform as well as we can.
The file was modifiedclang/lib/CodeGen/MicrosoftCXXABI.cpp
The file was addedclang/test/CodeGenCXX/microsoft-abi-unknown-arch.cpp
Commit bddebca61ea73d45d5eafc38aaf9fe7605f5a9b3 by walter erquinigo
[intel-pt] Refactor the JSON parsing

Recently https://reviews.llvm.org/D88103 introduced a nice API for
converting a JSON object into C++ types, which include nice error
messaging.

I'm using that new functioniality to perform the parsing in a much more
elegant way. As a result, the code looks simpler and more maintainable,
as we aren't parsing anymore individual fields manually.

I updated the test cases accordingly.

Differential Revision: https://reviews.llvm.org/D88264
The file was modifiedlldb/source/Target/TraceSettingsParser.cpp
The file was modifiedlldb/include/lldb/Target/Trace.h
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp
The file was addedlldb/test/API/commands/trace/intelpt-trace/trace_bad4.json
The file was modifiedlldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.h
The file was modifiedlldb/source/Target/Trace.cpp
The file was modifiedlldb/include/lldb/Target/TraceSettingsParser.h
The file was modifiedlldb/test/API/commands/trace/TestTraceLoad.py
The file was addedlldb/test/API/commands/trace/intelpt-trace/trace_bad5.json
Commit a32feed0dbeac7606d042d0d7e041c9eaf12cd51 by rnk
Add a static_assert confirming that DiagnosticBuilder is small
The file was modifiedclang/lib/Basic/Diagnostic.cpp
Commit 276f68eace7c27f6805d69a30a4b2f186e42c56c by rnk
Revert "Add a static_assert confirming that DiagnosticBuilder is small"

This reverts commit a32feed0dbeac7606d042d0d7e041c9eaf12cd51.

This assert doesn't hold in 32-bit builds, I didn't do the math right.
The file was modifiedclang/lib/Basic/Diagnostic.cpp
Commit 495a5e94baadefa6ed50390e6655021c127ea266 by rnk
Revert "[NFCI][IR] ConstantRangeTest: add basic scaffolding for next-gen precision/correctness testing"

This reverts commit 9bcf7b1c7a139a455400df109d81c638b9e75150.

Breaks build with MSVC.
The file was modifiedllvm/unittests/IR/ConstantRangeTest.cpp