Commit Graph

409378 Commits

Author SHA1 Message Date
Benjamin Kramer ae29d5a484 [mlir] Provide a home for mlir::LLVM::GEPOp::kDynamicIndex
C++14 requires this and will trigger linker errors when optimizations
are disabled.
2022-01-07 12:06:04 +01:00
Adrian Kuegel 50da013406 [mlir] Use const reference for loop iteration variable. 2022-01-07 12:00:53 +01:00
Archibald Elliott 11c67e5a4e [clang][driver] Don't pass -Wunaligned-access to cc1as
This is to fix some failing assembler tests.
2022-01-07 10:45:26 +00:00
Marek Kurdej 359b4e6cdb [clang-format] Use prefix increment and decrement. NFC. 2022-01-07 11:19:53 +01:00
Qiu Chaofan c9e8a516df [NFC] Pre-commit case for PowerPC perfect shuffle 2022-01-07 18:07:26 +08:00
Roman Lebedev a5a6960d1c
[NFCI][IR] MinMaxIntrinsic: add some more helper methods, and use them 2022-01-07 13:02:11 +03:00
Lian Wang e8f1dfe923 [RISCV] Supplement PACKH instruction pattern
Optimize (rs1 & 255) | ((rs2 & 255) << 8) -> (PACKH rs1, rs2).

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D116791
2022-01-07 17:59:19 +08:00
Nikita Popov 0312fe2901 [CodeGen] Support opaque pointers for inline asm
This is the last part of D116531. Fetch the type of the indirect
inline asm operand from the elementtype attribute, rather than
the pointer element type.

Fixes https://github.com/llvm/llvm-project/issues/52928.
2022-01-07 10:57:38 +01:00
Mubashar Ahmad 2cd2600aba Unaligned Access Warning Added
Added warning for potential cases of
unaligned access when option
-mno-unaligned-access has been specified
2022-01-07 09:54:20 +00:00
Nikita Popov e4d1779990 [IR] Add ConstraintInfo::hasArg() helper (NFC)
Checking whether a constraint corresponds to an argument is a
recurring pattern.
2022-01-07 10:44:38 +01:00
Egor Zhdan c033f0d9b1 [Clang][Sema] Avoid crashing for va_arg expressions with bool argument
This change fixes a compiler crash that was introduced in https://reviews.llvm.org/D103611: `Sema::BuildVAArgExpr` attempted to retrieve a corresponding signed type for `bool` by calling `ASTContext::getCorrespondingSignedType`.

rdar://86580370

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D116272
2022-01-07 10:41:45 +01:00
Jay Foad 080f372ad3 [SystemZ][z/OS] Fix test failure when SystemZ target is not built 2022-01-07 09:39:01 +00:00
Marek Kurdej 91b9e6729c [clang-format] Fix `BraceWrapping: AfterFunction` affecting synchronized blocks in Java.
Fixes https://github.com/llvm/llvm-project/issues/32031.

Before this change, BraceWrapping: AfterFunction would affect synchronized blocks in Java, but they should be formatted w.r.t. BraceWrapping: AfterControlStatement.

Using the config:
```
BreakBeforeBraces: Custom
BraceWrapping:
  AfterControlStatement: false
  AfterFunction: true
```

would result in misformatted code like:
```
class Foo {
  void bar()
  {
    synchronized (this)
    {
      a();
      a();
    }
  }
}
```

instead of:
```
class Foo {
  void bar()
  {
    synchronized (this) {
      a();
      a();
    }
  }
}
```

Reviewed By: MyDeveloperDay, owenpan

Differential Revision: https://reviews.llvm.org/D116767
2022-01-07 10:06:49 +01:00
Marek Kurdej 01f355fe95 [clang-format] Use range-for loops. NFC.
Reviewed By: MyDeveloperDay, owenpan

Differential Revision: https://reviews.llvm.org/D116795
2022-01-07 10:01:09 +01:00
Alex Zinenko f50cfc44d6 [mlir] Require struct indices in LLVM::GEPOp to be constant
Recent commits added a possibility for indices in LLVM dialect GEP operations
to be supplied directly as constant attributes to ensure they remain such until
translation to LLVM IR happens. Make this required for indexing into LLVM
struct types to match LLVM IR requirements, otherwise the translation would
assert on constructing such IR.

For better compatibility with MLIR-style operation construction interface,
allow GEP operations to be constructed programmatically using Values pointing
to known constant operations as struct indices.

Depends On D116758

Reviewed By: wsmoses

Differential Revision: https://reviews.llvm.org/D116759
2022-01-07 09:56:05 +01:00
Alex Zinenko 43ff4a6d55 [mlir] Add ConstantLike trait to LLVM::ConstantOp
This make LLVM dialect constants to work with `m_constant` matches. Implement
the folding hook for this operation as required by the trait. This in turn
allows LLVM::ConstantOp to properly participate in constant-folding.

Depends On D116757

Reviewed By: wsmoses

Differential Revision: https://reviews.llvm.org/D116758
2022-01-07 09:56:03 +01:00
Alex Zinenko cafaa35036 [mlir] Make it possible to directly supply constant values to LLVM GEPOp
In LLVM IR, the GEP indices that correspond to structures are required to be
i32 constants. MLIR models constants as just values defined by special
operations, and there is no verification that it is the case for structure
indices in GEP. Furthermore, some common transformations such as control flow
simplification may lead to the operands becoming non-constant. Make it possible
to directly supply constant values to LLVM GEPOp to guarantee they remain
constant until the translation to LLVM IR. This is not yet a requirement and
the verifier is not modified, this will be introduced separately.

Reviewed By: wsmoses

Differential Revision: https://reviews.llvm.org/D116757
2022-01-07 09:56:01 +01:00
Nikita Popov 348bc76e35 [LibCalls] Infer same attrs for reallocf() as realloc()
reallocf() is the same as realloc() but frees the input pointer
on failure as well. We can infer the same attributes.

Also combine some cases that infer the same attributes and are
logically related.
2022-01-07 09:51:15 +01:00
Victor Perez 38efa68b08 [LegalizeTypes][VP] Add splitting support for vp.select
Split vp.select in a similar way as vselect, splitting also the length
parameter.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D116651
2022-01-07 08:46:01 +00:00
Kazu Hirata 2aed08131d [llvm] Use true/false instead of 1/0 (NFC)
Identified with modernize-use-bool-literals.
2022-01-07 00:39:14 -08:00
William S. Moses 34646a2f7e [MLIR][Arith] Fold repeated xor and trunc
This patch adds two folds. One for a repeated xor (e.g. xor(xor(x, a), a)) and one for a repeated trunc (e.g. trunc(trunc(x))).

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D116383
2022-01-07 03:36:10 -05:00
Nikita Popov 9e4aeb1f60 [LoopUnroll] Remove unrelated passes from test (NFC)
Manually run these and use the result as the initial input for
the test.
2022-01-07 09:20:23 +01:00
Nikita Popov c8189da201 [ModuleUtils] Remove dead arg from filterDeadComdatFunctions() (NFC)
The module argument is no longer used.
2022-01-07 09:12:16 +01:00
Nikita Popov 291660e62f [SystemZ] Add missing elementtype in python test (NFC)
Missed this originally because it does not run locally.
2022-01-07 09:08:38 +01:00
Qiu Chaofan c2cc70e4f5 [NFC] Fix endif comments to match with include guard 2022-01-07 15:52:59 +08:00
Kazu Hirata 410480e32b Ensure newlines at the end of files (NFC) 2022-01-06 23:44:02 -08:00
Erik Desjardins a8ac117d98 [X86] add dwarf information for loop stack probe
This patch is based on https://reviews.llvm.org/D99585.

While inside the stack probing loop, temporarily change the CFA
to be based on r11/eax, which are already used to hold the loop bound.
The stack pointer cannot be used for CFI here as it changes during the loop,
so it does not have a constant offset to the CFA.

Co-authored-by: YangKeao <keao.yang@yahoo.com>

Reviewed By: nagisa

Differential Revision: https://reviews.llvm.org/D116628
2022-01-07 15:02:59 +08:00
Kazu Hirata f3a344d212 [Target] Remove redundant member initialization (NFC)
Identified with readability-redundant-member-init.
2022-01-06 22:01:44 -08:00
Shraiysh Vaishay 6bcb4c44de [mlir][OpenMP] Added omp.atomic.write lowering to LLVM IR
This patch adds omp.atomic.write lowering to LLVM IR.
Also, changed the syntax to have equal symbol instead of the comma to
make it more intuitive.

Reviewed By: kiranchandramohan, peixin

Differential Revision: https://reviews.llvm.org/D116416
2022-01-07 10:01:57 +05:30
wangpc 91cf2a9b6c [RISCV][NFC] Use sub operator to generate register list
There are several duplicated lines for generating GPRXXX's
register list that can be eliminated by using `sub` operator.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D116729
2022-01-07 12:29:58 +08:00
Dave Lee bd23dffc2c Revert "[lldb] Compute fully qualified command names in FindCommandsForApropos"
This reverts commit b3bfd595a5.
2022-01-06 20:15:19 -08:00
Dave Lee b3bfd595a5 [lldb] Compute fully qualified command names in FindCommandsForApropos
Fixes incomplete command names in `apropos` results.

The full command names given by `apropos` have come from command name string
literals given to `CommandObject` constructors. For most commands, this has
been accurate, but some commands have incorrect strings. This results in
`apropos` output that doesn't tell the user the full command name they might
want learn more about. These strings can be fixed.

There's a seperate issue that can't be fixed as easily: plugin commands. With
the way they're implemented, plugin commands have to exclude the root command
from their command name string. To illustrate, the `language objc` subcommand
has to set its command name string to "objc", which results in apropos printing
results as `objc ...` instead of `language objc ...`.

To fix both of these issues, this commit changes `FindCommandsForApropos` to
derive the fully qualified command name using the keys of subcommand maps.

Differential Revision: https://reviews.llvm.org/D116491
2022-01-06 19:26:57 -08:00
Shao-Ce SUN 808c0987c3 [NFC][RISCV] Make the macro names more uniform
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D116719
2022-01-07 11:09:41 +08:00
Philip Reames c6a0c1585a Revert "Extract utility function for checking initial value of allocation [NFC]"
This reverts commit 9ce30fe86f.  Appears to be causing a problem on a buildbot, revert while investigating.

https://green.lab.llvm.org/green//job/clang-stage1-RA/26818/consoleFull#-1502953973d489585b-5106-414a-ac11-3ff90657619c
2022-01-06 19:05:51 -08:00
Jim Lin 6d065ef7b9 [M68k][NFC] Fix typo. BCNG->BCHG 2022-01-07 10:46:43 +08:00
Kazu Hirata e6075b2c2c [mlir] Fix a warning
This patch fixes:

  mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h:913:30:
  error: private field 'options' is not used
  [-Werror,-Wunused-private-field]
2022-01-06 18:41:07 -08:00
Yusra Syeda fc8a08765a [SystemZ][z/OS] Add entry point marker to PPA
Differential Revision: https://reviews.llvm.org/D115269
2022-01-06 21:29:20 -05:00
Liqin Weng 92153a9aa7 [RISCV] Support immediate vtype of VSETVLI/VSETIVLI in asm parser
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D115133
2022-01-07 02:26:41 +00:00
Philip Reames 9ce30fe86f Extract utility function for checking initial value of allocation [NFC]
This is a reoccuring pattern, we can consolidate three copies into one.  The main motivation is to reduce usages of isMallocLike.
2022-01-06 18:02:14 -08:00
Philip Reames 5d1cfd4348 Remove unused LookThroughBitCast param in isXAllocLike functions [NFC]
This parameter took the non-default value exactly twice, and neither had semantic effect.
2022-01-06 18:02:13 -08:00
Philip Reames 7052670e96 Move getMallocAllocatedType and getMallocArraySize to GlobalOpt [NFC]
These are implementation details of the global-opt transform and not easily reuseable, so remove them from the analysis header.
2022-01-06 18:02:13 -08:00
Philip Reames 67a3331e4f Inline extractMallocCall to sole use and delete [NFC] 2022-01-06 18:02:13 -08:00
Philip Reames 4b0fc924a9 Delete unused extractCallocCall routine [NFC] 2022-01-06 18:02:13 -08:00
Philip Reames cffd268316 Demote getMallocType to implementation routine in MemoryBuiltins [NFC] 2022-01-06 18:02:13 -08:00
Nicolas Vasilache 07c009ed55 [mlir][Linalg] Fix invalid FailureOr construction from LogicalResult::success 2022-01-06 18:43:23 -05:00
Nikolas Klauser bec50db2ed [libc++] Implement P1072R10 (std::basic_string::resize_and_overwrite)
Reviewed By: Quuxplusone, #libc, Mordante

Spies: mzeren-vmw, ckennelly, arichardson, ldionne, Mordante, libcxx-commits, Quuxplusone

Differential Revision: https://reviews.llvm.org/D113013
2022-01-07 00:09:16 +01:00
Andrew Browne 7607ddd981 [NFC][DFSan] Cleanup code to use align functions.
Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D116761
2022-01-06 14:42:38 -08:00
Nicolas Vasilache 9cd7e880fd [mlir][Linalg] NFC - Modernize more transformation patterns.
Differential Revision: https://reviews.llvm.org/D116763
2022-01-06 17:40:23 -05:00
Roman Lebedev 6a563e2570
[NFC][SCEV][IndVars] Add more tests for exit count w/ `select`
See https://github.com/llvm/llvm-project/issues/53020
2022-01-07 01:30:21 +03:00
Arlo Siemsen 3d10997e42 Add Rust to CodeView SourceLanguage (CV_CFL_LANG) enum
Microsoft has added several new entries to the CV_CFL_LANG enum, including Rust:
    https://docs.microsoft.com/en-us/visualstudio/debugger/debug-interface-access/cv-cfl-lang

This change adds Rust to the corresponding LLVM enum and translates `dwarf::DW_LANG_Rust` to `SourceLanguage::Rust` in the CodeView AsmPrinter.

This means that Rust will no longer emit as Masm.

Differential Revision: https://reviews.llvm.org/D115300
2022-01-06 14:27:08 -08:00