Changes

Summary

  1. [FuncSpec] Don't specialise functions with attribute NoDuplicate. (details)
  2. [mlir] separable registration of operation interfaces (details)
  3. [libcxx] Fix a case of -Wundef warnings regarding _POSIX_TIMERS (details)
  4. [llvm-dlltool] [test] Test both short and long forms of options. NFC. (details)
  5. [llvm-dlltool] [test] Remove superfluous --coff-exports option to llvm-readobj. NFC. (details)
  6. [llvm-dlltool] [test] Add a testcase for all machine option types. NFC. (details)
  7. [llvm-dlltool] Imply the target arch from a tool triple prefix (details)
  8. [LLD] [COFF] Remove a stray duplicate comment. NFC. (details)
  9. [ELF] Restore arm-branch.s test (details)
  10. [NFC] test commit, fix namespace ending comment. (details)
  11. [flang] preserve symbol in DescriptorInquiry (details)
  12. [InstCombine] Fix miscompile on GEP+load to icmp fold (PR45210) (details)
  13. [hwasan] Do not use short granule tags as poison tags. (details)
  14. [hwasan] Improve report for addresses within regions. (details)
  15. [mlir] Enable delayed registration of attribute/operation/type interfaces (details)
  16. [lldb] Set return object failed status even if error string is empty (details)
  17. [lldb] Remove redundant calls to set eReturnStatusFailed (details)
  18. [mlir] define a customized DEBUG_TYPE in InterfaceSupport.h (details)
  19. [X86] Add test showing binary differences with -x86-pad-for-align. (details)
  20. [libc] Generate one benchmark per implementation (details)
  21. [X86] Check using default in test added in 0bd5bbb31e0345ae. (details)
  22. [mlir][linalg] Purge linalg.indexed_generic. (details)
  23. [X86] combineSelect - refactor MIN/MAX detection code to make it easier to add additional select(setcc,x,y) folds. NFCI. (details)
  24. [mlir] Split things dependent on LLVM_DEBUG into a .cpp file (details)
  25. [FuncSpec] Precommit test: don't specialise funcs with NoDuplicate instrs. NFC. (details)
  26. [lldb] Remove redundant calls to set eReturnStatusFailed (details)
  27. [mlir] Remove linalg.indexed_generic forward decl. (details)
  28. [DebugInfo] Prevent non-determinism when updating DIArgList users of a value (details)
  29. [Sema] Fix for PR50741 (details)
  30. Revert "[DebugInfo] Prevent non-determinism when updating DIArgList users of a value" (details)
  31. [llvm] fix typo in comment (details)
  32. [FPEnv][InstSimplify] Precommit tests for D103169. (details)
Commit dcd23d875a7e3750903ca4ec865508544757dd99 by sjoerd.meijer
[FuncSpec] Don't specialise functions with attribute NoDuplicate.

Differential Revision: https://reviews.llvm.org/D104378
The file was modifiedllvm/lib/Transforms/IPO/FunctionSpecialization.cpp
The file was addedllvm/test/Transforms/FunctionSpecialization/function-specialization-nodup.ll
Commit 23cdf7b6ed9781040ef7923372247ce30b250f29 by zinenko
[mlir] separable registration of operation interfaces

This is similar to attribute and type interfaces and mostly the same mechanism
(FallbackModel / ExternalModel, ODS generation). There are minor differences in
how the concept-based polymorphism is implemented for operations that are
accounted for by ODS backends, and this essentially adds a test and exposes the
API.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D104294
The file was modifiedmlir/include/mlir/IR/OperationSupport.h
The file was modifiedmlir/test/lib/Dialect/Test/TestInterfaces.td
The file was modifiedmlir/lib/IR/MLIRContext.cpp
The file was modifiedmlir/unittests/IR/InterfaceAttachmentTest.cpp
The file was modifiedmlir/docs/Interfaces.md
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
Commit d7550e5d105f998ea34bd6c51c03d37a8c546025 by martin
[libcxx] Fix a case of -Wundef warnings regarding _POSIX_TIMERS

Differential Revision: https://reviews.llvm.org/D104372
The file was modifiedlibcxx/src/chrono.cpp
Commit 4fe3d5248dfae0a864f0cf0c77d10c4a966f05a9 by martin
[llvm-dlltool] [test] Test both short and long forms of options. NFC.

Differential Revision: https://reviews.llvm.org/D104213
The file was modifiedllvm/test/tools/llvm-dlltool/coff-noname.def
Commit 08be746728d7de59b045681a4a0f6567f14adea3 by martin
[llvm-dlltool] [test] Remove superfluous --coff-exports option to llvm-readobj. NFC.

The --coff-exports option to llvm-readobj prints the exported symbols
from a DLL/EXE, it doesn't do anything with regards to an import
library.

Differential Revision: https://reviews.llvm.org/D104214
The file was modifiedllvm/test/tools/llvm-dlltool/coff-exports.def
Commit 675d52bc46ff7e618ffa2fb282d031e387e3a114 by martin
[llvm-dlltool] [test] Add a testcase for all machine option types. NFC.

The existing tests only test that some options (but not e.g. arm)
are accepted, but it doesn't test their functional effect of
affecting the generated object files.

Differential Revision: https://reviews.llvm.org/D104215
The file was addedllvm/test/tools/llvm-dlltool/machine-opt.def
Commit ca56b33daf6781a248750b6d538cef84fdae0d1b by martin
[llvm-dlltool] Imply the target arch from a tool triple prefix

Also use the default LLVM target as default for dlltool. This
matches how GNU dlltool behaves; it is compiled with one default
target, which is used if no option is provided.

Extend the anonymous namespace in the implementation file instead
of using static functions.

Based on a patch by Mateusz Mikuła.

The effect of the default LLVM target, if neither the -m option
nor a tool triple prefix is provided, isn't tested, as we can't
make assumptions about what it is set to.

(We could make the default be forced to one of the four supported
architectures if the default triple is another arch, and then just
test that llvm-dlltool without an -m option is able to produce an
import library, without checking the actual architecture though.)

Differential Revision: https://reviews.llvm.org/D104212
The file was addedllvm/test/tools/llvm-dlltool/triple-prefix.def
The file was modifiedllvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp
Commit ceee35e3e4bf9729e1aae9bfadd6d25bfe3769ee by martin
[LLD] [COFF] Remove a stray duplicate comment. NFC.

The following class isn't part of the export table; there's a
second correctly placed comment about the things that actually
belong to the export table.
The file was modifiedlld/COFF/DLL.cpp
Commit 5355b8c6318c194ff15241b7a3217a51fc1a644b by ikudrin
[ELF] Restore arm-branch.s test

After D77330, the comments are inconsistent with the disassembled code.
As the value of `far` has been changed, a thunk to reach it is now
generated, and target addresses of branch instructions are different
from what was initially expected.

The patch fixes that and makes the test closer to what it was originally.

Differential Revision: https://reviews.llvm.org/D104286
The file was modifiedlld/test/ELF/Inputs/far-arm-abs.s
The file was modifiedlld/test/ELF/arm-branch.s
The file was modifiedlld/test/ELF/Inputs/far-long-arm-abs.s
Commit b18f30fb2dd157e5fef91d9327fd12b8965e7e0c by fmayer
[NFC] test commit, fix namespace ending comment.
The file was modifiedcompiler-rt/lib/hwasan/hwasan_thread_list.cpp
The file was modifiedcompiler-rt/lib/hwasan/hwasan_thread_list.h
Commit 1a4af2e45ee59cff3d577986b9b7f3f5bd5ab01f by jperier
[flang] preserve symbol in DescriptorInquiry

Do not use ultimate symbols in DescriptorInquiry. Using the ultimate
symbol may lead to issues later for at least two reasons:

- The original symbols may have volatile/asynchronous attributes that
  the ultimate may not have. Later phases working on the DescriptorInquiry
  would then not apply potential care required by these attributes.
- HostAssociatedDetails symbols are used by OpenMP for symbols with
  special OpenMP attributes inside OpenMP region (e.g variables with
  private attribute), so it is very important to preserve this
  aspect in the DescriptorInquiry, that would otherwise apply on the
  symbol outside of the region.

Differential Revision: https://reviews.llvm.org/D104385
The file was modifiedflang/lib/Evaluate/shape.cpp
The file was modifiedflang/lib/Evaluate/variable.cpp
Commit 69b0ed9a0a6aeab0b1c93d0a76c66a63c1d6f410 by aqjune
[InstCombine] Fix miscompile on GEP+load to icmp fold (PR45210)

As noted in PR45210: https://bugs.llvm.org/show_bug.cgi?id=45210
...the bug is triggered as Eli say when sext(idx) * ElementSize overflows.

```
   // assume that GV is an array of 4-byte elements
   GEP = gep GV, 0, Idx // this is accessing Idx * 4
   L = load GEP
   ICI = icmp eq L, value
 =>
   ICI = icmp eq Idx, NewIdx
```

The foldCmpLoadFromIndexedGlobal function simplifies GEP+load operation to icmp.
And there is a problem because Idx * ElementSize can overflow.

Let's assume that the wanted value is at offset 0.
Then, there are actually four possible values for Idx to match offset 0: 0x00..00, 0x40..00, 0x80..00, 0xC0..00.
We should return true for all these values, but currently, the new icmp only returns true for 0x00..00.

This problem can be solved by masking off (trailing zeros of ElementSize) bits from Idx.

```
   ...
 =>
   Idx' = and Idx, 0x3F..FF
   ICI = icmp eq Idx', NewIdx
```

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D99481
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
The file was modifiedllvm/test/Transforms/InstCombine/load-cmp.ll
Commit 18070723ef5cfd7d58bc296fedb67b5e3a88908f by fmayer
[hwasan] Do not use short granule tags as poison tags.

Short granule tags as poison cause a UaF to read the referenced
memory to retrieve the tag, and means we do not detect the UaF
if the last granule's tag is still around.

This only increases the change of not catching a UaF from
0.39 % (1 / 256) to 0.42 % (1 / (256 - 17)).

Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D104304
The file was modifiedcompiler-rt/lib/hwasan/hwasan_allocator.cpp
Commit ccc0f777f6967c557ba066070f40e5fac9e0127d by fmayer
[hwasan] Improve report for addresses within regions.

Before: ADDR is located -320 bytes to the right of 1072-byte region
After: ADDR is located 752 bytes inside 1072-byte region

Reviewed By: eugenis, walli99

Differential Revision: https://reviews.llvm.org/D104412
The file was modifiedcompiler-rt/lib/hwasan/hwasan_report.cpp
The file was addedcompiler-rt/test/hwasan/TestCases/heap-buffer-overflow-into.c
Commit d7e891213444e2990397c623fb0250a470421fce by zinenko
[mlir] Enable delayed registration of attribute/operation/type interfaces

This functionality is similar to delayed registration of dialect interfaces. It
allows external interface models to be registered before the dialect containing
the attribute/operation/type interface is loaded, or even before the context is
created.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D104397
The file was modifiedmlir/unittests/IR/InterfaceAttachmentTest.cpp
The file was modifiedmlir/include/mlir/Support/InterfaceSupport.h
The file was modifiedmlir/include/mlir/IR/AttributeSupport.h
The file was modifiedmlir/include/mlir/IR/Dialect.h
The file was modifiedmlir/include/mlir/IR/TypeSupport.h
The file was modifiedmlir/lib/IR/MLIRContext.cpp
The file was modifiedmlir/lib/IR/Dialect.cpp
Commit 983ed1b58ef9d0f97c9cec2876f631e47609d437 by david.spickett
[lldb] Set return object failed status even if error string is empty

The idea is now that AppendError<...> will set eReturnStatusFailed
for you so you don't have to call SetStatus again.

Previously if the error message was empty, the status wouldn't
be set.

I don't think there are any sitautions where the message is in
fact empty but it potentially could be depending on where
we get the string from.

So let's set the status up front then return early if the message is empty.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D104380
The file was modifiedlldb/source/Interpreter/CommandReturnObject.cpp
Commit 7a580f3c28cf47a7e489faa1fc1ab7b88d9a5dbd by david.spickett
[lldb] Remove redundant calls to set eReturnStatusFailed

Since https://reviews.llvm.org/D103701 AppendError<...>
sets this for you.

This change includes all of the non-command uses.

Some uses remain where it's either tricky to reason about
the logic, or they aren't paired with AppendError calls.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D104379
The file was modifiedlldb/source/API/SBCommandInterpreter.cpp
The file was modifiedlldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
The file was modifiedlldb/source/Breakpoint/BreakpointIDList.cpp
The file was modifiedlldb/source/Interpreter/CommandAlias.cpp
The file was modifiedlldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
The file was modifiedlldb/source/Interpreter/CommandInterpreter.cpp
The file was modifiedlldb/source/Interpreter/Options.cpp
The file was modifiedlldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
The file was modifiedlldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
The file was modifiedlldb/source/Interpreter/ScriptInterpreter.cpp
The file was modifiedlldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
Commit 6b6338195c1b1a32a62adb37204022c1760eb899 by zinenko
[mlir] define a customized DEBUG_TYPE in InterfaceSupport.h
The file was modifiedmlir/include/mlir/Support/InterfaceSupport.h
Commit 0bd5bbb31e0345aed8d029d70a4197aed53a3cd5 by flo
[X86] Add test showing binary differences with -x86-pad-for-align.

This patch adds a test case showing how a single extra .loc can cause
binary differences when using -x86-pad-for-align=true.

The issue has been discussed in D94542, PR42138, PR48742.
The file was addedllvm/test/MC/X86/Inputs/pad-align-with-debug.s
The file was addedllvm/test/MC/X86/pad-for-align-debug.s
The file was addedllvm/test/MC/X86/Inputs/pad-align-without-debug.s
Commit 8d64ed854449467a3a5fc4450c71a4525a24c4be by gchatelet
[libc] Generate one benchmark per implementation

We now generate as many benchmarks as there are implementations.

Differential Revision: https://reviews.llvm.org/D102156
The file was modifiedlibc/benchmarks/CMakeLists.txt
The file was modifiedlibc/benchmarks/LibcMemoryBenchmarkMain.cpp
Commit aa6e8e9572d54d8fdcd6e8789ea7076640011066 by flo
[X86] Check using default in test added in 0bd5bbb31e0345ae.

Make sure llvm-mc is invariant with respect to debug locations in the
test (checks update to use the -x86-pad-for-align default value)
The file was modifiedllvm/test/MC/X86/pad-for-align-debug.s
Commit 5b3cb31edbcf99ef15c2de2d29ad0ff9927ba136 by pifon
[mlir][linalg] Purge linalg.indexed_generic.

Differential Revision: https://reviews.llvm.org/D104449
The file was modifiedmlir/test/Dialect/Linalg/canonicalize-duplicate-inputs.mlir
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/test/Dialect/Linalg/canonicalize.mlir
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Loops.cpp
The file was modifiedmlir/test/Dialect/Linalg/invalid.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Generalization.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Bufferize.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/test/Dialect/Linalg/roundtrip.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
The file was modifiedmlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/FusionOnTensors.cpp
Commit cdb4fcf9a19ca35b50754791f3986337046d9406 by llvm-dev
[X86] combineSelect - refactor MIN/MAX detection code to make it easier to add additional select(setcc,x,y) folds. NFCI.

I need to add some additional handling to address some of the regressions from D101074
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit c878d03d60fc91ecad661f4435ce70bf276f3bdb by benny.kra
[mlir] Split things dependent on LLVM_DEBUG into a .cpp file

LLVM_DEBUG in headers is awkward, better avoid it. DEBUG_TYPE in a
header results in a lot of macro redefinition warnings.
The file was modifiedmlir/lib/Support/CMakeLists.txt
The file was modifiedmlir/include/mlir/Support/InterfaceSupport.h
The file was addedmlir/lib/Support/InterfaceSupport.cpp
Commit 3f596842e3d25009c4d62c75e5b24b515bde8e93 by sjoerd.meijer
[FuncSpec] Precommit test: don't specialise funcs with NoDuplicate instrs. NFC.
The file was addedllvm/test/Transforms/FunctionSpecialization/function-specialization-nodup2.ll
Commit eaf60a4411f79a1addfa6c5d8ddf4b47e082881e by david.spickett
[lldb] Remove redundant calls to set eReturnStatusFailed

This is part 2, covering the commands source.

Some uses remain where it's tricky to see what the
logic is or they are not used with AppendError.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D104448
The file was modifiedlldb/source/Commands/CommandObjectLog.cpp
The file was modifiedlldb/source/Commands/CommandObjectType.cpp
The file was modifiedlldb/source/Commands/CommandObjectBreakpoint.cpp
The file was modifiedlldb/source/Commands/CommandObjectDisassemble.cpp
The file was modifiedlldb/source/Commands/CommandObjectMultiword.cpp
The file was modifiedlldb/source/Commands/CommandObjectRegister.cpp
The file was modifiedlldb/source/Commands/CommandObjectWatchpointCommand.cpp
The file was modifiedlldb/source/Commands/CommandObjectSettings.cpp
The file was modifiedlldb/source/Commands/CommandObjectQuit.cpp
The file was modifiedlldb/source/Commands/CommandObjectMemory.cpp
The file was modifiedlldb/source/Commands/CommandObjectTarget.cpp
The file was modifiedlldb/source/Commands/CommandObjectPlatform.cpp
The file was modifiedlldb/source/Commands/CommandObjectScript.cpp
The file was modifiedlldb/source/Commands/CommandObjectStats.cpp
The file was modifiedlldb/source/Commands/CommandObjectProcess.cpp
The file was modifiedlldb/source/Commands/CommandObjectGUI.cpp
The file was modifiedlldb/source/Commands/CommandObjectExpression.cpp
The file was modifiedlldb/source/Commands/CommandObjectFrame.cpp
The file was modifiedlldb/source/Commands/CommandObjectReproducer.cpp
The file was modifiedlldb/source/Commands/CommandObjectTrace.cpp
The file was modifiedlldb/source/Commands/CommandObjectHelp.cpp
The file was modifiedlldb/source/Commands/CommandObjectCommands.cpp
The file was modifiedlldb/source/Commands/CommandObjectBreakpointCommand.cpp
The file was modifiedlldb/source/Commands/CommandObjectThreadUtil.cpp
The file was modifiedlldb/source/Commands/CommandObjectThread.cpp
The file was modifiedlldb/source/Commands/CommandObjectPlugin.cpp
The file was modifiedlldb/source/Commands/CommandObjectSource.cpp
The file was modifiedlldb/source/Commands/CommandObjectWatchpoint.cpp
The file was modifiedlldb/source/Commands/CommandObjectApropos.cpp
Commit 7cddf56d608f07b8e49f7e2eeb4a20082611adb6 by pifon
[mlir] Remove linalg.indexed_generic forward decl.
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
Commit fa1de88f81e9c6db5255ca7c4d0fd25606c5a054 by stephen.tozer
[DebugInfo] Prevent non-determinism when updating DIArgList users of a value

This patch fixes an issue where builds of programs with multiple dbg.values
with DIArgList locations could have non-deterministic output. This issue
was caused by ReplaceableMetadataImpl::getAllArgListUsers, which
returned DIArgList pointers in a random order; the output of this
function would later be used to insert dbg.values, causing the order of
insertion to be non-deterministic. This patch changes getAllArgListUsers
to return pointers in a fixed order.

Differential Revision: https://reviews.llvm.org/D104105
The file was modifiedllvm/lib/IR/Metadata.cpp
Commit fc6ec9b98cf96bca8f68cc65395f861919c06c2f by Chris.Hamilton
[Sema] Fix for PR50741

Fixed crash when doing pointer math on a void pointer.

Also, reworked test to use -verify rather than FileCheck.

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D104424
The file was modifiedclang/test/Sema/unbounded-array-bounds.c
The file was modifiedclang/lib/Sema/SemaChecking.cpp
Commit e8991caea8690ec2d17b0b7e1c29bf0da6609076 by stephen.tozer
Revert "[DebugInfo] Prevent non-determinism when updating DIArgList users of a value"

Commit caused build errors on buildbots with [-Werror,-Wreturn-std-move]
enabled.

This reverts commit fa1de88f81e9c6db5255ca7c4d0fd25606c5a054.
The file was modifiedllvm/lib/IR/Metadata.cpp
Commit 26f1f6d0deaff4d718e32b8e97ea21968c506b60 by gchatelet
[llvm] fix typo in comment
The file was modifiedllvm/include/llvm/CodeGen/MachineFrameInfo.h
Commit 60a8edf30d297c8c56988c083801ce1cfc41bb6b by kevin.neal
[FPEnv][InstSimplify] Precommit tests for D103169.

In D103169 I'm adding to InstSimplify support for NaN to constrained
intrinsics that have a regular FP IR instruction counterpart. Precommit
the tests for clarity when that ticket lands.
The file was addedllvm/test/Transforms/InstSimplify/X86/fp-nan-strictfp.ll
The file was addedllvm/test/Transforms/InstSimplify/fp-undef-poison-strictfp.ll