SuccessChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. AMDGPU: Don't assert on unknown address spaces (details)
  2. [lldb/test][Darwin] Ask dyld where the real python is (details)
  3. [PDB] Optimize public symbol processing (details)
  4. Reland [lldb][cmake] Also use local submodule visibility on Darwin (details)
  5. [hwasan] Reset current thread pointer on thread exit. (details)
  6. Fix bugs when an included file name is typo corrected. (details)
  7. Revert "[libc++] ECMAScript IdentityEscape is ambiguous (2584)" (details)
  8. [InstCombine] add tests for known bits before FP casts; NFC (details)
  9. Add an API to construct an XcodeSDK from an SDK type. (details)
  10. Re-land "get rid of PythonInteger::GetInteger()" (details)
  11. [AIX] Make sure we use export lists for plugins (details)
  12. [DAG] SimplifyMultipleUseDemandedBits - remove superfluous bitcasts (details)
  13. [SimplifyCFG] Remap rewritten debug intrinsic operands. (details)
  14. [lld] Add a new output section ".text.unknown" for funtions with unknown hotness (details)
  15. [SampleFDO] For functions without profiles, provide an option to put (details)
  16. [X86] Add assembler support for {vex} prefix to match GNU as. (details)
Commit 78a43f10c701a9cb353e927e9551f32223fbb37d by Matthew.Arsenault
AMDGPU: Don't assert on unknown address spaces

Assume unknown address spaces behave like some flavor of global
memory.
The file was modifiedllvm/lib/Target/AMDGPU/SIISelLowering.cpp
The file was addedllvm/test/Transforms/CodeGenPrepare/AMDGPU/addressing-modes.ll
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
Commit 8cb86ead77417f889bf32a8f83da299215f78545 by Vedant Kumar
[lldb/test][Darwin] Ask dyld where the real python is

Summary:
On macOS, we can't do the DYLD_INSERT_LIBRARIES trick with a shim
python binary as the ASan interceptors get loaded too late. Find the
"real" python binary, copy it, and invoke it.

Hopefully this makes the GreenDragon and swift-ci sanitizer bots
happy...

I tested this out by running `../llvm-macosx-x86_64/bin/llvm-lit test
--filter TestNSDictionarySynthetic.py` in an ASanified swift-lldb build
directory and it worked (i.e. no more "interceptors loaded too late"
messages).

Reviewers: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D79607
The file was addedlldb/test/API/get_darwin_real_python.py
The file was modifiedlldb/test/API/lldbtest.py
Commit 3b3e28a07cf5482db27581ecf23f6364b912f733 by rnk
[PDB] Optimize public symbol processing

Reduces time to link PGO instrumented net_unittets.exe by 11% (9.766s ->
8.672s, best of three). Reduces peak memory by 65.7MB (2142.71MB ->
2076.95MB).

Use a more compact struct, BulkPublic, for faster sorting. Sort in
parallel. Construct the hash buckets in parallel. Try to use one vector
to hold all the publics instead of copying them from one to another.
Allocate all the memory needed to serialize publics up front, and then
serialize them in place in parallel.

Reviewed By: aganea, hans

Differential Revision: https://reviews.llvm.org/D79467
The file was modifiedlld/COFF/PDB.cpp
The file was modifiedllvm/include/llvm/DebugInfo/PDB/Native/GSIStreamBuilder.h
The file was modifiedllvm/lib/DebugInfo/PDB/Native/GSIStreamBuilder.cpp
Commit fcf10d19081029a0b6aa6933b72c63425425866a by Raphael Isemann
Reland [lldb][cmake] Also use local submodule visibility on Darwin

Relanding this as D79632 should fix the macOS tests with this option.

Original commit:

Summary:
Currently building LLVM on macOS and on other platforms with LLVM_ENABLE_MODULES is using different module flags,
which means that a passing modules build on macOS might fail on Linux and vice versa. -fmodules-local-submodule-visibility
is the mode that has clearer semantics and is closer to the actual C++ module standard, so let's make this the default everywhere.

We can still test building without local submodule visibility on an additional bot by just changing the respective CMake flag. However,
if building without local-submodule-visibility breaks we won't revert other commits and we won't loose LLDB's/Clang's test run
information.

Reviewers: aprantl, bruno, Bigcheese

Reviewed By: Bigcheese

Subscribers: abidh, dexonsmith, JDevlieghere, lldb-commits, mgorny, llvm-commits

Tags: #llvm, #lldb

Differential Revision: https://reviews.llvm.org/D74892
The file was modifiedllvm/CMakeLists.txt
Commit eaea9ed83509d283db40aeeb324f2d4b235e816b by eugenis
[hwasan] Reset current thread pointer on thread exit.

Summary:
This is necessary to handle calls to free() after __hwasan_thread_exit,
which is possible in glibc.

Also, add a null check to GetCurrentThread, otherwise the logic in
GetThreadByBufferAddress turns it into a non-null value. This means that
all of the checks for GetCurrentThread() != nullptr do not have any
effect at all right now!

Reviewers: pcc, hctim

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D79608
The file was addedcompiler-rt/test/hwasan/TestCases/libc_thread_freeres.c
The file was modifiedcompiler-rt/lib/hwasan/hwasan_thread.cpp
The file was modifiedcompiler-rt/lib/hwasan/hwasan.cpp
The file was modifiedcompiler-rt/lib/hwasan/hwasan_linux.cpp
Commit 51d938bc94433b03cfbe60758642dbe70269ae3b by thakis
Fix bugs when an included file name is typo corrected.

D52774 fixed a bug with typo correction of includes, but didn't add
a test.

D65907 then broke recovery of typo correction of includes again,
because it extracted the code that writes to Filename to a separate
function that took the parameter not by reference.

Fix that, and also don't repeat the slash normalization computation
and fix both lookup and regular file name after recovery.

Differential Revision: https://reviews.llvm.org/D79595
The file was modifiedclang/test/Lexer/case-insensitive-include-win.c
The file was modifiedclang/test/Lexer/case-insensitive-include-pr31836.sh
The file was modifiedclang/lib/Lex/PPDirectives.cpp
The file was modifiedclang/include/clang/Lex/Preprocessor.h
Commit 26466efe0879dde8772bc336d81fcccaa9514b3a by zoecarver
Revert "[libc++] ECMAScript IdentityEscape is ambiguous (2584)"

This reverts commit 6d2a66b10d458e34c852be46028092d2b46edc14.

The regex expressions in some lld tests need to be fixed. Reverting
until those are fixed.
The file was modifiedlibcxx/www/cxx1z_status.html
The file was modifiedlibcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp
The file was modifiedlibcxx/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp
The file was modifiedlibcxx/include/regex
Commit df5c9fdaacfce40b192350fcff520620dbd45f77 by spatel
[InstCombine] add tests for known bits before FP casts; NFC
The file was modifiedllvm/test/Transforms/InstCombine/sitofp.ll
Commit ae920a81ffa3c7e3c14de131d0d55abd31bbff7d by Adrian Prantl
Add an API to construct an XcodeSDK from an SDK type.

Also, this moves numSDKs out of the actual enum, as to not mess with
the switch-cases-covered warning.

Differential Revision: https://reviews.llvm.org/D79603
The file was modifiedlldb/unittests/Utility/XcodeSDKTest.cpp
The file was modifiedlldb/include/lldb/Utility/XcodeSDK.h
The file was modifiedlldb/source/Utility/XcodeSDK.cpp
Commit 52712d3ff7a2f7bcf737996d6ab59ef2cc29c20d by lawrence_danna
Re-land "get rid of PythonInteger::GetInteger()"

This was reverted due to a python2-specific bug.  Re-landing with a fix
for python2.

Summary:
One small step in my long running quest to improve python exception handling in
LLDB.  Replace GetInteger() which just returns an int with As<long long> and
friends, which return Expected types that can track python exceptions

Reviewers: labath, jasonmolenda, JDevlieghere, vadimcn, omjavaid

Reviewed By: labath, omjavaid

Subscribers: omjavaid, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D78462
The file was modifiedlldb/bindings/python/python-typemaps.swig
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
The file was modifiedlldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp
The file was modifiedlldb/bindings/python/python-wrapper.swig
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
The file was modifiedlldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
Commit d26a8daa491ce56ef719708f2dbefb519c4c2f3e by daltenty
[AIX] Make sure we use export lists for plugins

Summary:
Besides just generating and consuming the lists, this includes:

* Calling  nm with the right options in extract_symbols.py. Such as not
  demangling C++ names, which AIX nm does by default, and accepting both
  32/64-bit names.
* Not having nm sort the list of symbols or we may run in to memory
   issues on debug builds, as nm calls a 32-bit sort.
* Defaulting to having LLVM_EXPORT_SYMBOLS_FOR_PLUGINS on for AIX
* CMake versions prior to 3.16 set the -brtl linker flag globally on
   AIX. Clear it out early on so we don't run into failures. We will set
   it as needed.

Reviewers: jasonliu, DiggerLin, stevewan, hubert.reinterpretcast

Reviewed By: hubert.reinterpretcast

Subscribers: hubert.reinterpretcast, mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70972
The file was modifiedllvm/cmake/modules/AddLLVM.cmake
The file was modifiedllvm/cmake/modules/HandleLLVMOptions.cmake
The file was modifiedllvm/CMakeLists.txt
The file was modifiedllvm/utils/extract_symbols.py
Commit 70293ba26feecdab6fe3c0e71503424f0d38e838 by llvm-dev
[DAG] SimplifyMultipleUseDemandedBits - remove superfluous bitcasts

If the SimplifyMultipleUseDemandedBits calls BITCASTs that peek through back to the original type then we can remove the BITCASTs entirely.

Differential Revision: https://reviews.llvm.org/D79572
The file was modifiedllvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
The file was modifiedllvm/test/CodeGen/X86/shrink_vmul.ll
The file was modifiedllvm/test/CodeGen/X86/div-rem-pair-recomposition-unsigned.ll
The file was modifiedllvm/test/CodeGen/X86/vec_smulo.ll
The file was modifiedllvm/test/CodeGen/X86/vec_umulo.ll
The file was modifiedllvm/test/CodeGen/X86/vector-reduce-mul.ll
The file was modifiedllvm/test/CodeGen/Thumb2/lsll0.ll
The file was modifiedllvm/test/CodeGen/AMDGPU/fshr.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-vld3.ll
The file was modifiedllvm/test/CodeGen/X86/bitcast-vector-bool.ll
The file was modifiedllvm/test/CodeGen/X86/div-rem-pair-recomposition-signed.ll
Commit b38d77f185c53cb4bf108f0c29df1d6d7cfe13b4 by Vedant Kumar
[SimplifyCFG] Remap rewritten debug intrinsic operands.

FoldBranchToCommonDest clones instructions to a different basic block,
but handles debug intrinsics in a separate path. Previously, when
cloning debug intrinsics, their operands were not updated to reference
the correct cloned values. As a result, we would emit debug.value
intrinsics with broken operand references which are discarded in later
passes. This leads to incorrect debuginfo that reports incorrect values
for variables.

Fix this by remapping debug intrinsic operands when cloning them.

Fixes https://bugs.llvm.org/show_bug.cgi?id=45667.

Differential Revision: https://reviews.llvm.org/D79602
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
The file was addedllvm/test/DebugInfo/simplify-cfg-preserve-dbg-values.ll
Commit 538208f6c0cb5c95d5ea8f4805f3abf8aaf418f9 by wmi
[lld] Add a new output section ".text.unknown" for funtions with unknown hotness

For sampleFDO, because the optimized build uses profile generated from previous
release, often we couldn't tell a function without profile was truely cold or
just newly created so we had to treat them conservatively and put them in .text
section instead of .text.unlikely. The result was when we persue the best
performance by locking .text.hot and .text in memory, we wasted a lot of memory
to keep cold functions inside. This problem has been largely solved for regular
sampleFDO using profile-symbol-list (https://reviews.llvm.org/D66374), but for
the case when we use partial profile, we still waste a lot of memory because
of it.

In https://reviews.llvm.org/D62540, we propose to save functions with unknown
hotness information in a special section called ".text.unknown", so that
compiler will treat those functions as luck-warm, but runtime can choose not
to mlock the special section in memory or use other strategy to save memory.
That will solve most of the memory problem even if we use a partial profile.

The patch adds the support in lld for the special section.For sampleFDO,
because the optimized build uses profile generated from previous release,
often we couldn't tell a function without profile was truely cold or just
newly created so we had to treat them conservatively and put them in .text
section instead of .text.unlikely. The result was when we persue the best
performance by locking .text.hot and .text in memory, we wasted a lot of
memory to keep cold functions inside. This problem has been largely solved
for regular sampleFDO using profile-symbol-list
(https://reviews.llvm.org/D66374), but for the case when we use partial
profile, we still waste a lot of memory because of it.

In https://reviews.llvm.org/D62540, we propose to save functions with unknown
hotness information in a special section called ".text.unknown", so that
compiler will treat those functions as luck-warm, but runtime can choose not
to mlock the special section in memory or use other strategy to save memory.
That will solve most of the memory problem even if we use a partial profile.

The patch adds the support in lld for the special section.

Differential Revision: https://reviews.llvm.org/D79590
The file was modifiedlld/ELF/Writer.cpp
The file was modifiedlld/test/ELF/text-section-prefix.s
Commit aa2ddfc73d6e4a3369b7992aecaf107987c505b6 by wmi
[SampleFDO] For functions without profiles, provide an option to put
them in a special text section.

For sampleFDO, because the optimized build uses profile generated from
previous release, previously we couldn't tell a function without profile
was truely cold or just newly created so we had to treat them conservatively
and put them in .text section instead of .text.unlikely. The result was when
we persuing the best performance by locking .text.hot and .text in memory,
we wasted a lot of memory to keep cold functions inside.

In https://reviews.llvm.org/D66374, we introduced profile symbol list to
discriminate functions being cold versus functions being newly added.
This mechanism works quite well for regular use cases in AutoFDO. However,
in some case, we can only have a partial profile when optimizing a target.
The partial profile may be an aggregated profile collected from many targets.
The profile symbol list method used for regular sampleFDO profile is not
applicable to partial profile use case because it may be too large and
introduce many false positives.

To solve the problem for partial profile use case, we provide an option called
--profile-unknown-in-special-section. For functions without profile, we will
still treat them conservatively in compiler optimizations -- for example,
treat them as warm instead of cold in inliner. When we use profile info to
add section prefix for functions, we will discriminate functions known to be
not cold versus functions without profile (being unknown), and we will put
functions being unknown in a special text section called .text.unknown.
Runtime system will have the flexibility to decide where to put the special
section in order to achieve a balance between performance and memory saving.

Differential Revision: https://reviews.llvm.org/D62540
The file was modifiedllvm/lib/Analysis/ProfileSummaryInfo.cpp
The file was modifiedllvm/lib/CodeGen/CodeGenPrepare.cpp
The file was modifiedllvm/include/llvm/Analysis/ProfileSummaryInfo.h
The file was modifiedllvm/test/Transforms/SampleProfile/section-accurate-samplepgo.ll
Commit adf3b8e366160aaf7f6a55ecec8f5d0342a40dd3 by craig.topper
[X86] Add assembler support for {vex} prefix to match GNU as.

This does the same thing as {vex2}. Which is give an error
if the instruction can't be done with VEX. It doesn't force
the instruction to use 2 byte VEX. That's already the preference
if its possible. Therefore {vex} is a clearer name.
The file was modifiedllvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
The file was modifiedllvm/test/MC/X86/x86_errors.s