LLVM/llvm 366663cfe/trunk/lib/StaticAnalyzer/Core RegionStore.cpp

[analyzer] Fix -Wunused-function in NDEBUG builds with #ifdef LLVM_DUMP_METHOD

LLVM/llvm 366662llvm/trunk/test/Transforms/InstCombine and-or-icmps.ll

[InstCombine] Add foldAndOfICmps test cases inspired by PR42691.

icmp ne %x, INT_MIN can be treated similarly to icmp sgt %x, INT_MIN.
icmp ne %x, INT_MAX can be treated similarly to icmp slt %x, INT_MAX.
icmp ne %x, UINT_MAX can be treated similarly to icmp ult %x, UINT_MAX.

We already treat icmp ne %x, 0 similarly to icmp ugt %x, 0

LLVM/llvm 366661llvm/trunk/test/CodeGen/PowerPC dform-adjust.ll

[PowerPC][NFC] Precomit test case for upcoming patch

Just committing a test case for an upcoming patch so that the review can show
only the codegen differences.

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

[X86] SimplifyDemandedVectorEltsForTargetNode - Move SUBV_BROADCAST narrowing handling. 

Move the narrowing of SUBV_BROADCAST to where we handle all the other opcodes.

LLVM/llvm 366659llvm/trunk/test/CodeGen/PowerPC pre-inc-disable.ll

[PowerPC][NFC] Regenerate test using script

This test case ended up as a hybrid of generated checks and manually inserted
checks. Regenerate using script to make it consistent.

LLVM/llvm 366658llvm/trunk/lib/Transforms/InstCombine InstCombineAndOrXor.cpp

[InstCombine] Update comment I missed in r366649. NFC

LLVM/llvm 366657llvm/trunk/include/llvm/ADT SmallBitVector.h, llvm/trunk/unittests/ADT BitVectorTest.cpp

[SmallBitVector] Fix bug in find_next_unset for small types with indices >=32

We were creating a bitmask from a shift of unsigned instead of uintptr_t, meaning we 
couldn't create masks for indices above 31.

Noticed due to a MSVC analyzer warning.

LLVM/llvm 366656llvm/trunk/lib/CodeGen/GlobalISel IRTranslator.cpp, llvm/trunk/test/CodeGen/AArch64/GlobalISel arm64-irtranslator.ll

[GISel]: Attach missing range metadata while translating G_LOADs


Attach range information to G_LOAD when only defining one register.

reviewed by: arsenm

LLVM/llvm 366655llvm/trunk/test/CodeGen/ARM mve-vpt-block4.mir mve-vpt-block5.mir, llvm/trunk/test/CodeGen/Thumb2 mve-vpt-block4.mir mve-vpt-block5.mir

[ARM] Move MVE VPT block tests into the Thumb2 directory. NFC

LLVM/llvm 366654zorg/trunk/buildbot/osuosl/master/config slaves.py

Use https as vcs_protocol for the systemz builder

This works around firewall issues we were seeing with http.

LLVM/llvm 366653lldb/trunk/packages/Python/lldbsuite/test/lang/objc/modules TestObjCModules.py, lldb/trunk/source/Plugins/ExpressionParser/Clang ClangModulesDeclVendor.cpp

[lldb] Fix crash when looking up type coming from the ClangModuleDeclVendor

We assume in LLDB that every type comes from an ASTContext with an associated 
However the types inside the ClangModuleDeclVendor don't have a ClangASTContext so we end 
crashing whenever we create a CompilerType for one of these types.

Simplest way to trigger this bug is to just look up NSObject from a module:
   (lldb) expr @import Foundation
   (lldb) type lookup NSObject
   Assertion failed: (m_type_system != nullptr), function CompilerType, file 
/Users/teemperor/llvm1/llvm-project/lldb/source/Symbol/CompilerType.cpp, line 39.

This patch just creates a ClangASTContext for the ASTContext used by 

Reviewers: davide, shafik

Reviewed By: davide

Subscribers: lldb-commits

Tags: #lldb

    [2 lines not shown]

LLVM/llvm 366652llvm/trunk/test/Transforms/InstCombine rem.ll

[NFC][InstCombine] Add a few extra srem-by-power-of-two tests - extra uses

LLVM/llvm 366651zorg/trunk/buildbot/osuosl/master/config builders.py

Slave 'lldb-x86_64-fedora': Switch to normal non-debuginfo builds again

The racy vscode testcases have been dropped from both main and lldb-mi
repositories anyway so there is nothing left to debug:
        [lldb-dev] [RFC] Removing lldb-mi

LLVM/llvm 366650lldb/trunk/source/Plugins/SymbolFile/NativePDB PdbAstBuilder.cpp SymbolFileNativePDB.cpp

[NativePDB] Make GetOrCreateDeclForUid return an lldb CompilerDecl

We intend to make PdbAstBuilder abstract and implement
PdbAstBuilderClang along with any other languages that wish to use
PDBs. Thus, change GetOrCreateDeclForUid from returning a clang decl
to a lldb_private::CompilerDecl.

LLVM/llvm 366649llvm/trunk/lib/Transforms/InstCombine InstCombineAndOrXor.cpp

[InstCombine] Remove insertRangeTest code that handles the equality case.

For equality, the function called getTrue/getFalse with the VT
of the comparison input. But getTrue/getFalse need the boolean VT.
So if this code ever executed, it would assert.

I believe these cases are removed by InstSimplify so we don't get here.

So this patch just fixes up an assert to exclude the equality
possibility and removes the broken code.

LLVM/llvm 366648llvm/trunk/lib/Transforms/InstCombine InstCombineAndOrXor.cpp

[InstCombine] Don't use AddOne/SubOne to see if two APInts are 1 apart. Use APInt 
operations instead. NFCI

AddOne/SubOne create new Constant objects. That seems heavy for
comparing ConstantInts which wrap APInts. Just do the math on
on the APInts and compare them.

LLVM/llvm 366647lldb/trunk/source/Plugins/ExpressionParser/Clang ClangExpressionParser.cpp

[lldb] Fix buildbot build fail caused by r366645

LLVM/llvm 366646llvm/trunk/utils/gn/secondary/llvm/tools/llvm-config BUILD.gn

gn build: Merge r366622

LLVM/llvm 366645cfe/trunk/lib/CodeGen CGCall.cpp, cfe/trunk/lib/Driver/ToolChains Clang.cpp

[Clang] Replace cc1 options '-mdisable-fp-elim' and '-momit-leaf-frame-pointer'
with '-mframe-pointer'

After D56351 and D64294, frame pointer handling is migrated to tri-state
(all, non-leaf, none) in clang driver and on the function attribute.
This patch makes the frame pointer handling cc1 option tri-state.

Reviewers: chandlerc, rnk, t.p.northover, MaskRay

Reviewed By: MaskRay

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

LLVM/llvm 366644lld/trunk/Common TargetOptionsCommandFlags.cpp, lld/trunk/ELF LTO.cpp

[ELF] Support explicitly overriding relocation model in LTO

lld currently selects the relocation model automatically depending on
the link flags specified, but in some cases it'd be useful to allow
explicitly overriding the relocation model using a flag.

LLVM/llvm 366643llvm/trunk/test/Transforms/InstCombine add4.ll 2009-06-16-SRemDemandedBits.ll

[NFC][InstCombine] Autogenerate a few tests

LLVM/llvm 366642llvm/trunk/test/Transforms/InstCombine rem.ll

[NFC][InstCombine] Add srem-by-signbit tests - still can fold to bittest


LLVM/llvm 366641zorg/trunk/buildbot/osuosl/master/config builders.py

Slave 'lldb-x86_64-fedora': Reduce build resource requirements

LLVM/llvm 366640llvm/trunk/test/CodeGen/AArch64 srem-seteq-vec-nonsplat.ll srem-seteq.ll, llvm/trunk/test/CodeGen/X86 srem-seteq-vec-nonsplat.ll srem-seteq-vec-splat.ll

[NFC][Codegen][X86][AArch64] Add "(x s% C) == 0" tests

Much like with `urem`, the same optimization (albeit with slightly
different algorithm) applies for the signed case, too.

I'm simply copying the test coverage from `urem` case for now,
i believe it should be (close to?) sufficient.

LLVM/llvm 366639lldb/trunk/cmake/modules LLDBStandalone.cmake

build: allow the user to specify `llvm-tblgen`

This follows the same pattern as Clang and permits the user to specify
the tablegen to use via `-DLLVM_TABLEGEN=`.  This allows for
cross-compiling LLDB for a foreign target (e.g. Windows ARM64 on Windows
X64).  The LLVM dependency for LLDB in that case must be a Windows ARM64
build which cannot cross-compile llvm-tblgen due to the way that Visual
Studio works.  Instead, permit the user to have a separate tablegen
build which can be used during the build.

LLVM/llvm 366638compiler-rt/trunk/lib/interception interception_linux.cc, compiler-rt/trunk/test/asan/TestCases/Linux dlopen-mixed-c-cxx.c

Fix asan infinite loop on undefined symbol

Fix llvm#39641

Recommit of r366413

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

llvm-svn: 366632

LLVM/llvm 366637llvm/trunk/lib/CodeGen/SelectionDAG TargetLowering.cpp, llvm/trunk/test/CodeGen/AArch64 urem-seteq-vec-nonsplat.ll

[Codegen][SelectionDAG] X u% C == 0 fold: non-splat vector improvements

Four things here:
1. Generalize the fold to handle non-splat divisors. Reasonably trivial.
2. Unban power-of-two divisors. I don't see any reason why they should
   be illegal.
   * There is no ban in Hacker's Delight
   * I think the ban came from the same bug that caused the miscompile
      in the base patch - in `floor((2^W - 1) / D)` we were dividing by
      `D0` instead of `D`, and we **were** ensuring that `D0` is not `1`,
      which made sense.
3. Unban `1` divisors. I no longer believe Hacker's Delight actually says
   that the fold is invalid for `D = 0`. Further considerations:
   * We know that
     * `(X u% 1) == 0`  can be constant-folded to `1`,
     * `(X u% 1) != 0`  can be constant-folded to `0`,
   *  Also, we know that
     * `X u<= -1` can be constant-folded to `1`,
     * `X u>  -1` can be constant-folded to `0`,
   * https://godbolt.org/z/7jnZJX https://rise4fun.com/Alive/oF6p
   * We know will end up with the following:
       `(setule/setugt (rotr (mul N, P), K), Q)`
   * Therefore, for given new DAG nodes and comparison predicates
     (`ule`/`ugt`), we will still produce the correct answer if:

    [15 lines not shown]

LLVM/llvm 366636llvm/trunk/lib/Target/X86 X86ISelLowering.cpp, llvm/trunk/test/CodeGen/X86 vector-reduce-add.ll vector-reduce-add-widen.ll

[X86][SSE] Use PSADBW to improve vXi8 sum reduction (PR42674)

As detailed on PR42674, we can reduce a vXi8 down until we have the final <8 x i8>, and 
then use PSADBW with zero, to sum those values. We then extract the bottom i8, discarding 
any overflow from the upper bits of the i16 result.

LLVM/llvm 366635cfe/trunk/lib/Sema SemaDecl.cpp

Fix cppcheck reduce scope variable warnings. NFCI

Move a couple of variables inside the block where they are actually needed.

LLVM/llvm 366634compiler-rt/trunk/lib/interception interception_linux.cc, compiler-rt/trunk/test/asan/TestCases/Linux dlopen-mixed-c-cxx.c

Revert "Fix asan infinite loop on undefined symbol"

This reverts commit cbd28cd05bb11e9d76d71c6cc2d38d89dbb1fe1a.

Buildbot fail: 

LLVM/llvm 366633llvm/trunk/lib/Transforms/Utils Local.cpp, llvm/trunk/test/Transforms/SimplifyCFG dce-cond-after-folding-terminator.ll

[Local] Zap blockaddress without users in ConstantFoldTerminator.

If the blockaddress is not destoryed, the destination block will still
be marked as having its address taken, limiting further transformations.

I think there are other places where the dead blockaddress constants are kept
around, I'll look into that as follow up.

Reviewers: craig.topper, brzycki, davide

Reviewed By: brzycki, davide

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

LLVM/llvm 366632compiler-rt/trunk/lib/interception interception_linux.cc, compiler-rt/trunk/test/asan/TestCases/Linux dlopen-mixed-c-cxx.c

Fix asan infinite loop on undefined symbol

Fix llvm#39641

Recommit of r366413

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

LLVM/llvm 366631lldb/trunk/cmake/modules LLDBConfig.cmake, lldb/trunk/test CMakeLists.txt

[CMake] Align debugserver with lldb-server on Darwin

Summary: Make debugserver a tool like lldb-server, so it can be included/excluded via 
`LLDB_TOOL_DEBUGSERVER_BUILD`. This replaces the old `LLDB_NO_DEBUGSERVER` flag. Doing the 
same for darwin-debug while I am here.

Reviewers: xiaobai, JDevlieghere, davide

Reviewed By: xiaobai, JDevlieghere

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

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

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

[c++20] P1161R3: a[b,c] is deprecated.

LLVM/llvm 366629cfe/trunk/www cxx_status.html

Mark P1301R4 in C++2a as being SVN instead.

LLVM/llvm 366628cfe/trunk/www cxx_status.html

We support P1301R4 in C++2a as of r366626.

LLVM/llvm 366627cfe/trunk/www cxx_status.html

[cxx_status] Update status page for WG21 Cologne meeting motions.

Note that many of the paper links will be dead until the post-meeting
mailing is released.

LLVM/llvm 366626cfe/trunk/include/clang/Basic AttrDocs.td, cfe/trunk/lib/Sema SemaDeclAttr.cpp SemaStmt.cpp

Implement P1301R4, which allows specifying an optional message on the [[nodiscard]] 

This also bumps the attribute feature test value and introduces the notion of a C++2a 
extension warning.

LLVM/llvm 366625llvm/trunk/lib/Target/AArch64 AArch64InstructionSelector.cpp, llvm/trunk/test/CodeGen/AArch64/GlobalISel contract-store.mir

[GlobalISel][AArch64] Contract trivial same-size cross-bank copies into G_STOREs

Sometimes, you can end up with cross-bank copies between same-sized GPRs and
FPRs, which feed into G_STOREs. When these copies feed only into stores, they
aren't necessary; we can just store using the original register bank.

This provides some minor code size savings for some floating point SPEC
benchmarks. (Around 0.2% for 453.povray and 450.soplex)

This issue doesn't seem to show up due to regbankselect or anything similar. So,
this patch introduces an early select function, `contractCrossBankCopyIntoStore`
which performs the contraction when possible. The selector then continues
normally and selects the correct store opcode, eliminating needless copies
along the way.

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

LLVM/llvm 366624cfe/trunk/test/CodeGen builtins-wasm.c, lld/trunk/test/wasm tls-align.ll tls.ll

[WebAssembly] Compute and export TLS block alignment

Add immutable WASM global `__tls_align` which stores the alignment
requirements of the TLS segment.

Add `__builtin_wasm_tls_align()` intrinsic to get this alignment in Clang.

The expected usage has now changed to:


Reviewers: tlively, aheejin, sbc100, sunfish, alexcrichton

Reviewed By: tlively

Subscribers: dschuff, jgravelle-google, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

LLVM/llvm 366623cfe/trunk/lib/CodeGen BackendUtil.cpp, cfe/trunk/test/CodeGen split-lto-unit.c

[LTO] Always mark regular LTO units with EnableSplitLTOUnit=1

Regular LTO modules do not need LTO Unit splitting, only ThinLTO does
(they must be consistently split into regular and Thin units for
optimizations such as whole program devirtualization and lower type
tests). In order to avoid spurious errors from LTO when combining with
split ThinLTO modules, always set this flag for regular LTO modules.

Reviewers: pcc

Subscribers: mehdi_amini, Prazek, inglorion, steven_wu, dexonsmith, cfe-commits

Tags: #clang

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

LLVM/llvm 366622llvm/trunk/cmake/modules LLVM-Config.cmake, llvm/trunk/tools/llvm-config BuildVariables.inc.in CMakeLists.txt

Re-commit: r366610 and r366612: Expand pseudo-components before embedding in llvm-config

There were two main problems:
* The 'nativecodegen' pseudo-component was unconditionally adding
  ${native_tgt}CodeGen even though it conditionally added ${native_tgt}Info and
  ${native_tgt}Desc. This has been fixed by making ${native_tgt}CodeGen
  conditional too
* The 'all' pseudo-component was causing library names like LLVMLLVMDemangle as
  the expansion was to a library name and not a component. There doesn't seem to
  be a list of available components anywhere so this has been fixed by moving the
  expansion of 'all' back where it was before. This manifested in different ways
  on different builders but it was the same root cause

LLVM/llvm 366621llvm/trunk/lib/Target/AMDGPU AMDGPULegalizerInfo.cpp, llvm/trunk/test/CodeGen/AMDGPU/GlobalISel inst-select-gep.mir legalize-gep.mir

AMDGPU/GlobalISel: Legalize GEP for other 32-bit address spaces

LLVM/llvm 366620cfe/trunk/lib/CodeGen TargetInfo.cpp

[NFC] Remove unused variable

Change-Id: I5aee24dcdf6eebfbf788e52be22463387f23d927

LLVM/llvm 366619llvm/trunk/lib/Target/AMDGPU SIRegisterInfo.td

[AMDGPU] Autogenerate register sequences in tuples

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

LLVM/llvm 366618compiler-rt/trunk/lib/interception interception_linux.cc, compiler-rt/trunk/test/asan/TestCases/Linux dlopen-mixed-c-cxx.c

Revert "Fix asan infinite loop on undefined symbol"

This reverts commit 8e46275488ca453a24964cb26be0736172ad1db8.

This was failing on sanitizer-x86_64-linux and our internal CI.

LLVM/llvm 366617cfe/trunk/include/clang/Basic DiagnosticSemaKinds.td TargetInfo.h, cfe/trunk/lib/Basic/Targets OSTargets.h

Disallow most calling convention attributes on PS4

PS4 now only allows "cdecl", and its equivalent on PS4, "sysv_abi".

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

LLVM/llvm 366616llvm/trunk/lib/Target/AMDGPU AMDGPUSubtarget.cpp, llvm/trunk/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.cpp

[AMDGPU] Fixed occupancy calculation for gfx10

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

LLVM/llvm 366615llvm/trunk/cmake/modules LLVM-Config.cmake, llvm/trunk/tools/llvm-config BuildVariables.inc.in CMakeLists.txt

Revert r366610 and r366612: Expand pseudo-components before embedding in llvm-config

Some targets are missing LLVMDemangle, one is adding the LLVM prefix twice, and two
are hitting the very error this patch fixes for my target. Reverting while I work
through the reports.

LLVM/llvm 366614llvm/trunk/test/Transforms/InstCombine and-or-icmps.ll

[InstCombine] Fix copy/paste mistake in the test cases I added for PR42691. NFC