Commit Graph

433038 Commits

Author SHA1 Message Date
Aiden Grossman 24cdf97d63 [mlgo] Add ability to create feature-gated development features in regalloc advisor
Currently there is no way to add in development features to the ML
regalloc evict advisor which is useful to have when working on feature
engineering/improving the current model. This patch adds in the ability
to add in development features to the ML regalloc evict advisor which
are gated by a runtime flag and not added in at all if not compiled in
LLVM development mode. This sets the stage for future work where we are
planning on upstreaming some of the newer features that we are currently
experimenting with.

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D131209
2022-08-15 16:01:37 -07:00
LLVM GN Syncbot a74b028f58 [gn build] Port 2f1fa6242a 2022-08-15 22:49:18 +00:00
Nico Weber 330abe8d43 fix comment typo to cycle bots 2022-08-15 18:49:02 -04:00
Michael Jones 438d1f18a5 [libc] add guard for file pieces of printf
In the printf_core CMake, the file pieces are defined as object
libraries that depend on the File data structure. If these are added
unconditionally they'll try to evaluate that dependancy even when there
is no File available. This patch adds a guard to prevent that error.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D131921
2022-08-15 15:43:24 -07:00
Thomas Raoux 444b4fda17 [mlir][tosa] Fix clamp float lowering
min and max were mixed up after switching to using float min/max

Differential Revision: https://reviews.llvm.org/D131923
2022-08-15 22:25:14 +00:00
Nico Weber 73f0ca806e [gn build] Try to unbreak mac after f56e486fdc 2022-08-15 18:22:08 -04:00
Philip Reames 33e7a0a33b [RISCV][LV] Add test coverage for upcoming dependence distance handling change 2022-08-15 15:20:36 -07:00
Nico Weber f56e486fdc [gn build] Make ubsan_init_standalone_preinit.cpp syncable
...after https://reviews.llvm.org/D131916
2022-08-15 18:17:06 -04:00
Vitaly Buka e0e960923f [AArch64] Fix signed integer overflow in CSINC case
Followup to D131815, which overlflows on different
values.
2022-08-15 15:04:20 -07:00
Martin Sebor 65967708d2 [InstCombine] Adjust snprintf folding of constant strings (PR #56598)
Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D130494
2022-08-15 15:59:21 -06:00
Lei Zhang 6f4f9e316c [mlir][spirv] Add a test covering load/store with memory operands
Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D131904
2022-08-15 17:48:33 -04:00
John Regehr 2f1fa6242a this pass calls simplifyCFG on individual basic blocks; we want this
so that we can reduce away incidental parts of the CFG in cases where
the full simplifyCFG pass makes the test case uninteresting

Differential Revision: https://reviews.llvm.org/D131920
2022-08-15 15:45:20 -06:00
Arthur Eubanks 633f5663c3 [LegacyPM] Remove ThinLTO bitcode writer legacy pass
Using the legacy PM for the optimization pipeline is deprecated and in
the process of being removed. This is a small step in that direction.

For an example of migrating to the new PM:
853b57fe80
2022-08-15 14:21:16 -07:00
Arthur Eubanks 853b57fe80 [NFC][llvm-reduce] Use new pass manager for printing ThinLTO bitcode 2022-08-15 14:14:08 -07:00
Rafael Auler e99490512e [test-release] Add option to build BOLT
Add a flag to enable BOLT. Should be used in x86-64 and
AArch64 linux builds only, since BOLT doesn't really support other
targets and is mostly tested on these two systems as hosts.

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D131703
2022-08-15 14:03:30 -07:00
Kai Sasaki 5605f17a4d [mlir][complex] Mark all supported operation illegal explicitly for complex to libm
We can mark all supported operations illegal explicitly to ensure no convertible ops remain.

Differential Revision: https://reviews.llvm.org/D131877
2022-08-15 17:02:16 -04:00
Arthur Eubanks 6d17254df4 [gn build] Add ubsan libraries
clang -fsanitize=undefined works with this.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D131916
2022-08-15 13:55:36 -07:00
Philip Reames e792a353b5 [slp] adjust debug output to include final computed cost 2022-08-15 13:51:39 -07:00
Vitaly Buka ace3ce8ad7 [test][libc++][hwasan] Handle hwaddress_sanitizer 2022-08-15 13:50:54 -07:00
Nico Weber 8403cd5b00 chained-fixups.yaml: force little-endian output
`__LINK_EDIT` contents are little-endian, so the whole file must be.
Might fix the test on big-endian systems.
2022-08-15 16:47:47 -04:00
Michael Jones e0e7fa36d3 [libc] enable s(n)printf without fullbuild
To use the FILE data structure, LLVM-libc must be in fullbuild mode
since it expects its own implementation. This means that (f)printf can't
be used without fullbuild, but s(n)printf only uses strings. This patch
adjusts the CMake to allow for this.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D131913
2022-08-15 13:45:34 -07:00
Alexey Bataev aed5e3bea1 [SLP][NFC]Add a test for delaying of insertelements vectorization, NFC. 2022-08-15 13:26:51 -07:00
Sam Estep 2efc8f8d65 [clang][dataflow] Add an option for context-sensitive depth
This patch adds a `Depth` field (default value 2) to `ContextSensitiveOptions`, allowing context-sensitive analysis of functions that call other functions. This also requires replacing the `DeclCtx` field on `Environment` with a `CallString` field that contains a vector of decl contexts, to ensure that the analysis doesn't try to analyze recursive or mutually recursive calls (which would result in a crash, due to the way we handle `StorageLocation`s).

Reviewed By: xazax.hun

Differential Revision: https://reviews.llvm.org/D131809
2022-08-15 19:58:40 +00:00
Alan Zhao ff8aadf58d [clang][diagnostics] Don't warn about unreachable code in constexpr if
The point of a constexpr if statement is to determine which branch to
take at compile time, so warning on unreachable code is meaningless in
these situations.

Fixes #57123.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D131818
2022-08-15 15:24:39 -04:00
Jameson Nash 3a8d7fe201 [SimplifyCFG] teach simplifycfg not to introduce ptrtoint for NI pointers
SimplifyCFG expects to be able to cast both sides to an int, if either side can be case to an int, but this is not desirable or legal, in general, per D104547.

Spotted in https://github.com/JuliaLang/julia/issues/45702

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D128670
2022-08-15 15:11:48 -04:00
Matthias Springer 31fbdab376 [mlir][transforms] Add topological sort analysis
This change add a helper function for computing a topological sorting of a list of ops. E.g. this can be useful in transforms where a subset of ops should be cloned without dominance errors.

The analysis reuses the existing implementation in TopologicalSortUtils.cpp.

Differential Revision: https://reviews.llvm.org/D131669
2022-08-15 21:09:18 +02:00
Diego Caballero e86119b4ff [mlir] Minor fixes after removing types from attributes
D130092 removed types from attributes. This patch fixes a minor
issues what was exposed when integrating that change in IREE. An
explicit cast is needed so that the template type of `makeArrayRef`
is automatically deduced.

Co-authored-by: Lei Zhang <antiagainst@google.com>

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D131604
2022-08-15 19:07:25 +00:00
Stella Laurenzo f55a6fde1d [mlir] Make sure that aggregate shared libraries define all of their symbols.
We were hitting issues on Linux where this was only being caught at runtime, and different linkers (BFD vs LLD) are differently strict in such situations. Such libraries will also fail to build properly on Windows (but test coverage of that is limited, so it is better to enforce globally).

Differential Revision: https://reviews.llvm.org/D131911
2022-08-15 12:02:24 -07:00
Alexey Bataev 2819126d0c [SLP][NFC]Replace multiple isa calls with single one where possible,
NFC.
2022-08-15 11:56:58 -07:00
Slava Zakharin 2dde4ba639 [mlir][math] Added algebraic simplification for IPowI operation.
Differential Revision: https://reviews.llvm.org/D130390
2022-08-15 11:55:05 -07:00
Jeff Niu 133624acf9 [mlir][python] Fix build on windows
Reviewed By: stella.stamenova, ashay-github

Differential Revision: https://reviews.llvm.org/D131906
2022-08-15 14:51:04 -04:00
Kevin Athey c22841049e [MSAN] clean up style from D131728
Depends on D131728

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131903
2022-08-15 11:46:07 -07:00
Slava Zakharin cd3a234fa9 [mlir][math] Added constant folding for IPowI operation.
Differential Revision: https://reviews.llvm.org/D130389
2022-08-15 11:31:14 -07:00
Diego Caballero 43beaeed38 Revert "antiagainst's fix"
This reverts commit 42d48d0966.
2022-08-15 18:27:35 +00:00
Jonas Devlieghere 570e10cb9d
[lldb] Fix warning: comparison of integers of different signs
Fixes a warning about comparison of integers of different signs
'wchar_t' and 'int' in Editline.cpp:

      return out != (int)WEOF;
             ~~~ ^  ~~~~~~~~~
2022-08-15 11:25:46 -07:00
Diego Caballero 42d48d0966 antiagainst's fix 2022-08-15 17:57:38 +00:00
Arthur Eubanks 465d9084ec [test][clang] Opaquify pragma-init_seg.cpp 2022-08-15 10:45:24 -07:00
Aaron Ballman f37b285299 Removing an unused function; NFC
It turns out there are zero in-tree callers of CallExpr::getNumCommas()
so it's reasonable to remove.
2022-08-15 13:35:16 -04:00
Amy Kwan a5bef98c75 [PowerPC][NFC] Add additional vector_shuffle tests involving scalar_to_vector.
This patch adds additional test cases involving vector_shuffles where either its
left, right or both inputs are scalar_to_vector nodes. These test cases involve
v16i8, v2i64, v4i32 and v8i16 vector shuffles, and were generated in preparation
for D130487.

Differential Revision: https://reviews.llvm.org/D130485
2022-08-15 12:30:58 -05:00
Kazu Hirata 71d12bc2de [ExecutionEngine] Fix warnings
This patch fixes:

  llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp:512:12: error:
  moving a temporary object prevents copy elision
  [-Werror,-Wpessimizing-move]

and:

  llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp:515:12: error:
  moving a temporary object prevents copy elision
  [-Werror,-Wpessimizing-move]
2022-08-15 10:26:03 -07:00
Zhixun Tan e42bfec9b6 [mlir][dataflow] Remove the unused AnalysisState::defaultInitialize().
Depends On D131660

`defaultInitialize()` was introduced for the "nudging" behavior, which has been deleted.

Reviewed By: Mogball, rriddle

Differential Revision: https://reviews.llvm.org/D131746
2022-08-15 13:24:08 -04:00
Zhixun Tan 4835441d02 [mlir][dataflow] Remove Abstract{Sparse,Dense}Lattice::isAtFixpoint() and an ineffective optimization to simplify public API
Currently, in the MLIR `{Sparse,Dense}DataFlowAnalysis` API, there is a small optimization:

Before running a transfer function, if the "out state" is already at the pessimistic fixpoint (bottom lattice value), then we know that it cannot possibly be changed, therefore we can skip the transfer function.

I benchmarked and found that this optimization is ineffective, so we can remove it and simplify `{Sparse,Dense}DataFlowAnalysis`. In a subsequent patch, I plan to change/remove the concept of the pessimistic fixpoint so that the API is further simplified.

Benchmark: I ran the following tests 5 times (after 3 warmup runs), and timed the `initializeAndRun()` function.

| Test | Before (us) | After (us) |
| mlir-opt -test-dead-code-analysis mlir/test/Analysis/DataFlow/test-dead-code-analysis.mlir | 181.2536 | 187.7074 |
| mlir-opt -- -test-dead-code-analysis mlir/test/Analysis/DataFlow/test-last-modified-callgraph.mlir | 109.5504 | 105.0654 |
| mlir-opt -- -test-dead-code-analysis mlir/test/Analysis/DataFlow/test-last-modified.mlir | 333.3646 | 322.4224 |
| mlir-opt -- -allow-unregistered-dialect -sccp mlir/test/Analysis/DataFlow/test-combined-sccp.mlir | 1027.1492 | 1081.818 |

Note: `test-combined-sccp.mlir` is crafted by combining `mlir/test/Transforms/sccp.mlir`, `mlir/test/Transforms/sccp-structured.mlir` and `mlir/test/Transforms/sccp-callgraph.mlir`.

Reviewed By: aartbik, Mogball

Differential Revision: https://reviews.llvm.org/D131660
2022-08-15 13:21:05 -04:00
Jakub Kuderski 53d4ff4a47 [mlir] Simplify is_splat use in MatchAllPred. NFC.
This is a simple cleanup after https://reviews.llvm.org/D131289.

Reviewed By: antiagainst, Mogball

Differential Revision: https://reviews.llvm.org/D131895
2022-08-15 13:18:11 -04:00
Slava Gurevich fa5124327a [LLDB][NFC] Reliability Fixes for FormatEntity
- Remove dead code
 - Fix incorrect null-reference check

Differential Revision: https://reviews.llvm.org/D131850
2022-08-15 10:16:47 -07:00
Kevin Sala Penads 1081bb08cc [OpenMP][libomptarget] Fix run region async condition
This patch fixes a condition in the openmp/libomptarget/src/device.cpp file. The code was checking if the run_region plugin API function was implemented, but it should actually check the run_region_async function instead.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D131782
2022-08-15 13:08:45 -04:00
Sunho Kim 0c69f9f32c [ORC][COFF] Introduce DLLImportDefinitionGenerator.
This class will be used to properly solve the `__imp_` symbol and jump-thunk generation issues. It is assumed to be the last definition generator to be called, and as it's the last generator the only symbols remaining in the lookup set are the symbols that are supposed to be queried outside this jitdylib. Instead of just letting them through, we issue another lookup invocation and fetch the allocated addresses, and then create jitlink graph containing `__imp_` GOT symbols and jump-thunks targetting the fetched addresses.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D131833
2022-08-16 02:06:57 +09:00
Sanjay Patel e5748c6e73 [InstCombine] reduce sub-with-overflow ==/!= 0
The basic patterns look like this:
https://alive2.llvm.org/ce/z/MDj9EC

The tests have a use of the overflow value too.
Otherwise, existing folds should reduce already.

This was noted as a missing IR fold in:
926e7312b2

Hopefully, this makes it easier to implement a backend
fix because we should get the same IR regardless of
whether the source used builtins or inline code.
2022-08-15 13:03:51 -04:00
Sanjay Patel b4f61c5ecd [InstCombine] add tests for compare of sub-with-overflow; NFC 2022-08-15 13:03:51 -04:00
Simon Pilgrim e471fdad7c [InstCombine] known-phi-br.ll - add multiuse of compare results to avoid predicate inverse and add negative tests
Feedback from D131838
2022-08-15 17:57:34 +01:00
Jonas Devlieghere 350755d94d
[llvm] Include utils/unittest before projects and runtimes
Include utils/unittest before projects and runtimes so that downstream
projects can check for the existence of the llvm_gtest target. This is
motivated by 9c6c4d675b which fixes the stand-alone build
configuration where LLVM_MAIN_SRC_DIR does not exist.

Differential revision: https://reviews.llvm.org/D124314
2022-08-15 09:54:35 -07:00