Commit Graph

400160 Commits

Author SHA1 Message Date
mydeveloperday 5fcde57b73 [clang-format] NFC ensure Penality variable is passed back with Fixes
Fix set but not used warning
2021-09-23 22:05:20 +01:00
Petr Hosek c7bcd72a38 Revert "[Polly] Implement user-directed loop distribution/fission."
This reverts commit 52c30adc7d which
breaks the build when NDEBUG is defined.
2021-09-23 14:04:25 -07:00
Duncan P. N. Exon Smith c7b1279a38 Support: Add closing namespace comment in raw_ostream_test.cpp, NFC
The closing namespace comment prevents clang-format from dropping a
blank line after the final test. Also add in a blank line (which
simplifies merging/rebasing/etc. WIP patches).
2021-09-23 16:59:03 -04:00
Michael Kruse 07e7cb9433 [Polly] Remove -polly-opt-fusion option.
The name of the option is misleading and has been renamed by isl to
"serialize-sccs". Instead of also renaming the option, remove it.
The option is still accessible using

    -polly-isl-arg=--no-schedule-serialize-sccs
2021-09-23 15:43:08 -05:00
peter klausler f6ecea1a35 [flang] Represent (parentheses around derived types)
The strongly typed expression representation classes supported
a representation of parentheses only around intrinsic types
with specific kinds.  Parentheses around derived type variables
must also be preserved so that expressions may be distinguished
from variables; this distinction matters for actual arguments &
construct associations.

Differential Revision: https://reviews.llvm.org/D110355
2021-09-23 13:03:13 -07:00
Augusto Noronha fbaf367217 [lldb] Show fix-it applied even if expression didn't evaluate succesfully
If we applied a fix-it before evaluating an expression and that
expression didn't evaluate correctly, we should still tell users about
the fix-it we applied since that may be the reason why it didn't work
correctly.

Differential Revision: https://reviews.llvm.org/D109908
2021-09-23 16:45:04 -03:00
wren romano 221856f5cd [mlir][sparse] Moved a conditional from the RT library to the generated MLIR.
When generating code to add an element to SparseTensorCOO (e.g., when doing dense=>sparse conversion), we used to check for nonzero values on the runtime side, whereas now we generate MLIR code to do that check.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D110121
2021-09-23 12:44:17 -07:00
Stefan Gränitz 1286bbc85f [ORC][examples] Export exectuable symbols explicitly in LLJITWithExecutorProcessControl
Functions in static code that should be callable from JITed code must be exported. For dynamic libraries extern functions are exported by default. For exectuables, linkers usually strip them away unless we explicitly ask for keeping them.

Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D110345
2021-09-23 21:40:06 +02:00
Nico Weber 3fa43da7a3 [llvm] Fix a copy-pasto
We should use IMAGE_REL_I386_SECREL in the i386 section of this file.

IMAGE_REL_I386_SECREL and IMAGE_REL_AMD64_SECREL have the same
numeric value 0xB, so this doesn't change behavior.
2021-09-23 15:34:01 -04:00
Nico Weber 4450cf985f [llvm] Replace tab with spaces in one test
Also use just one space after comma. Now grepping for ', offset '
in llvm/test actually finds the test for `offset`.

No behavior change.
2021-09-23 15:34:01 -04:00
Stefan Gränitz 767b328e50 [ORC] Minor renaming and typo fixes (NFC)
Two typos, one unsused include and some leftovers from the TargetProcessControl -> ExecutorProcessControl renaming

Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D110260
2021-09-23 21:33:34 +02:00
Fangrui Song 0bb767e7db [InlineAdvisor] Use one single quote 2021-09-23 12:16:15 -07:00
LLVM GN Syncbot 1aed7fcf09 [gn build] Port a44ab17025 2021-09-23 19:01:30 +00:00
mydeveloperday a44ab17025 [clang-format] Add Left/Right Const fixer capability
Developers these days seem to argue over east vs west const like they used to argue over tabs vs whitespace or the various bracing style. These previous arguments were mainly eliminated with tools like `clang-format` that allowed those rules to become part of your style guide. Anyone who has been using clang-format in a large team over the last couple of years knows that we don't have those religious arguments any more, and code reviews are more productive.

https://www.youtube.com/watch?v=fv--IKZFVO8
https://mariusbancila.ro/blog/2018/11/23/join-the-east-const-revolution/
https://www.youtube.com/watch?v=z6s6bacI424

The purpose of this revision is to try to do the same for the East/West const discussion. Move the debate into the style guide and leave it there!

In addition to the new `ConstStyle: Right` or `ConstStyle: Left` there is an additional command-line argument `--const-style=left/right` which would allow an individual developer to switch the source back and forth to their own style for editing, and back to the committed style before commit. (you could imagine an IDE might offer such a switch)

The revision works by implementing a separate pass of the Annotated lines much like the SortIncludes and then create replacements for constant type declarations.

Differential Revision: https://reviews.llvm.org/D69764
2021-09-23 20:00:33 +01:00
David Green 52272f294f [AArch64] Update some sve-fixed-length test checks.
Some of these test show very poor code generation. Updating the tests
to make the tests more maintainable and prevent problems from being
hidden behind badly written test checks. Also in some of them the check
lines were using incorrect prefixes.

These are not-quite auto-generated. They are generated with the normal
update scripts and then uninteresting checks are removed, which at least
makes the test _more_ maintainable without materially changing what they
are testing.

I have otherwise attempted to not alter what is tested.
2021-09-23 19:30:45 +01:00
Craig Topper 4a69551d66 [RISCV] Add more isel optimizations for (and (shr x, c2), c1).
Turn (and (shr x, c2), c1) -> (slli (srli x, c2+c3), c3) if c1 is a
shifted mask with c2 leading zeros and c3 trailing zeros.

When the leading zeros is C2+32 we can use SRLIW in place of SRLI.
2021-09-23 11:29:04 -07:00
Craig Topper 19734ae6f0 [RISCV] Add more tests for (and (srl x, C2), C1) that can be improved by using a pair of shifts. NFC
These tests have C1 as a shifted mask having C2 leading zeros and some
number of trailing zeros, C3. We can select this as
(slli (srli x, C2+C3), C3) or (slli (srliw x, C2+C3), C3).
2021-09-23 11:29:04 -07:00
Sanjay Patel 5188e2c9ce [x86] add AVX512 run for fcmp+logic ops; NFC
Suggested in D110342
2021-09-23 14:28:22 -04:00
Sanjay Patel 74ba4b769a [x86] move combiner state check into convertIntLogicToFPLogic(); NFC
This function can be adapted to solve bugs like PR51245,
but it could require differentiating the combiner timing
between the existing and new transforms.
2021-09-23 14:28:22 -04:00
Yuanfang Chen 59337263ab Revert "Diagnose -Wunused-value based on CFG reachability"
This reverts commit cbbf2e8c8a.
It seems causing diagnoses in SFINAE context.
2021-09-23 11:12:00 -07:00
Michał Górny cc3c788ad2 [lldb] [gdb-remote] Use local regnos for value_regs/invalidate_regs
Switch the gdb-remote client logic to use local (LLDB) register numbers
in value_regs/invalidate_regs rather than remote regnos. This involves
translating regnos received from lldb-server.

Differential Revision: https://reviews.llvm.org/D110027
2021-09-23 20:02:01 +02:00
Michał Górny fa456505b8 [lldb] [gdb-remote] Refactor getting remote regs to use local vector
Refactor remote register getters to collect them into a local
std::vector rather than adding them straight into DynamicRegisterInfo.
The purpose of this change is to lay groundwork for switching value_regs
and invalidate_regs to use local LLDB register numbers rather than
remote numbers.

Differential Revision: https://reviews.llvm.org/D110025
2021-09-23 20:02:00 +02:00
Thomas Lively 2f519825ba [WebAssembly] Add prototype relaxed SIMD fma/fms instructions
Add experimental clang builtins, LLVM intrinsics, and backend definitions for
the new {f32x4,f64x2}.{fma,fms} instructions in the relaxed SIMD proposal:
https://github.com/WebAssembly/relaxed-simd/blob/main/proposals/relaxed-simd/Overview.md.
Do not allow these instructions to be selected without explicit user opt-in.

Differential Revision: https://reviews.llvm.org/D110295
2021-09-23 11:01:36 -07:00
Raphael Isemann c22329972f [lldb] Add a C language REPL to test LLDB's REPL infrastructure
LLDB has a bunch of code that implements REPL support, but all that code is
unreachable as no language in master currently has an implemented REPL backend.
The only REPL that exists is in the downstream Swift fork. All patches for this
generic REPL code therefore also only have tests downstream which is clearly not
a good situation.

This patch implements a basic C language REPL on top of LLDB's REPL framework.
Beside implementing the REPL interface and hooking it up into the plugin
manager, the only other small part of this patch is making the `--language` flag
of the expression command compatible with the `--repl` flag. The `--repl` flag
uses the value of `--language` to see which REPL should be started, but right
now the `--language` flag is only available in OptionGroups 1 and 2, but not in
OptionGroup 3 where the `--repl` flag is declared.

The REPL currently can currently only start if a running target exists. I'll add
the 'create and run a dummy executable' logic from Swift (which is requires when
doing `lldb --repl`) when I have time to translate all this logic to something
that will work with Clang.

I should point out that the REPL currently uses the C expression parser's
approach to persistent variables where only result variables and the ones
starting with a '$' are transferred between expressions. I'll fix that in a
follow up patch. Also the REPL currently doesn't work in a non-interactive
terminal. This seems to be fixed in the Swift fork, so I assume one of our many
REPL downstream changes addresses the issue.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D87281
2021-09-23 19:31:02 +02:00
Leonard Chan 6bc9c8dfe3 [compiler-rt][profile] Add padding after binary IDs
Some tests with binary IDs would fail with error: no profile can be merged.
This is because raw profiles could have unaligned headers when emitting binary
IDs. This means padding should be emitted after binary IDs are emitted to
ensure everything else is aligned. This patch accounts for that padding in
__llvm_write_binary_ids.

Differential Revision: https://reviews.llvm.org/D110188
2021-09-23 10:29:24 -07:00
peter klausler 4393e3776b [flang] Implement READ(SIZE=) and INQUIRE(IOLENGTH=) in runtime
Count input characters corresponding to formatted edit descriptors
for READ(SIZE=); count output bytes for INQUIRE(IOLENGTH=).

The I/O APIs GetSize() and GetLength() were adjusted to return
std::size_t as function results.

Basic unit tests were added (and others fixed).

Differential Revision: https://reviews.llvm.org/D110291
2021-09-23 10:27:56 -07:00
Louis Dionne e6126faba0 [libc++] Remove unused macro in __config
That macro was being defined but not used anywhere in libc++, so it
must be safe to remove it.

As a fly-by fix, also remove mentions of this macro in other places
in LLVM, to make sure they were not depending on the value defined in
libc++.

Differential Revision: https://reviews.llvm.org/D110289
2021-09-23 13:09:32 -04:00
David Green e2050f94b6 [ARM] Extra tests for unpredicated qr MVE intrinsics. 2021-09-23 18:07:08 +01:00
Valentin Clement 2155aa79d7
[fir][NFC] Remove fir.cmpf replaced by mlir.cmpf
fir.cmpf op is not necessary anymore as it is replaced by mlir.cmpf.
This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: schweitzpgi
Co-authored-by: jeanPerier
2021-09-23 19:05:57 +02:00
Jay Foad deb2ca566a Revert "[LiveIntervals] Fix repairOldRegInRange for simple def cases"
This reverts commit 8229cb7412.

It was failing on buildbots with expensive checks enabled.
2021-09-23 17:55:05 +01:00
Valentin Clement bbc74a11bc
[fir][NFC] rename canBePointerOrHeapElementType to cannotBePointerOrHeapElementType
This patch is part of the upstreaming effort from fir-dev branch.
Rename the function so the name conveys better what it does.

Reviewed By: jeanPerier

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

Co-authored-by: schweitz
Co-authored-by: jeanPerier
2021-09-23 18:49:41 +02:00
Nikita Popov 1e3c6fc7cb [JumpThreading] Ignore free instructions
This is basically D108837 but for jump threading. Free instructions
should be ignored for the threading decision. JumpThreading already
skips some free instructions (like pointer bitcasts), but does not
skip various free intrinsics -- in fact, it currently gives them a
fairly large cost of 2.

Differential Revision: https://reviews.llvm.org/D110290
2021-09-23 18:28:36 +02:00
Fangrui Song 1a6e1ee42a Resolve {GlobalValue,GloalIndirectSymol}::getBaseObject confusion
While both GlobalAlias and GlobalIFunc are GlobalIndirectSymbol, their
`getIndirectSymbol()` usage is quite different (GlobalIFunc's resolver
is an entity different from GlobalIFunc itself).

As discussed on https://lists.llvm.org/pipermail/llvm-dev/2020-September/144904.html
("[IR] Modelling of GlobalIFunc"), the name `getBaseObject` is confusing when
used with GlobalIFunc.

To resolve the confusion:

* Move GloalIndirectSymol::getBaseObject to GlobalAlias:: (GlobalIFunc should use `getResolver` instead)
* Change GlobalValue::getBaseObject not to inspect GlobalIFunc. Note: the function has 7 references.
* Add GlobalIFunc::getResolverFunction to peel off potential ConstantExpr indirection
  (`strlen` in `test/LTO/Resolution/X86/ifunc.ll`)

Note: GlobalIFunc::getResolver (like GlobalAlias::getAliasee which does not peel
off ConstantExpr indirection) is kept to be used by ValueEnumerator.

Reviewed By: ibookstein

Differential Revision: https://reviews.llvm.org/D109792
2021-09-23 09:23:35 -07:00
Michał Górny bcb6b97cde Revert "[lldb] [gdb-remote] Refactor getting remote regs to use local vector"
This reverts commit b03e701c14.  This is
causing regressions when XML support is disabled.
2021-09-23 18:17:09 +02:00
Michał Górny 12504f5072 Revert "[lldb] [gdb-remote] Use local regnos for value_regs/invalidate_regs"
This reverts commit 6fbed33d4a.
The prerequisite commit is causing regressions.
2021-09-23 18:17:09 +02:00
Jay Foad 8229cb7412 [LiveIntervals] Fix repairOldRegInRange for simple def cases
The fix applied in D23303 "LiveIntervalAnalysis: fix a crash in repairOldRegInRange"
was over-zealous. It would bail out when the end of the range to be
repaired was in the middle of the first segment of the live range of
Reg, which was always the case when the range contained a single def of
Reg.

This patch fixes it as suggested by Matthias Braun in post-commit review
on the original patch, and tests it by adding -early-live-intervals to
a selection of existing lit tests that now pass.

(Note that D23303 was originally applied to fix a crash in
SILoadStoreOptimizer, but that is now moot since D23814 updated
SILoadStoreOptimizer to run before scheduling so it no longer has to
update live intervals.)

Differential Revision: https://reviews.llvm.org/D110238
2021-09-23 17:16:14 +01:00
Louis Dionne fd04fd9ac9 [libc++] Use CMake interface targets to setup benchmark flags
This is a re-application of da0592e4c8 which was reverted in
1454018dc1 because it was incompatible with older CMakes.
Instead, disable the benchmarks when CMake is too old to
support those idioms.

Differential Revision: https://reviews.llvm.org/D110285
2021-09-23 12:14:01 -04:00
Quinn Pham f9912fe4ea [PowerPC] Add range checks for P10 Vector Builtins
This patch adds range checking for some Power10 altivec builtins and
changes the signature of a builtin to match documentation. For `vec_cntm`,
range checking is done via SemaChecking. For `vec_splati_ins`, the second
argument is masked to extract the 0th bit so that we always receive either a `0`
or a `1`.

Reviewed By: lei, amyk

Differential Revision: https://reviews.llvm.org/D109710
2021-09-23 11:05:49 -05:00
Kazu Hirata a95061691e [SampleFDO] Remove redundant declarations (NFC)
Note that these are declared in SampleProfileLoaderBaseUtil.h, which
SampleProfileLoaderBaseImpl.h includes.
2021-09-23 08:58:08 -07:00
Craig Topper d5c67bba62 [RegAlloc] Cast uint8_t to unsigned before printing it.
raw_ostream interprets uint8_t as wanting to print a character
with that ASCII value. In this case the uint8_t is an integer
that we want to print.
2021-09-23 08:49:44 -07:00
Frederic Cambus 7f5ca8cc21 [clang] Use portable "#!/usr/bin/env bash" shebang for tools and utils.
Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D110041
2021-09-23 21:16:43 +05:30
Michał Górny 6fbed33d4a [lldb] [gdb-remote] Use local regnos for value_regs/invalidate_regs
Switch the gdb-remote client logic to use local (LLDB) register numbers
in value_regs/invalidate_regs rather than remote regnos. This involves
translating regnos received from lldb-server.

Differential Revision: https://reviews.llvm.org/D110027
2021-09-23 17:21:56 +02:00
Michał Górny b03e701c14 [lldb] [gdb-remote] Refactor getting remote regs to use local vector
Refactor remote register getters to collect them into a local
std::vector rather than adding them straight into DynamicRegisterInfo.
The purpose of this change is to lay groundwork for switching value_regs
and invalidate_regs to use local LLDB register numbers rather than
remote numbers.

Differential Revision: https://reviews.llvm.org/D110025
2021-09-23 17:21:55 +02:00
Sanjay Patel b240a2980b [x86] add AVX run to tests of fcmp logic; NFC
The ISA before AVX has predicate gaps for both fcmp
codegen alternatives, so that requires a more
complicated fix to get ideal asm in all cases.
2021-09-23 11:21:39 -04:00
Duncan P. N. Exon Smith 87689657e2 Support: Fix missing whitespace in comment for inconvertibleErrorCode(), NFC 2021-09-23 11:09:26 -04:00
Haojian Wu 8ecf3660f2 Fix buildbot error.
-frounding-math is not available for all targets.
2021-09-23 17:04:46 +02:00
Simon Pilgrim 5f2c53bdf4 Pass some DataLayout arguments by const-ref
Avoid unnecessary copies, reported by MSVC static analyzer.
2021-09-23 15:50:31 +01:00
Piotr Sobczak 2ac53fffae [AMDGPU] Avoid processing functions in amdgpu-propagate-attributes pass for shaders
The pass amdgpu-propagate-attributes ("Early/Late propagate attributes
from kernels to functions") is currently run also for shaders, where
it does nothing. Modify the check so the pass only processes functions
for kernels.

Differential Revision: https://reviews.llvm.org/D109961
2021-09-23 16:46:56 +02:00
Haojian Wu 3778c1cd6e [Sema] Fix a null pointer reference crash.
Differential Revision: https://reviews.llvm.org/D110315
2021-09-23 16:37:37 +02:00
Stefan Gränitz 828422747d [ORC][examples] Fix segfault in LLJITWithTargetProcessControl
Issue reported during review D110260
2021-09-23 16:33:00 +02:00