platform/upstream/llvm.git
2 years ago[DWARFLinker][NFC] cleanup AddressManager interface.
Alexey Lapshin [Thu, 12 May 2022 18:48:14 +0000 (21:48 +0300)]
[DWARFLinker][NFC] cleanup AddressManager interface.

this review is extracted from D86539

1. delete areRelocationsResolved() method.
2. rename hasLiveMemoryLocation() -> isLiveVariable()
          hasLiveAddressRange() -> isLiveSubprogram().

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

2 years agoRevert "[libunwind][AArch64] Add support for DWARF expression for RA_SIGN_STATE."
Daniel Kiss [Sun, 15 May 2022 19:42:07 +0000 (21:42 +0200)]
Revert "[libunwind][AArch64] Add support for DWARF expression for RA_SIGN_STATE."

This reverts commit f6366ef7f4f3cf1182fd70e0c50a9fa54374b612.

2 years ago[flang][nfc] Fix driver method names overridden by the plugins
Andrzej Warzynski [Sun, 15 May 2022 17:53:09 +0000 (17:53 +0000)]
[flang][nfc] Fix driver method names overridden by the plugins

After the recent re-factoring of the driver code
(https://reviews.llvm.org/D125007), `ExecuteAction` was renamed as
`executeAction`. This patch updates the examples in Flang accordingly.

If you set `FLANG_BUILD_EXAMPLES` to `On` when building Flang, then the
refactoring from D125007 would have caused build failures for you. This
patch fixes that.

This is fairly straightforward and fixes buildbot failures, so I'm
sending this without a review.

2 years ago[SLP] Fix misspelling of 'analyzed'. NFC
Craig Topper [Sun, 15 May 2022 17:30:24 +0000 (10:30 -0700)]
[SLP] Fix misspelling of 'analyzed'. NFC

2 years ago[RISCV] Add M extension command lines to ctlz-cttz-ctpop.ll. NFC
Craig Topper [Sun, 15 May 2022 04:16:02 +0000 (21:16 -0700)]
[RISCV] Add M extension command lines to ctlz-cttz-ctpop.ll. NFC

ctpop and cttz default expansion both end up using a multiply. This
can either use a mul instruction or libcall. Make sure we test both
cases.

2 years ago[RISCV] Improve test coverage in ctlz-cttz-ctpop.ll. NFC
Craig Topper [Sun, 15 May 2022 04:08:54 +0000 (21:08 -0700)]
[RISCV] Improve test coverage in ctlz-cttz-ctpop.ll. NFC

Add more i8/16 tets.
Add ctlz_zero_undef tests.

2 years ago[X86] Add test coverage for PR44915 / Issue #44260
Simon Pilgrim [Sun, 15 May 2022 16:05:19 +0000 (17:05 +0100)]
[X86] Add test coverage for PR44915 / Issue #44260

2 years ago[X86] Add checks to illegal-insert.ll
Simon Pilgrim [Sun, 15 May 2022 15:58:12 +0000 (16:58 +0100)]
[X86] Add checks to illegal-insert.ll

2 years ago[X86] lowerShuffleAsLanePermuteAndSHUFP always succeeds, so just return the result...
Simon Pilgrim [Sun, 15 May 2022 14:53:31 +0000 (15:53 +0100)]
[X86] lowerShuffleAsLanePermuteAndSHUFP always succeeds, so just return the result. NFC.

2 years ago[VPlan] Improve printing of VPReplicateRecipe with calls.
Florian Hahn [Sun, 15 May 2022 14:51:26 +0000 (15:51 +0100)]
[VPlan] Improve printing of VPReplicateRecipe with calls.

Suggested as part of D124718.

2 years ago[X86] Pull out repeated isShuffleMaskInputInPlace calls. NFC.
Simon Pilgrim [Sun, 15 May 2022 14:35:09 +0000 (15:35 +0100)]
[X86] Pull out repeated isShuffleMaskInputInPlace calls. NFC.

2 years ago[X86] lowerV4I64Shuffle - try harder to lower to PERMQ(BLENDD(V1,V2)) pattern
Simon Pilgrim [Sun, 15 May 2022 13:57:58 +0000 (14:57 +0100)]
[X86] lowerV4I64Shuffle - try harder to lower to PERMQ(BLENDD(V1,V2)) pattern

2 years ago[X86] Add shuffles showing failure to use PERMUTE(BLEND(X,Y))
Simon Pilgrim [Sun, 15 May 2022 13:31:32 +0000 (14:31 +0100)]
[X86] Add shuffles showing failure to use PERMUTE(BLEND(X,Y))

One AVX2+ targets we have a immediate VPERMQ/PD cross-lane permute thats better than relying on a pair of VPERM2F128 cross-lanes to feed a blend.

Reported on discourse

2 years ago[X86] Adjust tests for vector widening to use freeze(poison)
Simon Pilgrim [Sun, 15 May 2022 12:03:03 +0000 (13:03 +0100)]
[X86] Adjust tests for vector widening to use freeze(poison)

I incorrectly used freeze(undef) in rG1b07bd9034bd

2 years agoScalarEvolution.cpp: Reformat.
NAKAMURA Takumi [Sun, 8 May 2022 11:21:08 +0000 (20:21 +0900)]
ScalarEvolution.cpp: Reformat.

2 years ago[clang][docs] Add escape code to fix missing '*' in reduction operation list
Simon Pilgrim [Sun, 15 May 2022 11:32:11 +0000 (12:32 +0100)]
[clang][docs] Add escape code to fix missing '*' in reduction operation list

2 years agoARMFixCortexA57AES1742098Pass.cpp: Suppress a warning. [-Wunused-but-set-variable]
NAKAMURA Takumi [Sun, 15 May 2022 09:01:24 +0000 (18:01 +0900)]
ARMFixCortexA57AES1742098Pass.cpp: Suppress a warning. [-Wunused-but-set-variable]

2 years ago[clang-format] Handle "if consteval { ... }" for RemoveBracesLLVM
owenca [Fri, 13 May 2022 23:31:27 +0000 (16:31 -0700)]
[clang-format] Handle "if consteval { ... }" for RemoveBracesLLVM

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

2 years ago[libc++][test] Verify std::views::drop and std::views::join are CPOs
Joe Loser [Sat, 14 May 2022 22:00:44 +0000 (16:00 -0600)]
[libc++][test] Verify std::views::drop and std::views::join are CPOs

`std::views::drops` and `std::views::join` have been implemented, but the tests
verifying the CPOs for them are still commented out. Uncomment the tests.

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

2 years ago[TargetLowering] expandCTPOP don't create an used constant mask for i8 ctpop. NFC
Craig Topper [Sun, 15 May 2022 03:33:47 +0000 (20:33 -0700)]
[TargetLowering] expandCTPOP don't create an used constant mask for i8 ctpop. NFC

Use early out for the i8 case.

I'm looking at avoiding MUL on targets that use libcalls for MUL.
So doing a little pre-refactoring.

2 years agofix typos to cycle bots
Nico Weber [Sun, 15 May 2022 01:19:19 +0000 (21:19 -0400)]
fix typos to cycle bots

2 years ago[LowerTypeTests][clang] Implement and allow -fsanitize=cfi-icall for RISCV
Wende Tan [Sun, 15 May 2022 01:05:06 +0000 (18:05 -0700)]
[LowerTypeTests][clang] Implement and allow -fsanitize=cfi-icall for RISCV

Reviewed By: MaskRay

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

2 years ago[M68k][Disassembler] Adopt the new variable length decoder
Sheng [Sun, 15 May 2022 00:44:10 +0000 (08:44 +0800)]
[M68k][Disassembler] Adopt the new variable length decoder

This is an example usage of D120958.

After these patches are landed, we can strip off the codebeads officially.

Reviewed By: myhsu

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

2 years agoRename `MCFixedLenDisassembler.h` as `MCDecoderOps.h`
Sheng [Sun, 15 May 2022 00:42:50 +0000 (08:42 +0800)]
Rename `MCFixedLenDisassembler.h` as `MCDecoderOps.h`

The name `MCFixedLenDisassembler.h` is out of date after D120958.

Rename it as `MCDecoderOps.h` to reflect the change.

Reviewed By: myhsu

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

2 years ago[mlir][LLVMIR] Add support for translating shufflevector
Min-Yih Hsu [Thu, 21 Apr 2022 02:57:32 +0000 (19:57 -0700)]
[mlir][LLVMIR] Add support for translating shufflevector

Add support for translating llvm::ShuffleVectorInst

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

2 years ago[mlir][LLVMIR] Add support for translating insert/extractvalue
Min-Yih Hsu [Thu, 21 Apr 2022 02:57:06 +0000 (19:57 -0700)]
[mlir][LLVMIR] Add support for translating insert/extractvalue

Add support for translating llvm::InsertValue and llvm::ExtractValue.

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

2 years ago[RISCV] Remove unneeded check for ISD::VSCALE operand being a constant. NFC
Craig Topper [Sat, 14 May 2022 20:44:55 +0000 (13:44 -0700)]
[RISCV] Remove unneeded check for ISD::VSCALE operand being a constant. NFC

ISD::VSCALE only allows constant operands.

2 years ago[libc++][ranges][NFC] Mark completed issues related to the One Ranges Proposal.
varconst [Sat, 14 May 2022 20:07:08 +0000 (13:07 -0700)]
[libc++][ranges][NFC] Mark completed issues related to the One Ranges Proposal.

Quite a few C++20 LWG issues/papers related to the One Ranges Proposal
were already effectively implemented (or contain semantic-only wording
changes that don't affect the implementation), mark them as such.

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

2 years ago[libc++] Simplify the string structures a bit more
Nikolas Klauser [Sat, 14 May 2022 10:38:00 +0000 (12:38 +0200)]
[libc++] Simplify the string structures a bit more

This simplifies the string structs a bit more and the normal layout should not contain any undefined behaviour anymore. I don't think there is a way to achieve this in the alternate string mode without breaking the ABI.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

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

2 years ago[clang-tidy] Restore test parameter operator<< function (NFC)
Richard [Sat, 14 May 2022 19:59:34 +0000 (13:59 -0600)]
[clang-tidy] Restore test parameter operator<< function (NFC)

Clang erroneously flagged the function as "unused", but it is most
definitely used by gtest to pretty print the parameter value when
a test fails.

Make the pretty printing function a friend function in the parameter
class similar to other clang unit tests.

2 years ago[AMDGPU] Fix typo in cttz_zero_undef(x) -> cttz(x) fold test
Simon Pilgrim [Sat, 14 May 2022 19:51:31 +0000 (20:51 +0100)]
[AMDGPU] Fix typo in cttz_zero_undef(x) -> cttz(x) fold test

v_cttz_zero_undef_i64_with_select should be selecting '64' for the x != 0 case instead of '32' like we just did in the previous 'v_cttz_zero_undef_i32_with_select' test.

Noticed by accident because it was causing some weird regressions....

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

2 years ago[DAG] visitOR - merge isa/cast<ShuffleVectorSDNode> into dyn_cast<ShuffleVectorSDNode...
Simon Pilgrim [Sat, 14 May 2022 19:49:13 +0000 (20:49 +0100)]
[DAG] visitOR - merge isa/cast<ShuffleVectorSDNode> into dyn_cast<ShuffleVectorSDNode>. NFC.

Also, initialize entire mask to -1 to simplify undefined cases.

2 years ago[ifs] Add --strip-size flag
Alex Brachet [Sat, 14 May 2022 18:50:20 +0000 (18:50 +0000)]
[ifs] Add --strip-size flag

st_size may not be of importance to the abi if you are not using
copy relocations. This is helpful when you want to check the abi
of a shared object both when instrumented and not because asan
will increase the size of objects to include the redzone.

Differential revision: https://reviews.llvm.org/D124792

2 years ago[RS4GC] Fix -Wunused-function in -DLLVM_ENABLE_ASSERTIONS=off build after D125000
Fangrui Song [Sat, 14 May 2022 17:47:50 +0000 (10:47 -0700)]
[RS4GC] Fix -Wunused-function in -DLLVM_ENABLE_ASSERTIONS=off build after D125000

2 years ago[DAG] visitADDLike - use SelectionDAG::FoldConstantArithmetic directly to match const...
Simon Pilgrim [Sat, 14 May 2022 17:39:35 +0000 (18:39 +0100)]
[DAG] visitADDLike - use SelectionDAG::FoldConstantArithmetic directly to match constant operands

SelectionDAG::FoldConstantArithmetic determines if operands are foldable constants, so we don't need to bother with isConstantOrConstantVector / Opaque tests before calling it directly.

2 years agoRevert "[ifs] Add --strip-size flag"
Alex Brachet [Sat, 14 May 2022 17:33:27 +0000 (17:33 +0000)]
Revert "[ifs] Add --strip-size flag"

This reverts commit b6b0fd6a940b7006ced344736decccffaa583b8a.

2 years ago[ifs] Add --strip-size flag
Alex Brachet [Sat, 14 May 2022 17:23:47 +0000 (17:23 +0000)]
[ifs] Add --strip-size flag

st_size may not be of importance to the abi if you are not using
copy relocations. This is helpful when you want to check the abi
of a shared object both when instrumented and not because asan
will increase the size of objects to include the redzone.

Differential revision: https://reviews.llvm.org/D124792

2 years ago[X86] LowerAVG - fix cut+paste typo. NFC.
Simon Pilgrim [Sat, 14 May 2022 16:41:48 +0000 (17:41 +0100)]
[X86] LowerAVG - fix cut+paste typo. NFC.

2 years ago[lldb] Don't swallow crashlog exceptions
Jonas Devlieghere [Fri, 13 May 2022 22:58:56 +0000 (15:58 -0700)]
[lldb] Don't swallow crashlog exceptions

crashlog.py catches every exception in order to format them. This
results in both the exception name as well as the backtrace getting
swallowed.

Here's an example of the current output:

  error: python exception: in method 'SBTarget_ResolveLoadAddress', argument 2 of type 'lldb::addr_t'

Compare this to the output without the custom exception handling:

  Traceback (most recent call last):
    File "[...]/site-packages/lldb/macosx/crashlog.py", line 929, in __call__
      SymbolicateCrashLogs(debugger, shlex.split(command))
    File "[...]/site-packages/lldb/macosx/crashlog.py", line 1239, in SymbolicateCrashLogs
      SymbolicateCrashLog(crash_log, options)
    File "[...]/site-packages/lldb/macosx/crashlog.py", line 1006, in SymbolicateCrashLog
      thread.dump_symbolicated(crash_log, options)
    File "[...]/site-packages/lldb/macosx/crashlog.py", line 124, in dump_symbolicated
      symbolicated_frame_addresses = crash_log.symbolicate(
    File "[...]/site-packages/lldb/utils/symbolication.py", line 540, in symbolicate
      if symbolicated_address.symbolicate(verbose):
    File "[...]/site-packages/lldb/utils/symbolication.py", line 98, in symbolicate
      sym_ctx = self.get_symbol_context()
    File "[...]/site-packages/lldb/utils/symbolication.py", line 77, in get_symbol_context
      sb_addr = self.resolve_addr()
    File "[...]/site-packages/lldb/utils/symbolication.py", line 69, in resolve_addr
      self.so_addr = self.target.ResolveLoadAddress(self.load_addr)
    File "[...]/site-packages/lldb/__init__.py", line 10675, in ResolveLoadAddress
      return _lldb.SBTarget_ResolveLoadAddress(self, vm_addr)
  OverflowError: in method 'SBTarget_ResolveLoadAddress', argument 2 of type 'lldb::addr_t'

This patch removes the custom exception handling and lets LLDB or the
default exception handler deal with it instead.

Differential revision: https://reviews.llvm.org/D125589

2 years ago[lldb] Remove unused imports from crashlog.py
Jonas Devlieghere [Fri, 13 May 2022 22:32:29 +0000 (15:32 -0700)]
[lldb] Remove unused imports from crashlog.py

2 years ago[X86] Add test showing failure to reuse the same PCMPGT comparison for SMIN/SMIN...
Simon Pilgrim [Sat, 14 May 2022 14:47:53 +0000 (15:47 +0100)]
[X86] Add test showing failure to reuse the same PCMPGT comparison for SMIN/SMIN expansions

2 years ago[AArch64] Avoid emitting MOVID when NEON is disabled
Alex Richardson [Thu, 12 May 2022 10:23:10 +0000 (10:23 +0000)]
[AArch64] Avoid emitting MOVID when NEON is disabled

Previously, creating a zero floating-point constant used MOVID even when
NEON was disabled which resulted in the following fatal error:
`Attempting to emit MOVID instruction but the Feature_HasNEON predicate(s) are not met`

Reviewed By: dmgreen

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

2 years ago[UpdateTestChecks] Use a counter for unpredictable FileCheck variables
Alex Richardson [Thu, 12 May 2022 10:22:28 +0000 (10:22 +0000)]
[UpdateTestChecks] Use a counter for unpredictable FileCheck variables

Variable captures such as `<MCInst #` can change based on unrelated changes
to the LLVM backends, to avoid the generated test cases being different
use an incrementing counter for variable names instead of using the
actual value from the output file.
This change may also be beneficial for some nameless IR variables
(especially when combined with filtering of output), but for now I've
restricted this change to the obvious candidates (--asm-show-inst output).

Reviewed By: MaskRay

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

2 years ago[update_llc_test_checks] Use FileCheck captures for MCInst/MCReg output
Alex Richardson [Thu, 12 May 2022 10:21:55 +0000 (10:21 +0000)]
[update_llc_test_checks] Use FileCheck captures for MCInst/MCReg output

To avoid test churn when backends add/rename new instructions/registers,
it makes sense to use FileCheck captures for the exact MCInst/Reg number.
This is motivated by D125307, where I use --asm-show-inst to differentiate
the output for multiple instructions with the same mnemonic.

This does not quite fix the churn issue yet: While files with the generated
checks will be immune to the numbers changing, the update script test
still suffers from this problem since the number is encoded in the
FileCheck variable name. I plan to address this in a follow-up patch.

Reviewed By: MaskRay

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

2 years ago[update_llc_test_checks] Baseline test for --asm-show-inst
Alex Richardson [Thu, 12 May 2022 10:21:00 +0000 (10:21 +0000)]
[update_llc_test_checks] Baseline test for --asm-show-inst

To avoid test churn when backends add/rename new instructions/registers,
it makes sense to scrub the exact MCInst/Reg number.

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

2 years ago[UpdateTestChecks] Change global functions to NamelessValue members. NFCI
Alex Richardson [Thu, 12 May 2022 10:14:23 +0000 (10:14 +0000)]
[UpdateTestChecks] Change global functions to NamelessValue members. NFCI

This avoids repeated calls to get_idx_from_ir_value_match() and will make
it easier for a future patch that adds new assembly-level nameless values
in addition to the IR ones.

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

2 years ago[AArch64] Add missing HasNEON predicates to int->float patterns
Alex Richardson [Thu, 12 May 2022 10:13:53 +0000 (10:13 +0000)]
[AArch64] Add missing HasNEON predicates to int->float patterns

I was trying to compile code with -march=+nosimd and hit various
instruction predicate verification errors, this patch should address the
ones I saw in integer to floating-pointer conversions.

I noticed that for signed conversions, some non-NEON instruction sequences
are shorter. I don't know if the longer one is still faster on current
architectures (the patterns date back to the initial backend import)

Reviewed By: dmgreen

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

2 years ago[AArch64] Baseline test for D125307
Alex Richardson [Thu, 12 May 2022 10:13:42 +0000 (10:13 +0000)]
[AArch64] Baseline test for D125307

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

2 years ago[MLIR][GPU] Add canonicalizer for gpu.memcpy
Arnab Dutta [Fri, 13 May 2022 11:20:16 +0000 (16:50 +0530)]
[MLIR][GPU] Add canonicalizer for gpu.memcpy

Erase gpu.memcpy op when only uses of dest are
the memcpy op in question, its allocation and deallocation
ops.

Reviewed By: bondhugula, csigg

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

2 years ago[DAG] visitMUL - pull out repeated SDLoc() calls. NFC.
Simon Pilgrim [Sat, 14 May 2022 13:28:39 +0000 (14:28 +0100)]
[DAG] visitMUL - pull out repeated SDLoc() calls. NFC.

2 years ago[DAG] Use SelectionDAG::FoldConstantArithmetic directly to match constant operands
Simon Pilgrim [Sat, 14 May 2022 13:19:12 +0000 (14:19 +0100)]
[DAG] Use SelectionDAG::FoldConstantArithmetic directly to match constant operands

SelectionDAG::FoldConstantArithmetic determines if operands are foldable constants, so we don't need to bother with isConstantOrConstantVector / Opaque tests before calling it directly.

2 years agoFix unused function 'operator<<' -Wunused-function warning introduced in D124500
Simon Pilgrim [Sat, 14 May 2022 12:48:26 +0000 (13:48 +0100)]
Fix unused function 'operator<<' -Wunused-function warning introduced in D124500

2 years ago[ARM] Regenerate combine-movc-sub.ll test checks
Simon Pilgrim [Sat, 14 May 2022 12:25:30 +0000 (13:25 +0100)]
[ARM] Regenerate combine-movc-sub.ll test checks

2 years ago[MLIR][GPU] NFC: simplify kernel operand accessor implementations.
Christian Sigg [Fri, 6 May 2022 18:31:36 +0000 (20:31 +0200)]
[MLIR][GPU] NFC: simplify kernel operand accessor implementations.

Reviewed By: ThomasRaoux

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

2 years ago[X86] rotate-extract-vector.ll - use avx512bw+avx512vl target for more useful codegen...
Simon Pilgrim [Sat, 14 May 2022 11:58:50 +0000 (12:58 +0100)]
[X86] rotate-extract-vector.ll - use avx512bw+avx512vl target for more useful codegen checks

This is a much more realistic target than just avx512bw, which has never existed as a real world cpu target

2 years ago[libc++] Improve std::to_chars for base != 10.
Mark de Wever [Sat, 27 Feb 2021 15:52:39 +0000 (16:52 +0100)]
[libc++] Improve std::to_chars for base != 10.

This improves the speed of `to_chars` for bases 2, 8, and 16.
These bases are common and used in `<format>`. This change
uses a lookup table, like done in base 10 and causes an increase
in code size. The change has a small overhead for the other bases.

```
Benchmark                             Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------
BM_to_chars_good/2                 -0.9476         -0.9476           252            13           252            13
BM_to_chars_good/3                 +0.0018         +0.0018           145           145           145           145
BM_to_chars_good/4                 +0.0108         +0.0108           104           105           104           105
BM_to_chars_good/5                 +0.0159         +0.0160            89            91            89            91
BM_to_chars_good/6                 +0.0162         +0.0162            80            81            80            81
BM_to_chars_good/7                 +0.0117         +0.0117            72            73            72            73
BM_to_chars_good/8                 -0.8643         -0.8643            64             9            64             9
BM_to_chars_good/9                 +0.0095         +0.0095            60            60            60            60
BM_to_chars_good/10                +0.0540         +0.0540             6             6             6             6
BM_to_chars_good/11                +0.0299         +0.0299            55            57            55            57
BM_to_chars_good/12                +0.0060         +0.0060            48            49            49            49
BM_to_chars_good/13                +0.0102         +0.0102            48            48            48            48
BM_to_chars_good/14                +0.0184         +0.0185            47            48            47            48
BM_to_chars_good/15                +0.0269         +0.0269            44            45            44            45
BM_to_chars_good/16                -0.8207         -0.8207            37             7            37             7
BM_to_chars_good/17                +0.0241         +0.0241            37            38            37            38
BM_to_chars_good/18                +0.0221         +0.0221            37            38            37            38
BM_to_chars_good/19                +0.0222         +0.0223            37            38            37            38
BM_to_chars_good/20                +0.0317         +0.0317            38            39            38            39
BM_to_chars_good/21                +0.0342         +0.0341            38            39            38            39
BM_to_chars_good/22                +0.0336         +0.0336            36            38            36            38
BM_to_chars_good/23                +0.0222         +0.0222            34            35            34            35
BM_to_chars_good/24                +0.0185         +0.0185            31            32            31            32
BM_to_chars_good/25                +0.0157         +0.0157            32            32            32            32
BM_to_chars_good/26                +0.0181         +0.0181            32            32            32            32
BM_to_chars_good/27                +0.0153         +0.0153            32            32            32            32
BM_to_chars_good/28                +0.0179         +0.0179            32            32            32            32
BM_to_chars_good/29                +0.0189         +0.0189            32            33            32            33
BM_to_chars_good/30                +0.0212         +0.0212            32            33            32            33
BM_to_chars_good/31                +0.0221         +0.0221            32            33            32            33
BM_to_chars_good/32                +0.0292         +0.0292            32            33            32            33
BM_to_chars_good/33                +0.0319         +0.0319            32            33            32            33
BM_to_chars_good/34                +0.0411         +0.0410            33            34            33            34
BM_to_chars_good/35                +0.0515         +0.0515            33            34            33            34
BM_to_chars_good/36                +0.0502         +0.0502            32            34            32            34
BM_to_chars_bad/2                  -0.8752         -0.8752            40             5            40             5
BM_to_chars_bad/3                  +0.1952         +0.1952            21            26            21            26
BM_to_chars_bad/4                  +0.3626         +0.3626            16            22            16            22
BM_to_chars_bad/5                  +0.2267         +0.2268            17            21            17            21
BM_to_chars_bad/6                  +0.3560         +0.3559            14            19            14            19
BM_to_chars_bad/7                  +0.4599         +0.4600            12            18            12            18
BM_to_chars_bad/8                  -0.5074         -0.5074            11             5            11             5
BM_to_chars_bad/9                  +0.4814         +0.4814            10            15            10            15
BM_to_chars_bad/10                 +0.7761         +0.7761             2             4             2             4
BM_to_chars_bad/11                 +0.3948         +0.3948            12            16            12            16
BM_to_chars_bad/12                 +0.3203         +0.3203            10            13            10            13
BM_to_chars_bad/13                 +0.3067         +0.3067            11            14            11            14
BM_to_chars_bad/14                 +0.2235         +0.2235            12            14            12            14
BM_to_chars_bad/15                 +0.2675         +0.2675            11            14            11            14
BM_to_chars_bad/16                 -0.1801         -0.1801             7             5             7             5
BM_to_chars_bad/17                 +0.5651         +0.5651             7            11             7            11
BM_to_chars_bad/18                 +0.5407         +0.5406             7            11             7            11
BM_to_chars_bad/19                 +0.5593         +0.5593             8            12             8            12
BM_to_chars_bad/20                 +0.5823         +0.5823             8            13             8            13
BM_to_chars_bad/21                 +0.6032         +0.6032             9            15             9            15
BM_to_chars_bad/22                 +0.6407         +0.6408             9            14             9            14
BM_to_chars_bad/23                 +0.6292         +0.6292             7            12             7            12
BM_to_chars_bad/24                 +0.5784         +0.5784             6            10             6            10
BM_to_chars_bad/25                 +0.5784         +0.5784             6            10             6            10
BM_to_chars_bad/26                 +0.5713         +0.5713             7            10             7            10
BM_to_chars_bad/27                 +0.5969         +0.5969             7            11             7            11
BM_to_chars_bad/28                 +0.6131         +0.6131             7            11             7            11
BM_to_chars_bad/29                 +0.6937         +0.6937             7            11             7            11
BM_to_chars_bad/30                 +0.7655         +0.7656             7            12             7            12
BM_to_chars_bad/31                 +0.8939         +0.8939             6            12             6            12
BM_to_chars_bad/32                 +1.0157         +1.0157             6            13             6            13
BM_to_chars_bad/33                 +1.0279         +1.0279             7            14             7            14
BM_to_chars_bad/34                 +1.0388         +1.0388             7            14             7            14
BM_to_chars_bad/35                 +1.0990         +1.0990             7            15             7            15
BM_to_chars_bad/36                 +1.1503         +1.1503             7            15             7            15
```

Reviewed By: ldionne, #libc

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

2 years ago[X86] Regenerate pull-binop-through-shift.ll showing stack address math
Simon Pilgrim [Sat, 14 May 2022 10:54:08 +0000 (11:54 +0100)]
[X86] Regenerate pull-binop-through-shift.ll showing stack address math

Also rename X32 check prefixes to X86 as we try to use X32 for gnux32 targets

2 years ago[DenseElementsAttr] Teach isValidRawBuffer that 1-elt values are splats.
Chris Lattner [Sat, 14 May 2022 10:48:17 +0000 (11:48 +0100)]
[DenseElementsAttr] Teach isValidRawBuffer that 1-elt values are splats.

We want getRaw() on tensors with i1 element type with a zero or 1 value
to be treated as a splat.  This fixes:
https://github.com/llvm/llvm-project/issues/55440

2 years agoResolve overload ambiguity on Mac OS when printing size_t in diagnostics
Aaron Puchert [Sat, 14 May 2022 10:37:35 +0000 (12:37 +0200)]
Resolve overload ambiguity on Mac OS when printing size_t in diagnostics

Precommit builds cover Linux and Windows, but this ambiguity would only
show up on Mac OS: there we have int32_t = int, int64_t = long long and
size_t = unsigned long. So printing a size_t, while successful on the
other two architectures, cannot be unambiguously resolved on Mac OS.

This is not really meant to support printing arguments of type long or
size_t, but more as a way to prevent build breakage that would not be
detected in precommit builds, as happened in D125429.

Technically we have no guarantee that one of these types has the 64 bits
that afdac5fbcb6a3 wanted to provide, so proposals are welcome. We do
have a guarantee though that these three types are different, so we
should be fine with overload resolution.

Reviewed By: aeubanks

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

2 years ago[flang][driver] Switch to the MLIR coding style in the driver (nfc)
Andrzej Warzynski [Fri, 29 Apr 2022 17:36:26 +0000 (17:36 +0000)]
[flang][driver] Switch to the MLIR coding style in the driver (nfc)

This patch re-factors the driver code in LLVM Flang (frontend +
compiler) to use the MLIR style. For more context, please see:
https://discourse.llvm.org/t/rfc-coding-style-in-the-driver/

Most changes here are rather self-explanatory. Accessors are renamed to
be more consistent with the rest of LLVM (e.g. allSource -->
getAllSources). Additionally, MLIR clang-tidy files are added in the
affected directories.

clang-tidy and clang-format files were copied from MLIR. Small
additional changes are made to silence clang-tidy/clang-format
warnings.

[1] https://mlir.llvm.org/getting_started/DeveloperGuide/

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

2 years ago[bazel] Port ae8bbc43f470
Benjamin Kramer [Sat, 14 May 2022 10:11:58 +0000 (12:11 +0200)]
[bazel] Port ae8bbc43f470

2 years ago[LoongArch] Add privilege instructions definition
Weining Lu [Sun, 24 Apr 2022 06:59:19 +0000 (14:59 +0800)]
[LoongArch] Add privilege instructions definition

These instructions are added by following the `LoongArch Reference
Manual Volume 1: Basic Architecture Version 1.00`.

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

2 years ago[llvm] Fix comment nits in Module class, NFC.
Xiaodong Liu [Sat, 14 May 2022 09:40:13 +0000 (17:40 +0800)]
[llvm] Fix comment nits in Module class, NFC.

There is no member called "GlobalValRefMap" in Module class.
It has been changed to "GlobalList".

Reviewed By: efriedma

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

2 years ago[lib++][doc] Fixes a link in the status paper.
Mark de Wever [Sat, 14 May 2022 09:25:15 +0000 (11:25 +0200)]
[lib++][doc] Fixes a link in the status paper.

2 years ago[DebugInfo][Test] Simplify 'llvm/test/CodeGen/ARM/*-MergedGlobalDbg.ll'. NFC
Kristina Bessonova [Sat, 14 May 2022 09:09:43 +0000 (11:09 +0200)]
[DebugInfo][Test] Simplify 'llvm/test/CodeGen/ARM/*-MergedGlobalDbg.ll'. NFC

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

2 years ago[APInt] Allow extending and truncating to the same width
Jay Foad [Wed, 6 Oct 2021 08:49:51 +0000 (09:49 +0100)]
[APInt] Allow extending and truncating to the same width

Allow zext, sext, trunc, truncUSat and truncSSat to extend or truncate
to the same bit width, which is a no-op.

Disallowing this forced clients to use workarounds like using
zextOrTrunc (even though they never wanted truncation) or zextOrSelf
(even though they did not want its strange behaviour of allowing a
*smaller* bit width, which is also treated as a no-op).

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

2 years ago[DAG] Enable ISD::SHL SimplifyMultipleUseDemandedBits handling inside SimplifyDemande...
Simon Pilgrim [Sat, 14 May 2022 08:49:55 +0000 (09:49 +0100)]
[DAG] Enable ISD::SHL SimplifyMultipleUseDemandedBits handling inside SimplifyDemandedBits

Pulled out of D77804 as its going to be easier to address the regressions individually.

This patch allows SimplifyDemandedBits to call SimplifyMultipleUseDemandedBits in cases where the source operand has other uses, enabling us to peek through the shifted value if we don't demand all the bits/elts.

The lost RISCV gorc2 fold shouldn't be a problem - instcombine would have already destroyed that pattern - see https://github.com/llvm/llvm-project/issues/50553

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

2 years ago[clang] Require including config.h for CLANG_DEFAULT_STD_C
Cassie Jones [Sat, 14 May 2022 08:47:41 +0000 (01:47 -0700)]
[clang] Require including config.h for CLANG_DEFAULT_STD_C

This makes CLANG_DEFAULT_STD_C(XX) always be defined, defaulting to
lang_unspecified, so you are forced to check its value instead of using
an #ifdef. This should help avoid accidentally omitting the include in
places where that's important, so that the default language version bug
isn't re-introduced.

Reviewed By: hokein, dexonsmith

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

2 years ago[clang] Include clang config.h in LangStandards.cpp
Cassie Jones [Sat, 14 May 2022 08:47:41 +0000 (01:47 -0700)]
[clang] Include clang config.h in LangStandards.cpp

This is necessary in order to pick up the default C/C++ standard from
the CLANG_DEFAULT_STD_C(XX) defines. This fixes a bug that was
introduced when this default language standard code was moved from
Frontend to Basic, making compilers ignore the configured default
language version override.

Fixes a bug introduced by D121375.

Reviewed By: hokein, dexonsmith

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

2 years ago[libcxxabi] Copy headers into build location
Petr Hosek [Sat, 14 May 2022 02:23:52 +0000 (02:23 +0000)]
[libcxxabi] Copy headers into build location

Prior to D120727, the libcxx build was responsible for copying libcxxabi
headers into the right location, both in the build and install trees,
but now it's the responsibility of the libcxxabi build. While the build
already did the right thing for the install tree, it wouldn't copy
headers into the build tree, resulting in errors when trying to use the
just built toolchain as is the case in the runtimes build when building
compiler-rt runtimes.

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

2 years ago[InstCombine] [NFC] separate a function foldICmpBinOpWithConstant
Chenbing Zheng [Sat, 14 May 2022 02:54:15 +0000 (10:54 +0800)]
[InstCombine] [NFC] separate a function foldICmpBinOpWithConstant

There is a long function foldICmpInstWithConstant,
we can separate a function foldICmpBinOpWithConstant from it.

Reviewed By: spatel

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

2 years ago[BOLT] Fix merge-fdata handling of BAT profiles
Rafael Auler [Fri, 13 May 2022 22:51:36 +0000 (15:51 -0700)]
[BOLT] Fix merge-fdata handling of BAT profiles

When a profile is collected in a BOLTed binary, the generated
profile is tagged with a header string "boltedcollection" in the first
line of the fdata file. Fix merge-fdata to recognize this header
string and preserve it into the output.

Reviewed By: Amir

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

2 years ago[gn build] (semi-manually) port 512273833136
Nico Weber [Sat, 14 May 2022 01:35:09 +0000 (21:35 -0400)]
[gn build] (semi-manually) port 512273833136

2 years ago[lldb/API] Turn SBCompileUnit::GetIndexForLineEntry into FindLineEntryIndex (NFC)
Med Ismail Bennani [Fri, 13 May 2022 23:50:52 +0000 (16:50 -0700)]
[lldb/API] Turn SBCompileUnit::GetIndexForLineEntry into FindLineEntryIndex (NFC)

This patch renames the `SBCompileUnit::GetIndexForLineEntry` api to be
an overload of `SBCompileUnit::FindLineEntryIndex`

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2 years ago[clang-tidy] Support expressions of literals in modernize-macro-to-enum
Richard [Sat, 23 Apr 2022 23:47:30 +0000 (17:47 -0600)]
[clang-tidy] Support expressions of literals in modernize-macro-to-enum

Add a recursive descent parser to match macro expansion tokens against
fully formed valid expressions of integral literals.  Partial
expressions will not be matched -- they can't be valid initializing
expressions for an enum.

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

Fixes #55055

2 years ago[mlir][ods] (NFC) remove erroneous trait
Mogball [Sat, 14 May 2022 00:37:34 +0000 (00:37 +0000)]
[mlir][ods] (NFC) remove erroneous trait

2 years ago[mlir] Rename Zero* traits to Zero*s
Mogball [Sat, 14 May 2022 00:20:01 +0000 (00:20 +0000)]
[mlir] Rename Zero* traits to Zero*s

Rename
ZeroResult -> ZeroResults
ZeroSuccessor -> ZeroSuccessors
ZeroRegion -> ZeroRegions

to be in line with ZeroOperands and grammatically correct.

2 years ago[clang-format][NFC] Format unit tests with insert/remove braces
owenca [Fri, 13 May 2022 01:03:24 +0000 (18:03 -0700)]
[clang-format][NFC] Format unit tests with insert/remove braces

This patch is the result of running clang-format version 753fe33 in
clang/unittests/Format/:
clang-format -style="{InsertBraces: true, RemoveBracesLLVM: true}" -i *.cpp *.h

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

2 years ago[NFC][Metadata] Refactor allocation, initalization and deletion of MDNodes.
Wolfgang Pieb [Fri, 29 Apr 2022 21:39:40 +0000 (14:39 -0700)]
[NFC][Metadata] Refactor allocation, initalization and deletion of MDNodes.

This patch is refactoring the allocation, initialization and deletion
of MDNodes. It is intended as a preparatory patch for the upcoming
addition of dynamic resizability of MDNodes. It is fundamentally NFC,
but removes the necessity for suppressing the memory sanitizer for
MDNode's operator delete.

Reviewers: dexonsmith

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

2 years ago[llvm-ar][mri] Ensure CREATE commands overwrite the output file
Ben Dunbobbin [Fri, 13 May 2022 22:37:16 +0000 (23:37 +0100)]
[llvm-ar][mri] Ensure CREATE commands overwrite the output file

The CREATE/CREATETHIN commands should overwrite the output file:
https://sourceware.org/binutils/docs/binutils/ar-scripts.html.

This fixes a regression for MRI scripts introduced in:
https://reviews.llvm.org/D123142 which put logic into
performWriteOperation. performWriteOperation is called for all MRI
commands that write an archive out (one's with a SAVE command).
performWriteOperation is unaware of MRI semantics and loads an
existing archive if present. If an existing archive is loaded, llvm-ar
checks the properties of the existing archive for decisions about the
output archive (for example making the output archive thin if the
existing one was). https://reviews.llvm.org/D123142 adds the following
logic...

if (OldArchive) {
  if (Thin && !OldArchive->isThin())
    fail("cannot convert a regular archive to a thin one");
  if (OldArchive->isThin())
    Thin = true;
}

... which errors for a script with CREATETHIN in effect if there is an
existing regular archive, and causes CREATE to output a thin archive
if there is an existing thin archive.

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

2 years ago[LLVM][Casting.h] Add ForwardToPointerCast trait
bzcheeseman [Fri, 13 May 2022 22:41:22 +0000 (18:41 -0400)]
[LLVM][Casting.h] Add ForwardToPointerCast trait

Addresses use cases in Clang/MLIR that need pointer-to-pointer, reference-to-reference, and value-to-value casts from/to the same types. This should reduce boilerplate by allowing the user to simply specify the pointer cast and forward the reference cast directly to the pointer cast.

This cast trait DOES NOT implement `castFailed` and `doCastIfPossible` because in the general case doing so could result in a nullptr dereference. Users can use `NullableValueCastFailed` and `DefaultDoCastIfPossible` as desired for those cases where `nullptr` is acceptable.

Reviewed By: rriddle

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

2 years ago[LLVM][Casting.h] Remove CastInfo pointer partial specialization.
bzcheeseman [Fri, 13 May 2022 19:57:03 +0000 (15:57 -0400)]
[LLVM][Casting.h] Remove CastInfo pointer partial specialization.

Since cast_convert_val now has pointer specializations, we don't need the pointer partial specialization for CastInfo. We want to trim these down when possible to avoid future ambiguous partial specialization errors.

Reviewed By: rriddle

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

2 years ago[ParseResult] Fix warning in flang build, incorporate feedback from River.
Chris Lattner [Fri, 13 May 2022 22:29:21 +0000 (23:29 +0100)]
[ParseResult] Fix warning in flang build, incorporate feedback from River.

The warning caused build errors on a couple flang testers that are
building with -Werror.  The diagnostic change makes the generated
error correct.

This is a followup to https://reviews.llvm.org/D125549

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

2 years ago[RISCV] Use the new chain when converting a fixed RVV load
Roger Ferrer Ibanez [Fri, 13 May 2022 15:45:05 +0000 (15:45 +0000)]
[RISCV] Use the new chain when converting a fixed RVV load

When building the final merged node, we were using the original chain
rather than the output chain of the new operation. After some collapsing
of the chain this could cause the loads be incorrectly scheduled respect
to later stores.

This was uncovered by SingleSource/Regression/C/gcc-c-torture/execute/pr36038.c
of the llvm testsuite.

https://reviews.llvm.org/D125560

2 years ago[RISCV][NFC] Test showing wrong scheduling of expansion of memmove for fixed RVV
Roger Ferrer Ibanez [Fri, 13 May 2022 15:46:40 +0000 (15:46 +0000)]
[RISCV][NFC] Test showing wrong scheduling of expansion of memmove for fixed RVV

After a memmove is expanded, we load the higher addresses after we have
stored onto the lower ones, as if we could do a forward copy.

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

2 years ago[GlobalOpt] Enable optimization of constructors with different priorities
Alexander Shaposhnikov [Fri, 13 May 2022 20:44:49 +0000 (20:44 +0000)]
[GlobalOpt] Enable optimization of constructors with different priorities

Adjust `optimizeGlobalCtorsList` to handle the case of different priorities.
This addresses the issue https://github.com/llvm/llvm-project/issues/55083.

Test plan: ninja check-all

Differential revision: https://reviews.llvm.org/D125278

2 years ago[Cuda] Add the features using the last argument
Joseph Huber [Fri, 13 May 2022 22:04:29 +0000 (18:04 -0400)]
[Cuda] Add the features using the last argument

Summary:
We should use the last argument so this flag can be overridden properly.

2 years ago[SLP]Do not vectorize non-profitable alternate nodes.
Alexey Bataev [Wed, 16 Mar 2022 20:18:54 +0000 (13:18 -0700)]
[SLP]Do not vectorize non-profitable alternate nodes.

If alternate node has only 2 instructions and the tree is already big
enough, better to skip the vectorization of such nodes, they are not
very profitable (the resulting code cotains 3 instructions instead of
original 2 scalars). SLP can try to vectorize the buildvector sequence
in the next attempt, if it is profitable.

Metric: SLP.NumVectorInstructions

Program                                                                                       SLP.NumVectorInstructions
                                                                               results                   results0 diff
     test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C/miniAMR/miniAMR.test    72.00                     73.00   1.4%
test-suite :: MultiSource/Benchmarks/Prolangs-C/TimberWolfMC/timberwolfmc.test  1186.00                   1198.00   1.0%
     test-suite :: MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/miniFE.test   241.00                    242.00   0.4%
                  test-suite :: MultiSource/Applications/JM/lencod/lencod.test  2131.00                   2139.00   0.4%
 test-suite :: External/SPEC/CINT2017rate/523.xalancbmk_r/523.xalancbmk_r.test  6377.00                   6384.00   0.1%
test-suite :: External/SPEC/CINT2017speed/623.xalancbmk_s/623.xalancbmk_s.test  6377.00                   6384.00   0.1%
        test-suite :: External/SPEC/CFP2017rate/510.parest_r/510.parest_r.test 12650.00                  12658.00   0.1%
      test-suite :: External/SPEC/CFP2017rate/526.blender_r/526.blender_r.test 26169.00                  26147.00  -0.1%
          test-suite :: MultiSource/Benchmarks/Trimaran/enc-3des/enc-3des.test    99.00                     86.00 -13.1%

Gains:
526.blender_r - more vectorized trees.
enc-3des - same.

Others:
510.parest_r - no changes.
miniFE - same
623.xalancbmk_s - some (non-profitable) parts of the trees are not
    vectorized.
523.xalancbmk_r - same
lencod - same
timberwolfmc - same
miniAMR - same

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

2 years ago[llvm-ml] Add support for extern proc
Alan Zhao [Fri, 13 May 2022 20:09:11 +0000 (16:09 -0400)]
[llvm-ml] Add support for extern proc

EXTERN PROC isn't really well documented in MSVC, so after poking around
it seems as if it's just a regular extern symbol.

Interestingly enough, under MSVC the following is allowed:

extern foo:proc

mov eax, foo

MSVC will output:

mov eax, 0

while llvm-ml will currently output:

mov eax, dword ptr [foo]

(since foo is an extern)

Arguably, llvm-ml's output makes more sense, even though it's
inconsistent with MSVC ml. However, since moving an extern proc symbol
to a register doesn't really make sense in the first place, we'll treat
it as undefined behavior for now.

Reviewed By: epastor

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

2 years ago[GlobalIsel] Fix fallback if stack protector isn't supported.
Eli Friedman [Fri, 13 May 2022 20:36:16 +0000 (13:36 -0700)]
[GlobalIsel] Fix fallback if stack protector isn't supported.

When GlobalISel fails, we need to report the error, and we need to set
the FailedISel property.  We skipped those steps if stack protector
insertion failed, which led to a very strange miscompile.

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

2 years ago[Clang] Fix DriverKit tests on Linux
Egor Zhdan [Fri, 13 May 2022 21:05:28 +0000 (22:05 +0100)]
[Clang] Fix DriverKit tests on Linux

Some new DriverKit tests were added in https://reviews.llvm.org/D121911, and unfortunately they fail on Linux build bots.

2 years ago[SLP]Do not look for buildvector sequence, if the index is reused.
Alexey Bataev [Fri, 13 May 2022 19:08:08 +0000 (12:08 -0700)]
[SLP]Do not look for buildvector sequence, if the index is reused.

If the insert indes was used already or is not constant, we should stop
looking for unique buildvector sequence, it mustbe splitted to
2 different buildvectors.

2 years ago[Libomptarget] Build the static library without CUDA installed
Joseph Huber [Fri, 13 May 2022 20:29:39 +0000 (16:29 -0400)]
[Libomptarget] Build the static library without CUDA installed

Summary:
This patch allows users to compile the static library without CUDA
installed on the system. This requires the new flag `--cuda-feature` to
indicate that we need `+ptx61` in order to compile the runtime.

2 years ago[CUDA] Add a flag to manually specify the target feature to use with CUDA
Joseph Huber [Fri, 13 May 2022 20:16:15 +0000 (16:16 -0400)]
[CUDA] Add a flag to manually specify the target feature to use with CUDA

Summary:
Normally we parse through the CUDA installation to disover the needed
features. However, we may want to build libraries on targets that do not
currently have CUDA installed but still need to know which features to
make use of when creating the PTX or bitcode. This flag is a simple way
to specify this so we can compile certain codes withotu a valid CUDA
installation.

Ideally this could be done via an -Xarch or simimlar flag but currently
they cannot handle this. We would need to support using an -Xarch flag
that takes multiple arguments that then pass them to the -Xclang
functionality.

2 years ago[BOLT][CMAKE] Fix DYLIB build
Amir Ayupov [Fri, 13 May 2022 20:14:45 +0000 (13:14 -0700)]
[BOLT][CMAKE] Fix DYLIB build

Move BOLT libraries out of `LLVM_LINK_COMPONENTS` to `target_link_libraries`.
Addresses issue #55432.

Reviewed By: rafauler

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

2 years ago[TableGen] Add a new json textmate description for syntax highlighting
River Riddle [Wed, 11 May 2022 22:49:24 +0000 (15:49 -0700)]
[TableGen] Add a new json textmate description for syntax highlighting

There isn't really a good pre-existing syntax highlighter for tablegen, so this
commit adds a textmate version that covers nearly everything in the current
spec.

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

2 years ago[BOLT][TEST] Fix testing on macos
Amir Ayupov [Fri, 13 May 2022 14:12:40 +0000 (07:12 -0700)]
[BOLT][TEST] Fix testing on macos

- Fix common (arch-independent) tests to explicitly target -linux triple.
- Override the triple inside arch-specific tests.
- Add cflags to common tests.
- Update individual tests.
- Expand pipe stderr `|&` shorthand.

Reviewed By: rafauler

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

2 years ago[Clang] Add DriverKit support
Egor Zhdan [Wed, 16 Mar 2022 19:31:04 +0000 (19:31 +0000)]
[Clang] Add DriverKit support

This is the second patch that upstreams the support for Apple's DriverKit.

The first patch: https://reviews.llvm.org/D118046.

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

2 years ago[lldb] Parallelize fetching symbol files in crashlog.py
Jonas Devlieghere [Fri, 13 May 2022 19:15:05 +0000 (12:15 -0700)]
[lldb] Parallelize fetching symbol files in crashlog.py

When using dsymForUUID, the majority of time symbolication a crashlog
with crashlog.py is spent waiting for it to complete. Currently, we're
calling dsymForUUID sequentially when iterating over the modules. We can
drastically cut down this time by calling dsymForUUID in parallel. This
patch uses Python's ThreadPoolExecutor (introduced in Python 3.2) to
parallelize this IO-bound operation.

The performance improvement is hard to benchmark, because even with an
empty local cache, consecutive calls to dsymForUUID for the same UUID
complete faster. With warm caches, I'm seeing a ~30% performance
improvement (~90s -> ~60s). I suspect the gains will be much bigger for
a cold cache.

dsymForUUID supports batching up multiple UUIDs. I considered going that
route, but that would require more intrusive changes. It would require
hoisting the logic out of locate_module_and_debug_symbols which we
explicitly document [1] as a feature of Symbolication.py to locate
symbol files.

[1] https://lldb.llvm.org/use/symbolication.html

Differential reviison: https://reviews.llvm.org/D125107

2 years ago[GlobalISel] Combine G_SHL, G_ASHR, G_SHL of undef shifts to undef.
Amara Emerson [Thu, 5 May 2022 20:55:49 +0000 (13:55 -0700)]
[GlobalISel] Combine G_SHL, G_ASHR, G_SHL of undef shifts to undef.

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