LLVM/llvm 369854llvm/trunk/lib/Analysis TargetLibraryInfo.cpp

[TLI] Simplify code. NFCI.

LLVM/llvm 369853clang-tools-extra/trunk/test/clang-tidy duplicate-reports.cpp

[clang-tidy] Manually enable exceptions in tesst that uses them

LLVM/llvm 369852llvm/trunk/include/llvm/MC SubtargetFeature.h

Hack around a GCC ICE that was fixed in GCC 6.2

lib/Target/X86/AsmParser/X86AsmParser.cpp: In member function ‘void 
{anonymous}::X86AsmParser::SwitchMode(unsigned int)’:
lib/Target/X86/AsmParser/X86AsmParser.cpp:927:76:   in constexpr expansion of 
‘AllModes.llvm::FeatureBitset::FeatureBitset(std::initializer_list<unsigned int>{((const 
unsigned int*)(& ._157)), 3u})’
include/llvm/MC/SubtargetFeature.h:56:12:   in constexpr expansion of 
‘llvm::FeatureBitset::set(I)’
lib/Target/X86/AsmParser/X86AsmParser.cpp:927:76: internal compiler error: in 
fold_binary_loc, at fold-const.c:9921
     FeatureBitset AllModes({X86::Mode64Bit, X86::Mode32Bit, X86::Mode16Bit});
                                                                            ^

LLVM/llvm 369851llvm/trunk/include/llvm/MC SubtargetFeature.h

Try to make MSVC 2017 happy.

AArch64BaseInfo.h(316): error C3615: constexpr function 'llvm::SysAlias::SysAlias' cannot 
result in a constant expression
AArch64BaseInfo.h(316): note: failure was caused by call of undefined function or one not 
declared 'constexpr'
AArch64BaseInfo.h(316): note: see usage of 'llvm::FeatureBitset::FeatureBitset'

LLVM/llvm 369850llvm/trunk/include/llvm/Analysis TargetLibraryInfo.h, llvm/trunk/lib/Analysis TargetLibraryInfo.cpp

Fix some accidental global initializers by using StringLiteral instead of StringRef

LLVM/llvm 369849llvm/trunk/test/TableGen generic-tables-instruction.td generic-tables.td

Update tablegen test after r369847.

LLVM/llvm 369848llvm/trunk/tools/llvm-reduce/deltas ReduceGlobalVars.cpp

[llvm-reduce] Silence -Wdocumentation

ReduceGlobalVars.cpp:17:6: warning: '@returns' command used in a comment that is attached 
to a function returning void

LLVM/llvm 369847llvm/trunk/include/llvm/MC SubtargetFeature.h, llvm/trunk/lib/Target/AArch64/Utils AArch64BaseInfo.h

Use a bit of relaxed constexpr to make FeatureBitset costant intializable

This requires std::intializer_list to be a literal type, which it is
starting with C++14. The downside is that std::bitset is still not
constexpr-friendly so this change contains a re-implementation of most
of it.

Shrinks clang by ~60k.

LLVM/llvm 369846cfe/trunk/lib/Sema SemaLookup.cpp, cfe/trunk/utils/TableGen ClangOpenCLBuiltinEmitter.cpp

[OpenCL] Microoptimize OCL2Qual a bit

Still not optimal, but makes clang 25k smaller.

LLVM/llvm 369845cfe/trunk/lib/Frontend CompilerInvocation.cpp, cfe/trunk/tools/scan-build/bin scan-build

[analyzer] Analysis: Fix checker silencing

LLVM/llvm 369844lld/trunk/ELF Writer.cpp

[ELF] Simplify with less_second. NFC

LLVM/llvm 369843cfe/trunk/test/CodeGenCXX lifetime-sanitizer.cpp

[Testing] Unbreak r369830

LLVM/llvm 369842llvm/trunk/include/llvm/IR Constant.h, llvm/trunk/lib/IR Constants.cpp

[Constant] Add 'isElementWiseEqual()' method

Promoting it from InstCombine's tryToReuseConstantFromSelectInComparison().

Return true if this constant and a constant 'Y' are element-wise equal.
This is identical to just comparing the pointers, with the exception that
for vectors, if only one of the constants has an `undef` element in some
lane, the constants still match.

LLVM/llvm 369841llvm/trunk/lib/Transforms/InstCombine InstCombineCompares.cpp, llvm/trunk/test/Transforms/InstCombine unrecognized_three-way-comparison.ll

[InstCombine] matchThreeWayIntCompare(): commutativity awareness

Summary:
`matchThreeWayIntCompare()` looks for
```
   select i1 (a == b),
          i32 Equal,
          i32 (select i1 (a < b), i32 Less, i32 Greater)
```
but both of these selects/compares can be in it's commuted form,
so out of 8 variants, only the two most basic ones is handled.
This fixes regression being introduced in D66232.

Reviewers: spatel, nikic, efriedma, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66607

LLVM/llvm 369840llvm/trunk/lib/Transforms/InstCombine InstCombineSelect.cpp InstCombineCompares.cpp, llvm/trunk/test/Transforms/InstCombine reuse-constant-from-select-in-icmp.ll canonicalize-clamp-with-select-of-constant-threshold-pattern.ll

[InstCombine] Try to reuse constant from select in leading comparison

Summary:
If we have e.g.:
```
  %t = icmp ult i32 %x, 65536
  %r = select i1 %t, i32 %y, i32 65535
```
the constants `65535` and `65536` are suspiciously close.
We could perform a transformation to deduplicate them:
```
Name: ult
%t = icmp ult i32 %x, 65536
%r = select i1 %t, i32 %y, i32 65535
  =>
%t.inv = icmp ugt i32 %x, 65535
%r = select i1 %t.inv, i32 65535, i32 %y
```
https://rise4fun.com/Alive/avb

While this may seem esoteric, this should certainly be good for vectors
(less constant pool usage) and for opt-for-size - need to have only one constant.

But the real fun part here is that it allows further transformation,
in particular it finishes cleaning up the `clamp` folding,

    [47 lines not shown]

LLVM/llvm 369839llvm/trunk/test/Transforms/InstCombine reuse-constant-from-select-in-icmp.ll

[InstCombine][NFC] reuse-constant-from-select-in-icmp.ll - revisit tests

LLVM/llvm 369838lld/trunk/ELF Writer.cpp

[ELF] Make member function Writer<ELFT>::removeEmptyPTLoad non-member. NFC

LLVM/llvm 369837llvm/trunk/lib/Target/X86 X86ISelLowering.cpp

[X86] Add an assert to mark more code that needs to be removed when the vector widening 
legalization switch is removed again.

LLVM/llvm 369836llvm/trunk/lib/Transforms/Scalar LoopFuse.cpp

[LoopFusion] Fix -Wunused-function in -DLLVM_ENABLE_ASSERTIONS=off build

LLVM/llvm 369835llvm/trunk/test/MachineVerifier test_g_dyn_stackalloc.mir

Remove unnecessary REQUIRES from a test.

LLVM/llvm 369834cfe/trunk/lib/Sema SemaTemplate.cpp, cfe/trunk/test/SemaCXX cxx1z-class-template-argument-deduction.cpp

PR42513: Enter the proper DeclContext before substituting into an
default template argument expression.

We already did this for type template parameters and template template
parameters, but apparently forgot to do so for non-type template
parameters. This causes the substituted default argument expression to
be substituted in the proper context, and in particular to properly mark
its subexpressions as odr-used.

LLVM/llvm 369833llvm/trunk/include/llvm/Support TargetOpcodes.def, llvm/trunk/include/llvm/Target GenericOpcodes.td

[GlobalISel] Introduce a G_DYN_STACKALLOC opcode to represent dynamic allocas.

This just adds the opcode and verifier, it will be used to replace existing
dynamic alloca handling in a subsequent patch.

Differential Revision: https://reviews.llvm.org/D66677

LLVM/llvm 369832cfe/trunk/unittests/Tooling DependencyScannerTest.cpp

Re-enable DependencyScannerTest on windows with the right fixes

It should now pass.

LLVM/llvm 369831llvm/trunk/test/Transforms/InstCombine lifetime-asan.ll lifetime-sanitizer.ll

NFC: Rename lifetime-asan.ll -> lifetime-sanitizer.ll

LLVM/llvm 369830cfe/trunk/test/CodeGen lifetime-asan.c lifetime-sanitizer.c, cfe/trunk/test/CodeGenCXX lifetime-sanitizer.cpp lifetime-asan.cpp

NFC: Rename some sanitizer related lifetime checks

LLVM/llvm 369829cfe/trunk/lib/Sema SemaDeclCXX.cpp, cfe/trunk/test/CXX/dcl.decl/dcl.decomp p3.cpp

PR40674: fix assertion failure if a structured binding declaration has a
tuple-like decomposition that produces value-dependent reference
bindings.

LLVM/llvm 369828lld/trunk/ELF Writer.cpp, lld/trunk/test/ELF nobits-offset.s relocatable.s

[ELF] Align the first section of a PT_LOAD even if its type is SHT_NOBITS

Reported at https://reviews.llvm.org/D64930#1642223

If the only section of a PT_LOAD is a SHT_NOBITS section (e.g. .bss), we
may not align its sh_offset. p_offset of the PT_LOAD will be set to
sh_offset, and we will get p_offset!=p_vaddr (mod p_align).  If such
executable is mapped by the Linux kernel, it will segfault.

After D64906, this may happen the non-linker script case.

The linker script case has had this issue for a long time.
This was fixed by rL321657 (but the test linkerscript/nobits-offset.s
failed to test a SHT_NOBITS section), but broken by rL345154.

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D66658

LLVM/llvm 369827lldb/trunk/source/Plugins/SymbolFile/DWARF HashedNameToDIE.cpp HashedNameToDIE.h

[NFC] Fix comments and formatting.

LLVM/llvm 369826compiler-rt/trunk/lib/hwasan hwasan.cpp

hwasan: Align n_namesz and n_descsz to 4 when reading notes.

There is no requirement for the producer of a note to include the note
alignment in these fields. As a result we can end up missing the HWASAN note
if one of the other notes in the binary has the alignment missing.

Differential Revision: https://reviews.llvm.org/D66692

LLVM/llvm 369825compiler-rt/trunk/lib/gwp_asan options.h, compiler-rt/trunk/lib/gwp_asan/optional backtrace_sanitizer_common.cpp backtrace.h

[GWP-ASan] Split options_parser and backtrace_sanitizer_common.

Summary:
optional/options_parser and optional/backtrace_sanitizer_common are logically
separate components. They both use sanitizer-common to power their
functionality, but there was an unstated implicit dependency that in order for
backtrace_sanitizer_common to function correctly, one had to also use
options_parser.

This was because options_parser called __sanitizer::InitialiseCommonFlags. This
is a requirement for backtrace_sanitizer_common to work, as the sanitizer
unwinder uses the sanitizer_common flags and will SEGV on a null page if
they're not initialised correctly.

This patch removes this hidden dependency. You can now use
backtrace_sanitizer_common without the requirements of options_parser.

This patch also makes the GWP-ASan unit tests only have a soft dependency on
sanitizer-common. The unit tests previously explicitly used
__sanitizer::Printf, which is now provided under
tests/optional/printf_sanitizer_common. This allows Android to build the unit
tests using their own signal-safe printf().

Reviewers: eugenis


    [7 lines not shown]

LLVM/llvm 369824llvm/trunk/include/llvm/IR DataLayout.h, llvm/trunk/include/llvm/Support MathExtras.h

[LLVM][NFC] Removing unused functions

Summary: Removes a not so useful function from DataLayout and cleans up 
Support/MathExtras.h

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66691

LLVM/llvm 369823compiler-rt/trunk/lib/gwp_asan CMakeLists.txt

Fix stack_trace_compressor builds for Clang < 6.0

Summary:
Clang 4.* doesn't supply -fsanitize=fuzzer, and Clang 5.* doesn't supply
-fsanitize=fuzzer-no-link. Generally, in LLVM, fuzz targets are added through
the add_llvm_fuzzer build rule, which can't be used in compiler-rt (as it has
to be able to be standalone built).

Instead of adding tooling to add a dummy main (which kind of defeats the
purpose of these fuzz targets), we instead build the fuzz target only when the
Clang version is >= 6.*.

Reviewers: tejohnson

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D66682

LLVM/llvm 369822cfe/trunk/test/Index/skip-parsed-bodies compile_commands.json

[libclang][index][NFC] Fix test for skipping already parsed function bodies

LLVM/llvm 369821lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq1 TestAmbiguousTailCallSeq1.py, lldb/trunk/packages/Python/lldbsuite/test/functionalities/tail_call_frames/ambiguous_tail_call_seq2 TestAmbiguousTailCallSeq2.py

Skip tail call frame tests when dwarf_version < 4

rdar://problem/54656572

LLVM/llvm 369820cfe/trunk/test/Sema warn-lifetime-analysis-nocfg-disabled.cpp

Fix a test to test what the name suggest.

LLVM/llvm 369819llvm/trunk/lib/Target/AMDGPU/AsmParser AMDGPUAsmParser.cpp, llvm/trunk/test/MC/AMDGPU mai.s mai-err.s

[AMDGPU] Check for immediate SrcC in mfma in AsmParser

Differential Revision: https://reviews.llvm.org/D66674

LLVM/llvm 369818llvm/trunk/lib/Target/AMDGPU SIInstrInfo.cpp

[AMDGPU] w/a for gfx908 mfma SrcC literal HW bug

gfx908 ignores an mfma if SrcC is a literal.

Differential Revision: https://reviews.llvm.org/D66670

LLVM/llvm 369817cfe/trunk/include/clang/Basic DiagnosticSemaKinds.td DiagnosticGroups.td, cfe/trunk/lib/Sema SemaInit.cpp

[LifetimeAnalysis] Make it possible to disable the new warnings

LLVM/llvm 369816llvm/trunk/lib/Target/AMDGPU SIRegisterInfo.cpp AMDGPU.td, llvm/trunk/test/CodeGen/AMDGPU llvm.amdgcn.mfma.ll

[AMDGPU] w/a for gfx908 mfma SrcC literal HW bug

gfx908 ignores an mfma if SrcC is a literal.

Differential Revision: https://reviews.llvm.org/D66670

LLVM/llvm 369815llvm/trunk/lib/Transforms/Instrumentation HWAddressSanitizer.cpp

LLVM/llvm 369814lldb/trunk/lit/Modules/MachO lc_build_version.yaml, lldb/trunk/source/Plugins/ObjectFile/Mach-O ObjectFileMachO.cpp ObjectFileMachO.h

Upstream support for macCatalyst Mach-O binaries.

On macOS one Mach-O slice can contain multiple load commands: One load
command for being loaded into a macOS process and one load command for
being loaded into a macCatalyst process. This patch adds support for
the new load command and makes sure ObjectFileMachO returns the
Architecture that matches the Module.

Differential Revision: https://reviews.llvm.org/D66626

LLVM/llvm 369813compiler-rt/trunk/lib/builtins cpu_model.c

Move a break into the correct place. NFCI.

Should silence new C fallthrough warning.

LLVM/llvm 369812llvm/trunk/test/CodeGen/X86 test-vs-bittest.ll

[x86] add tests for bt/test; NFC

LLVM/llvm 369811clang-tools-extra/trunk/clang-doc BitcodeWriter.h

[clang-doc] Bump BitcodeWriter max line number to 32U

PR43039 reports hitting the assert on a very large file, so bumping this
to allow for larger files.

Differential Revision: https://reviews.llvm.org/D66681

LLVM/llvm 369810llvm/trunk/include/llvm/CodeGen TargetLowering.h BasicTTIImpl.h, llvm/trunk/lib/CodeGen TargetLoweringBase.cpp

[LLVM][NFC] remove unused fields

Summary:
Here is the commit introducing the fields
https://github.com/llvm/llvm-project/commit/cf6749e4c091

It dates back from 2006 and was used by AArch64 backend.
There is no more reference to these fields in the whole codebase so I think it's fine.

Reviewers: courbet

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66683

LLVM/llvm 369809llvm/trunk/lib/ExecutionEngine/Orc Core.cpp, llvm/trunk/unittests/ExecutionEngine/Orc CoreAPIsTest.cpp

[ORC] Remove query dependencies when symbols are resolved.

If the dependencies are not removed then a late failure (one symbol covered by
the query failing after others have already been resolved) can result in an
attempt to detach the query from already finalized symbol, resulting in an
assert/crash. This patch fixes the issue by removing query dependencies in
JITDylib::resolve for symbols that meet the required state.

LLVM/llvm 369808llvm/trunk/include/llvm/ExecutionEngine/Orc Core.h, llvm/trunk/lib/ExecutionEngine/Orc Core.cpp ObjectLinkingLayer.cpp

[ORC] Fix a FIXME: Propagate errors to dependencies.

When symbols are failed (via MaterializationResponsibility::failMaterialization)
any symbols depending on them will now be moved to an error state. Attempting
to resolve or emit a symbol in the error state (via the notifyResolved or
notifyEmitted methods on MaterializationResponsibility) will result in an error.
If notifyResolved or notifyEmitted return an error due to failure of a
dependence then the caller should log or discard the error and call
failMaterialization to propagate the failure to any queries waiting on the
symbols being resolved/emitted (plus their dependencies).

LLVM/llvm 369807llvm/trunk/include/llvm/ExecutionEngine/Orc Core.h

[ORC] Fix an incorrect comment.

LLVM/llvm 369806llvm/trunk/lib/Target/AArch64 AArch64InstructionSelector.cpp AArch64InstrFormats.td, llvm/trunk/test/CodeGen/AArch64 arm64-fastisel-gep-promote-before-add.ll

[AArch64][GlobalISel] Import XRO load/store patterns instead of custom selection

Instead of using custom C++ in `earlySelect` for loads and stores, just import
the patterns.

Remove `earlySelectLoad`, since we can just import the work it's doing.

Some minor changes to how `ComplexRendererFns` are returned for the XRO
addressing modes. If you add immediates in two steps, sometimes they are not
imported properly and you only end up with one immediate. I'm not sure if this
is intentional.

- Update load-addressing-modes.mir to include the instructions we can now
  import.

- Add a similar test, store-addressing-modes.mir to show which store opcodes we
  currently import, and show that we can pull in shifts etc.

- Update arm64-fastisel-gep-promote-before-add.ll to use FastISel instead of
  GISel. This test failed with GISel because GISel folds the gep into the load.
  The test checks that FastISel doesn't fold non-pointer-width adds into loads.
  GISel on the other hand, produces a G_CONSTANT of -128 for the add, and then
  a G_GEP, which must be pointer-width.

Note that we don't get STRBRoX right now. It seems like the importer can't

    [4 lines not shown]

LLVM/llvm 369805llvm/trunk/test/CodeGen/AMDGPU/GlobalISel legalize-fsub.mir legalize-fma.mir

[GlobalISel] Legalizer: Retry combining illegal artifacts as long as there new artifacts

Summary:
Currently, Legalizer aborts if it’s unable to legalize artifacts. However, it’s
possible to combine them after processing the rest of the instruction because
the legalization is likely to generate more artifacts that allow ArtifactCombiner
to combine away them.

Instead, move illegal artifacts to another list called RetryList and wait until all of the
instruction in InstList are legalized. After that, check if there is any new artifacts and
try to combine them again if that’s the case. If not, abort. The idea is similar to 
D59339,
but the approach is a bit different.

This patch fixes the issue described above, but the legalizer still may be unable to 
handle
some cases depending on when to legalize artifacts. So, in the long run, we probably need
a different legalization strategy that handles this dependency in a better way.

Reviewers: dsanders, aditya_nandakumar, qcolombet, arsenm, aemerson, paquette

Reviewed By: dsanders

Subscribers: jvesely, wdng, nhaehnle, rovka, javed.absar, hiraditya, Petar.Avramovic, 
llvm-commits

    [4 lines not shown]