platform/upstream/llvm.git
23 months ago[llvm][FileCheck] Fix unit tests failures with EXPENSIVE_CHECKS
David Spickett [Thu, 21 Jul 2022 15:36:52 +0000 (15:36 +0000)]
[llvm][FileCheck] Fix unit tests failures with EXPENSIVE_CHECKS

EXPENSIVE_CHECKS enables _GLIBCXX_DEBUG, which makes std::sort
check that the compare function is implemented correctly.

To do this it calls it with the first item as both sides.
Which trips the assert here because we think they're
2 capture ranges that overlap, when it's just the same range twice.

Check up front for the two sides being the same item
(same address, not just ==).

Reviewed By: kazu

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

23 months ago[AsmPrinter] Reject ptrtoint to larger size in lowerConstant()
Nikita Popov [Fri, 22 Jul 2022 14:10:37 +0000 (16:10 +0200)]
[AsmPrinter] Reject ptrtoint to larger size in lowerConstant()

When using a ptrtoint to a size larger than the pointer width in a
global initializer, we currently create a ptr & low_bit_mask style
MCExpr, which will later result in a relocation error during object
file emission.

This patch rejects the constant expression already during
lowerConstant(), which results in a much clearer error message
that references the constant expression at fault.

This fixes https://github.com/llvm/llvm-project/issues/56400,
for certain definitions of "fix".

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

23 months ago[ELF] Simplify --build-id/--color-diagnostics with AliasArgs. NFC
Fangrui Song [Mon, 25 Jul 2022 08:14:53 +0000 (01:14 -0700)]
[ELF] Simplify --build-id/--color-diagnostics with AliasArgs. NFC

23 months ago[AArch64] Add f16 fpimm patterns
Rosie Sumpter [Wed, 20 Jul 2022 12:53:59 +0000 (13:53 +0100)]
[AArch64] Add f16 fpimm patterns

This patch recognizes f16 immediates as legal and adds the necessary
patterns. This allows the fadda folding introduced in 05d424d16563
to be applied to the f16 cases.

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

23 months ago[pseudo] Fix minor errors in module grammar
Sam McCall [Mon, 25 Jul 2022 08:00:05 +0000 (10:00 +0200)]
[pseudo] Fix minor errors in module grammar

23 months ago[NFC][GVN] Put phi-translation of 'add' behind a switch
Peter Waller [Thu, 21 Jul 2022 19:33:24 +0000 (20:33 +0100)]
[NFC][GVN] Put phi-translation of 'add' behind a switch

The code in this `#if 0` block appears to be a net benefit. Put it
behind a switch defaulting to off to support experimentation and as a
request for comment.

The codegen impact of enabling this that I'm currently persuing is that
it allows PRE to take place more frequently, particularly in loops with
second order recurrences.

Preliminary experimental data:

Across LNT on AArch64, 54 benchmarks are sped up by >1%, and 42 are
regressed by >1%, the geomean (exec_time_enabled / exec_time_disabled)
of these 96 "1% or greater significance" benchmarks is 0.991. For the
full set of 770 benchmarks it's 0.998.

There are two benchmarks which experience a >30% speedup, and the worst
slowdown is ~12%, and for every benchmark with a slowdown there is a
benckmark which is sped up by a greater factor.

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

23 months ago[flang] Use X->foo() instead of X.getValue().foo() (NFC)
Kazu Hirata [Mon, 25 Jul 2022 07:55:06 +0000 (00:55 -0700)]
[flang] Use X->foo() instead of X.getValue().foo() (NFC)

Flang C++ Style Guide tells us to use *X when the reference is
protected by a presense test.  However, (*X).foo() is a little harder
to read, especially when X is a complicated expression.

This patch slightly deviates from the guide (but retains the spirit)
by using X->foo() instead.

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

23 months ago[flang] Use value instead of getValue (NFC)
Kazu Hirata [Mon, 25 Jul 2022 07:55:05 +0000 (00:55 -0700)]
[flang] Use value instead of getValue (NFC)

Flang C++ Style Guide tells us to use x.value() when no presence test
is obviously protecting the reference.  Since a failure in EXPECT_TRUE
doesn't terminate a given test, I don't count it as "protection" here.

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

23 months ago[Docs] Update GEP docs for opaque pointers
Nikita Popov [Fri, 22 Jul 2022 12:36:27 +0000 (14:36 +0200)]
[Docs] Update GEP docs for opaque pointers

Update the GEP FAQ to use opaque pointers. This requires more than
a syntactic change in some place, because some of the concerns just
don't make sense anymore (trying to index past a ptr member in a
struct for example).

This also fixes uses of incorrect syntax to declare or reference
globals.

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

23 months ago[LangRef] Update for opaque pointers (NFC)
Nikita Popov [Fri, 22 Jul 2022 12:58:07 +0000 (14:58 +0200)]
[LangRef] Update for opaque pointers (NFC)

Update LangRef examples to use opaque pointers in most places.
I've retained typed pointers in a few cases where opaque pointers
don't make much sense, e.g. pointer to pointer bitcasts.

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

23 months ago[llvm-objcopy] Simplify --compress-debug-sections handling with AliasArgs. NFC
Fangrui Song [Mon, 25 Jul 2022 07:31:00 +0000 (00:31 -0700)]
[llvm-objcopy] Simplify --compress-debug-sections handling with AliasArgs. NFC

23 months ago[clang][analyzer] Added partial wide character support to CStringChecker
Balázs Kéri [Mon, 25 Jul 2022 06:30:00 +0000 (08:30 +0200)]
[clang][analyzer] Added partial wide character support to CStringChecker

Support for functions wmemcpy, wcslen, wcsnlen is added to the checker.
Documentation and tests are updated and extended with the new functions.

Reviewed By: martong

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

23 months ago[AArch64][SVE] Add patterns to select masked add/sub instructions
Cullen Rhodes [Mon, 25 Jul 2022 06:37:57 +0000 (06:37 +0000)]
[AArch64][SVE] Add patterns to select masked add/sub instructions

When lowering add(a, select(mask, b, splat(0))) the sel instruction can
be removed by using predicated add/sub instructions.

Reviewed By: paulwalker-arm

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

23 months ago[AArch64][SVE] NFC: Add tests for masked add/sub patterns (D129751)
Cullen Rhodes [Mon, 25 Jul 2022 07:13:13 +0000 (07:13 +0000)]
[AArch64][SVE] NFC: Add tests for masked add/sub patterns (D129751)

23 months ago[llvm-objcopy] Remove getDecompressedSizeAndAlignment. NFC
Fangrui Song [Mon, 25 Jul 2022 07:06:36 +0000 (00:06 -0700)]
[llvm-objcopy] Remove getDecompressedSizeAndAlignment. NFC

23 months ago[SCEV][NFC][CT] Cheaper handling of guards in isBasicBlockEntryGuardedByCond
Max Kazantsev [Mon, 25 Jul 2022 04:56:01 +0000 (11:56 +0700)]
[SCEV][NFC][CT] Cheaper handling of guards in isBasicBlockEntryGuardedByCond

Handle guards uniformly with assumes, rather than iterating through all
block instructions in attempt to find them.

Differential Revision: https://reviews.llvm.org/D129874
Reviewed By: nikic

23 months ago[Hexagon] Remove isLateInstrFeedsEarlyInstr (NFC)
Kazu Hirata [Mon, 25 Jul 2022 05:55:14 +0000 (22:55 -0700)]
[Hexagon] Remove isLateInstrFeedsEarlyInstr (NFC)

The last use was removed on May 3, 2017 in commit
2af5037d34dd81c8ff2dcc3ee5d3f000c2ec1a01.

This patch also removes isLateResultInstr and isEarlySourceInstr as
they become dead once we remove isLateInstrFeedsEarlyInstr.

23 months agoRemove redundaunt override specifiers (NFC)
Kazu Hirata [Mon, 25 Jul 2022 05:28:11 +0000 (22:28 -0700)]
Remove redundaunt override specifiers (NFC)

Identified with modernize-use-override.

23 months ago[llvm-objcopy] --compress-debug-sections: fix uninitialized ch_reserved for Elf64_Chdr
Fangrui Song [Mon, 25 Jul 2022 05:19:00 +0000 (22:19 -0700)]
[llvm-objcopy] --compress-debug-sections: fix uninitialized ch_reserved for Elf64_Chdr

ch_reserved is uninitialized and the output is not deterministic. Fix it.
Rewrite and improve compress-debug-sections-zlib.test.

23 months ago[clang] Remove redundant virtual specifies (NFC)
Kazu Hirata [Mon, 25 Jul 2022 05:02:58 +0000 (22:02 -0700)]
[clang] Remove redundant virtual specifies (NFC)

Identified with modernize-use-override.

23 months ago[llvm] Remove redundaunt virtual specifiers (NFC)
Kazu Hirata [Mon, 25 Jul 2022 04:50:35 +0000 (21:50 -0700)]
[llvm] Remove redundaunt virtual specifiers (NFC)

Identified with modernize-use-override.

23 months ago[clang] Remove unused forward declarations (NFC)
Kazu Hirata [Mon, 25 Jul 2022 03:51:06 +0000 (20:51 -0700)]
[clang] Remove unused forward declarations (NFC)

23 months ago[clang] better error message for while loops outside of control flow
inclyc [Tue, 12 Jul 2022 16:12:12 +0000 (00:12 +0800)]
[clang] better error message for while loops outside of control flow

report an error when encountering 'while' token parsing declarator

```
clang/test/Parser/while-loop-outside-function.c:3:1: error: while loop outside of a function
while // expected-error {{while loop outside of a function}}
^
clang/test/Parser/while-loop-outside-function.c:7:1: error: while loop outside of a function
while // expected-error {{while loop outside of a function}}
^
```

Fixes: https://github.com/llvm/llvm-project/issues/34462

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

23 months ago[mlir][Arithmetic] Fix printing larger integer attributes in arith.const
Marius Hillenbrand [Mon, 25 Jul 2022 03:07:31 +0000 (08:37 +0530)]
[mlir][Arithmetic] Fix printing larger integer attributes in arith.const

For arith.constant operations of integer type, the operation generates
result names that include the value of the constant (i.e., the
IntegerAttr that defines the constant's value). That code currently
assumes integer widths of 64 bits or less and hits an assert with wider
constants or would create truncated and potentially ambiguous names when
built with assertions disabled.

To enable printing arith.constant ops for arbitrarily wide integer
types, change to use the IntegerAttr's function getValue() when
generating result names.

Also, add a regression test.

Reviewed By: bondhugula

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

23 months ago[llvm-objcopy] Remove remnant .zdebug code
Fangrui Song [Mon, 25 Jul 2022 01:52:15 +0000 (18:52 -0700)]
[llvm-objcopy] Remove remnant .zdebug code

23 months ago[Reassociate][NFC] Consistent checking for FastMathFlags suitability
Warren Ristow [Mon, 25 Jul 2022 00:44:30 +0000 (17:44 -0700)]
[Reassociate][NFC] Consistent checking for FastMathFlags suitability

In D129523, it was noted that the approach to check whether a value can
have FastMathFlags was done in different ways, and they should be made
consistent.  This patch makes minor changes to fix that.

Reviewed By: spatel

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

23 months agoUse llvm::less_first and llvm::less_second (NFC)
Kazu Hirata [Sun, 24 Jul 2022 23:21:29 +0000 (16:21 -0700)]
Use llvm::less_first and llvm::less_second (NFC)

23 months ago[NFC] Add parentheses in MathExtra.h
Amaury Séchet [Sun, 24 Jul 2022 22:02:59 +0000 (22:02 +0000)]
[NFC] Add parentheses in MathExtra.h

The code used to cause a warning:
  llvm/include/llvm/Support/MathExtras.h:751:39: warning: suggest parentheses around ‘-’ in operand of ‘&’ [-Wparentheses]
    751 |   assert(Align != 0 && (Align & Align - 1) == 0 &&
        |

23 months agoUse any_of (NFC)
Kazu Hirata [Sun, 24 Jul 2022 21:48:11 +0000 (14:48 -0700)]
Use any_of (NFC)

23 months ago[Hexagon] Remove unused declaration CanReturnSmallStruct (NFC)
Kazu Hirata [Sun, 24 Jul 2022 21:48:09 +0000 (14:48 -0700)]
[Hexagon] Remove unused declaration CanReturnSmallStruct (NFC)

The declaration was introduced without a corresponding definition on
Dec 12, 2011 in commit 1213a7a57fdcb6c875b3f79103fc96d3e9d30b40.

23 months ago[Hexagon] Remove unused declaration SelectZeroExtend (NFC)
Kazu Hirata [Sun, 24 Jul 2022 21:48:08 +0000 (14:48 -0700)]
[Hexagon] Remove unused declaration SelectZeroExtend (NFC)

The corresponding definition was removed on Jan 23, 2018 in commit
3780a0e1fae463e9195ae3fc2ba8424608310d8a.

23 months ago[IPO] Use range-based for loops (NFC)
Kazu Hirata [Sun, 24 Jul 2022 21:48:06 +0000 (14:48 -0700)]
[IPO] Use range-based for loops (NFC)

23 months ago[ValueTracking] allow vector types in isImpliedCondition()
Sanjay Patel [Sun, 24 Jul 2022 21:05:40 +0000 (17:05 -0400)]
[ValueTracking] allow vector types in isImpliedCondition()

The matching of constants assumed integers, but we can handle
splat vector constants seamlessly with m_APInt.

23 months ago[ValueTracking] add test for isImpliedCondition with vector types; NFC
Sanjay Patel [Sun, 24 Jul 2022 20:58:04 +0000 (16:58 -0400)]
[ValueTracking] add test for isImpliedCondition with vector types; NFC

23 months ago[PhaseOrdering] add explanatory comment for test; NFC
Sanjay Patel [Fri, 22 Jul 2022 20:09:29 +0000 (16:09 -0400)]
[PhaseOrdering] add explanatory comment for test; NFC

This note was going to be added in D129650, but we
solved the problem by reverting another patch, and
I missed transferring the comment.

23 months ago[gn build] Port b7aa9c4ac8e7
LLVM GN Syncbot [Sun, 24 Jul 2022 20:22:32 +0000 (20:22 +0000)]
[gn build] Port b7aa9c4ac8e7

23 months ago[libc++] Granularize some more type_traits
Nikolas Klauser [Sun, 24 Jul 2022 14:03:12 +0000 (16:03 +0200)]
[libc++] Granularize some more type_traits

Reviewed By: ldionne, #libc

Spies: libcxx-commits, mgorny

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

23 months ago[CodeGen] Remove a redundant void (NFC)
Kazu Hirata [Sun, 24 Jul 2022 19:27:14 +0000 (12:27 -0700)]
[CodeGen] Remove a redundant void (NFC)

Identified with modernize-redundant-void-arg.

23 months ago[ExecutionEngine] Fix a header guard (NFC)
Kazu Hirata [Sun, 24 Jul 2022 19:27:12 +0000 (12:27 -0700)]
[ExecutionEngine] Fix a header guard (NFC)

Identified with llvm-header-guard.

23 months agoRemove redundant string initialization (NFC)
Kazu Hirata [Sun, 24 Jul 2022 19:27:11 +0000 (12:27 -0700)]
Remove redundant string initialization (NFC)

Identified with readability-redundant-string-init.

23 months ago[lldb] Remove redundant member initialization (NFC)
Kazu Hirata [Sun, 24 Jul 2022 19:27:09 +0000 (12:27 -0700)]
[lldb] Remove redundant member initialization (NFC)

Identified with readability-redundant-member-init.

23 months ago[lldb] Use nullptr instead of NULL (NFC)
Kazu Hirata [Sun, 24 Jul 2022 19:27:08 +0000 (12:27 -0700)]
[lldb] Use nullptr instead of NULL (NFC)

Identified with modernize-use-nullptr.

23 months ago[lldb] Use true instead of 0 (NFC)
Kazu Hirata [Sun, 24 Jul 2022 19:27:06 +0000 (12:27 -0700)]
[lldb] Use true instead of 0 (NFC)

Identified with modernize-use-bool-literals.

23 months ago[llvm] Remove unused forward declarations (NFC)
Kazu Hirata [Sun, 24 Jul 2022 19:27:05 +0000 (12:27 -0700)]
[llvm] Remove unused forward declarations (NFC)

23 months ago[ELF] Optimize some non-constant alignTo with alignToPowerOf2. NFC
Fangrui Song [Sun, 24 Jul 2022 18:20:49 +0000 (11:20 -0700)]
[ELF] Optimize some non-constant alignTo with alignToPowerOf2. NFC

My x86-64 lld executable is 2KiB smaller. .eh_frame writing gets faster as there
were lots of divisions.

23 months ago[gn build] Port 46ae26e7eb70
LLVM GN Syncbot [Sun, 24 Jul 2022 17:43:27 +0000 (17:43 +0000)]
[gn build] Port 46ae26e7eb70

23 months ago[Driver] Enable some sanitizers on FreeBSD AArch64
Andrew Turner [Sun, 24 Jul 2022 17:41:21 +0000 (10:41 -0700)]
[Driver] Enable some sanitizers on FreeBSD AArch64

They have been ported and tested to work on AArch64
(see D125883, D125758, and D125873).

Reviewed By: dim, MaskRay

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

23 months ago[clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodifie...
Jonas Toth [Sun, 24 Jul 2022 17:35:52 +0000 (19:35 +0200)]
[clang-tidy] implement new check 'misc-const-correctness' to add 'const' to unmodified variables

This patch connects the check for const-correctness with the new general
utility to add `const` to variables.
The code-transformation is only done, if the detected variable for const-ness
is not part of a group-declaration.

The check allows to control multiple facets of adding `const`, e.g. if pointers themself should be
marked as `const` if they are not changed.

Reviewed By: njames93

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

23 months ago[compiler-rt][CMake] Enable TF intrinsics on powerpc32 Linux
Khem Raj [Sun, 24 Jul 2022 17:17:22 +0000 (10:17 -0700)]
[compiler-rt][CMake] Enable TF intrinsics on powerpc32 Linux

clang generates calls to these intrinsics when used for ppc32/linux, when using libgcc this works ok but when using compiler-rt for rtlib it fails with missing intrinsic symbols. also see [1]

[1] https://lists.llvm.org/pipermail/llvm-dev/2014-May/072784.html

Reviewed By: MaskRay, glaubitz

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

23 months ago[X86] Autogenerate atomic tests. NFC
Amaury Séchet [Sun, 24 Jul 2022 16:38:58 +0000 (16:38 +0000)]
[X86] Autogenerate atomic tests. NFC

23 months agoRegAllocGreedy: Fix subranges when rematerializing dead subreg defs
Matt Arsenault [Wed, 15 Jun 2022 01:18:21 +0000 (21:18 -0400)]
RegAllocGreedy: Fix subranges when rematerializing dead subreg defs

This would create a new interval missing the subrange and hit this
verifier error:

*** Bad machine code: Live interval for subreg operand has no subranges ***
- function:    test_remat_subreg_def
- basic block: %bb.0  (0xa568758) [0B;128B)
- instruction: 32B dead undef %4.sub0:vreg_64 = V_MOV_B32_e32 2, implicit $exec

23 months ago[X86] Autogenerate cfguard-x86-64-vectorcall.ll. NFC
Amaury Séchet [Sun, 24 Jul 2022 15:45:51 +0000 (15:45 +0000)]
[X86] Autogenerate cfguard-x86-64-vectorcall.ll. NFC

23 months agoAMDGPU: Fix broken test checks
Matt Arsenault [Sat, 23 Jul 2022 19:07:03 +0000 (15:07 -0400)]
AMDGPU: Fix broken test checks

23 months ago[DAG] visitSMUL_LOHI/visitUMUL_LOHI - ensure we canonicalize constants to the RHS
Simon Pilgrim [Sun, 24 Jul 2022 15:09:52 +0000 (16:09 +0100)]
[DAG] visitSMUL_LOHI/visitUMUL_LOHI - ensure we canonicalize constants to the RHS

23 months ago[X86] Autogenerate some of the fp128 tests. NFC
Amaury Séchet [Sun, 24 Jul 2022 14:32:36 +0000 (14:32 +0000)]
[X86] Autogenerate some of the fp128 tests. NFC

23 months ago[DAG] getNode - assert that SMUL_LOHI/UMUL_LOHI nodes have the correct ops + types
Simon Pilgrim [Sun, 24 Jul 2022 14:23:13 +0000 (15:23 +0100)]
[DAG] getNode - assert that SMUL_LOHI/UMUL_LOHI nodes have the correct ops + types

23 months ago[X86] Regenerate hoist-and-by-const-from-lshr-in-eqcmp-zero.ll with common SSE2 prefix
Simon Pilgrim [Sun, 24 Jul 2022 13:48:18 +0000 (14:48 +0100)]
[X86] Regenerate hoist-and-by-const-from-lshr-in-eqcmp-zero.ll with common SSE2 prefix

23 months ago[Clang] Add missing paper revisions in the release notes [NFC]
Corentin Jabot [Sun, 24 Jul 2022 14:24:11 +0000 (16:24 +0200)]
[Clang] Add missing paper revisions in the release notes [NFC]

23 months ago[clang] Fix incorrect constant folding of `if consteval`
Corentin Jabot [Sun, 24 Jul 2022 06:55:49 +0000 (08:55 +0200)]
[clang] Fix incorrect constant folding of `if consteval`

Fixes https://github.com/llvm/llvm-project/issues/55638.

`if consteval` was evaluated incorrectly when in a
non-constant context that could be constant-folded.

Reviewed By: aaron.ballman

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

23 months ago[Clang] De-deprecate volatile compound operations
Corentin Jabot [Sat, 23 Jul 2022 12:38:48 +0000 (14:38 +0200)]
[Clang] De-deprecate volatile compound operations

As per P2327R1,

|=, &= and ^= are no longer deprecated in all languages mode.

Reviewed By: aaron.ballman

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

23 months agoFix crash in ObjC codegen introduced with 5ab6ee75994d645725264e757d67bbb1c96fb2b6
David Chisnall [Sun, 24 Jul 2022 10:56:12 +0000 (11:56 +0100)]
Fix crash in ObjC codegen introduced with 5ab6ee75994d645725264e757d67bbb1c96fb2b6

5ab6ee75994d645725264e757d67bbb1c96fb2b6 assumed that if `RValue::isScalar()` returns true then `RValue::getScalarVal` will return a valid value.  This is not the case when the return value is `void` and so void message returns would crash if they hit this path.  This is triggered only for cases where the nil-handling path needs to do something non-trivial (destroy arguments that should be consumed by the callee).

Reviewed By: triplef

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

23 months ago[DAG] MaskedVectorIsZero - don't bother with (-1).isSubsetOf mask check. NFC.
Simon Pilgrim [Sun, 24 Jul 2022 12:12:21 +0000 (13:12 +0100)]
[DAG] MaskedVectorIsZero - don't bother with (-1).isSubsetOf mask check. NFC.

Just use KnownBits::isZero() to ensure all the bits are known zero.

23 months ago[DAG] SimplifyMultipleUseDemandedBits - early-out for any scalable vector types
Simon Pilgrim [Sun, 24 Jul 2022 11:59:43 +0000 (12:59 +0100)]
[DAG] SimplifyMultipleUseDemandedBits - early-out for any scalable vector types

Noticed while working to remove SelectionDAG::GetDemandedBits - we were relying on the callers to have already bailed for scalable vectors

23 months ago[DAG] SimplifyDemandedVectorElts - if every and/mul element-pair has a zero/undef...
Simon Pilgrim [Sun, 24 Jul 2022 11:00:31 +0000 (12:00 +0100)]
[DAG] SimplifyDemandedVectorElts - if every and/mul element-pair has a zero/undef then just constant fold to zero

23 months ago[X86] combineAndnp - remove unused variable. NFC.
Simon Pilgrim [Sun, 24 Jul 2022 10:32:44 +0000 (11:32 +0100)]
[X86] combineAndnp - remove unused variable. NFC.

23 months ago[X86][SSE] Enable X86ISD::ANDNP constant folding
Simon Pilgrim [Sun, 24 Jul 2022 10:07:34 +0000 (11:07 +0100)]
[X86][SSE] Enable X86ISD::ANDNP constant folding

23 months ago[X86] Don't assume an AND/ANDNP element is undef/undemanded just because one element...
Simon Pilgrim [Sun, 24 Jul 2022 09:53:38 +0000 (10:53 +0100)]
[X86] Don't assume an AND/ANDNP element is undef/undemanded just because one element is undef

For mask ops like these, the other operand's corresponding element might be zero (result = zero) - so we must demand all the bits and that element.

This appears to be what D128570 was trying to fix - both sides of the funnel shift mask of the vXi64 (legalized to v2Xi32) were incorrectly simplifying the upper 32-bit halves to undef, resulting in bad folds later on.

I intend to address the test case regressions, but this close to the release branch I'd prefer to get a fix in first.

23 months ago[MC] Remove unused renameELFSection
Fangrui Song [Sun, 24 Jul 2022 08:23:07 +0000 (01:23 -0700)]
[MC] Remove unused renameELFSection

23 months ago[MC] Delete dead zlib-gnu code and simplify writeSectionData
Fangrui Song [Sun, 24 Jul 2022 08:17:34 +0000 (01:17 -0700)]
[MC] Delete dead zlib-gnu code and simplify writeSectionData

23 months ago[clangd] Do not try to use $0 as a placeholder in completion snippets
Nathan Ridge [Mon, 18 Jul 2022 07:48:04 +0000 (03:48 -0400)]
[clangd] Do not try to use $0 as a placeholder in completion snippets

$0 can only be used as a tab stop, not as a placeholder (e.g.
`${0:expression}` is not valid)

Fixes https://github.com/clangd/clangd/issues/1190

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

23 months agoRevert "[Orc] Use default member initialization (NFC)"
Kazu Hirata [Sun, 24 Jul 2022 04:10:10 +0000 (21:10 -0700)]
Revert "[Orc] Use default member initialization (NFC)"

This reverts commit d534967b6667c468b12e9ed5e3c482f590dde633.

The patch causes build failures, such as:

https://lab.llvm.org/buildbot/#/builders/121/builds/21760

23 months ago[Hexagon] Remove unused declaration getByteVectorTy (NFC)
Kazu Hirata [Sun, 24 Jul 2022 02:40:43 +0000 (19:40 -0700)]
[Hexagon] Remove unused declaration getByteVectorTy (NFC)

The declaration was introduced without a corresponding definition on
Sep 7, 2020 in commit f5d07a05bbd41f827ccfa1bed7bfdfbab2be85dc.

23 months ago[Passes] Simplify ChangePrinter names. NFC
Fangrui Song [Sun, 24 Jul 2022 02:32:13 +0000 (19:32 -0700)]
[Passes] Simplify ChangePrinter names. NFC

23 months ago[libcxx] Remove static inline and make use of _LIBCPP_HIDE_FROM_ABI in __support...
Brad Smith [Sun, 24 Jul 2022 02:09:58 +0000 (22:09 -0400)]
[libcxx] Remove static inline and make use of _LIBCPP_HIDE_FROM_ABI in __support/xlocale/__nop_locale_mgmt.h header

Reviewed By: ldionne

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

23 months ago[Analysis] Use default member initialization (NFC)
Kazu Hirata [Sun, 24 Jul 2022 01:36:24 +0000 (18:36 -0700)]
[Analysis] Use default member initialization (NFC)

23 months ago[Orc] Use default member initialization (NFC)
Kazu Hirata [Sun, 24 Jul 2022 01:36:23 +0000 (18:36 -0700)]
[Orc] Use default member initialization (NFC)

Identified with modernize-use-default-member-init

23 months ago[RISCV] Add a continue to reduce nesting. NFC
Craig Topper [Sat, 23 Jul 2022 23:40:29 +0000 (16:40 -0700)]
[RISCV] Add a continue to reduce nesting. NFC

23 months agoclang/include/clang/module.modulemap: Mark `Tooling/Inclusions/*.inc` as textual.
NAKAMURA Takumi [Sun, 24 Jul 2022 00:28:08 +0000 (09:28 +0900)]
clang/include/clang/module.modulemap: Mark `Tooling/Inclusions/*.inc` as textual.

Fixes llvmorg-15-init-917-g46a6f5ae148a

23 months ago[CodeGen] Use range-based for loops (NFC)
Kazu Hirata [Sat, 23 Jul 2022 23:10:46 +0000 (16:10 -0700)]
[CodeGen] Use range-based for loops (NFC)

23 months ago[IPO] Use std::array for AccessKind2Accesses (NFC)
Kazu Hirata [Sat, 23 Jul 2022 22:47:53 +0000 (15:47 -0700)]
[IPO] Use std::array for AccessKind2Accesses (NFC)

Switching to std:array allow us to use fill.

While I am at it, this patch also converts one for loop to a
range-based one.

23 months ago[lldb] Adapt lldb tests to changes in 71cdb8c6f144
Augusto Noronha [Sat, 23 Jul 2022 22:37:15 +0000 (15:37 -0700)]
[lldb] Adapt lldb tests to changes in 71cdb8c6f144

23 months ago[LegacyPM] Remove {,PostInline}EntryExitInstrumenterPass
Fangrui Song [Sat, 23 Jul 2022 22:30:15 +0000 (15:30 -0700)]
[LegacyPM] Remove {,PostInline}EntryExitInstrumenterPass

Following recent changes removing non-core features of the legacy
PM/optimization pipeline.

23 months agoAutogenerate tests for win64-byval.ll . NFC
Amaury Séchet [Sat, 23 Jul 2022 21:51:50 +0000 (21:51 +0000)]
Autogenerate tests for win64-byval.ll . NFC

23 months agofix tests for commit 9df0b254d24eca098
Nuno Lopes [Sat, 23 Jul 2022 21:32:30 +0000 (22:32 +0100)]
fix tests for commit 9df0b254d24eca098

23 months ago[NFC] Switch a few uses of undef to poison as placeholders for unreachable code
Nuno Lopes [Sat, 23 Jul 2022 20:50:11 +0000 (21:50 +0100)]
[NFC] Switch a few uses of undef to poison as placeholders for unreachable code

23 months ago[Vectorize] Remove isConsecutiveLoadOrStore (NFC)
Kazu Hirata [Sat, 23 Jul 2022 20:01:14 +0000 (13:01 -0700)]
[Vectorize] Remove isConsecutiveLoadOrStore (NFC)

The last use was removed on Jan 4, 2022 in commit
95a93722db2d10753f8887cf6a61380936d32f1c.

23 months ago[AMDGPU] Remove a redundant variable (NFC)
Kazu Hirata [Sat, 23 Jul 2022 19:29:05 +0000 (12:29 -0700)]
[AMDGPU] Remove a redundant variable (NFC)

ArrayRef has operator[], so we don't need to access the contents via
data().

23 months agoConvert for_each to range-based for loops (NFC)
Kazu Hirata [Sat, 23 Jul 2022 19:17:27 +0000 (12:17 -0700)]
Convert for_each to range-based for loops (NFC)

23 months ago[Analysis] Remove a redundant return statement (NFC)
Kazu Hirata [Sat, 23 Jul 2022 18:35:19 +0000 (11:35 -0700)]
[Analysis] Remove a redundant return statement (NFC)

Identified with readability-redundant-control-flow.

23 months ago[AMDGPU] Change DEBUG_TYPE from isel to amdgpu-isel
Fangrui Song [Sat, 23 Jul 2022 18:32:02 +0000 (11:32 -0700)]
[AMDGPU] Change DEBUG_TYPE from isel to amdgpu-isel

to match all other *ISelDAGToDAG.cpp

23 months ago[TableGen] Drop an unnecessary const from a return type (NFC)
Kazu Hirata [Sat, 23 Jul 2022 18:30:23 +0000 (11:30 -0700)]
[TableGen] Drop an unnecessary const from a return type (NFC)

This patch also drops "&" that binds to a temporary.

Identified with readability-const-return-type.

23 months ago[ADT] Use default member initialization (NFC)
Kazu Hirata [Sat, 23 Jul 2022 17:50:26 +0000 (10:50 -0700)]
[ADT] Use default member initialization (NFC)

Identified with modernize-use-default-member-init.

23 months ago[flang] Correct IsHostAssociated() to be true for BLOCK constructs
Peter Klausler [Fri, 22 Jul 2022 18:51:20 +0000 (11:51 -0700)]
[flang] Correct IsHostAssociated() to be true for BLOCK constructs

The predicate IsHostAssocited() was implemented in a way that would
return true only for cases of host association into a module or inner
subprogram.  Technically, the use of a name in a BLOCK construct
that is not declared therein is considered in the Fortran standard
to also be a form of host association, and this matters when doing
error checking on DATA statements.

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

23 months ago[DAG] isSplatValue - don't attempt to merge any BITCAST sub elements if they contain...
Simon Pilgrim [Sat, 23 Jul 2022 17:38:48 +0000 (18:38 +0100)]
[DAG] isSplatValue - don't attempt to merge any BITCAST sub elements if they contain UNDEFs

We still haven't found a solution that correctly handles 'don't care' sub elements properly - given how close it is to the next release branch, I'm making this fail safe change and we can revisit this later if we can't find alternatives.

NOTE: This isn't a reversion of D128570 - it's the removal of undef handling across bitcasts entirely

Fixes #56520

23 months ago[X86] Add test case for Issue #56520
Simon Pilgrim [Sat, 23 Jul 2022 17:18:39 +0000 (18:18 +0100)]
[X86] Add test case for Issue #56520

23 months ago[flang] Clean up bogus semantic error on procedure pointer assignment
Peter Klausler [Mon, 18 Jul 2022 21:12:21 +0000 (14:12 -0700)]
[flang] Clean up bogus semantic error on procedure pointer assignment

When a procedure pointer with no interface is associated with
an EXTERNAL name with no interface information, but it is later
inferred that the procedure pointer must be a subroutine because it
appears in a CALL statement, don't complain that the EXTERNAL name
is not also known to be a subroutine.

Subroutine vs. function errors are still caught in procedure pointer
assignment compatibility checking; this fix simply ensures that those
more nuanced tests are not overridded by the attribute set equality test.

Also, leave in some code for dumping the differing attributes in legitimate
error cases that was added in the coures of debugging the specific problem.

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

23 months ago[lld-macho][nfc] Reduce nesting of code added in D130125
Jez Ng [Sat, 23 Jul 2022 16:21:46 +0000 (12:21 -0400)]
[lld-macho][nfc] Reduce nesting of code added in D130125

23 months ago[flang] Don't fold zero-length substring references
Peter Klausler [Mon, 18 Jul 2022 20:13:03 +0000 (13:13 -0700)]
[flang] Don't fold zero-length substring references

In some contexts the code looks cleaner if we fold zero-length substring
references into empty character constants, but those don't work in
variable definition contexts and can lead to bogus semantic error
messages.

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

23 months agoRevert "[NFC] Improve FileSpec internal APIs and usage in preparation for adding...
Nico Weber [Sat, 23 Jul 2022 16:31:31 +0000 (12:31 -0400)]
Revert "[NFC] Improve FileSpec internal APIs and usage in preparation for adding caching of resolved/absolute." and follow-ups

This reverts commit 9429b67b8e300e638d7828bbcb95585f85c4df4d.

It broke the build on Windows, see comments on https://reviews.llvm.org/D130309

It also reverts these follow-ups:

Revert "Fix buildbot breakage after https://reviews.llvm.org/D130309."
This reverts commit f959d815f4637890ebbacca379f1c38ab47e4e14.

Revert "Fix buildbot breakage after https://reviews.llvm.org/D130309."
This reverts commit 0bbce7a4c2d2bff622bdadd4323f93f5d90e6d24.

Revert "Cache the value for absolute path in FileSpec."
This reverts commit dabe877248b85b34878e75d5510339325ee087d0.

23 months ago[flang] Fix name of dummy argument to intrinsic NEW_LINE(A='')
Peter Klausler [Mon, 18 Jul 2022 18:30:29 +0000 (11:30 -0700)]
[flang] Fix name of dummy argument to intrinsic NEW_LINE(A='')

It should be A= but I misspelled it in the intrinsics table as X=.

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