Commit Graph

455417 Commits

Author SHA1 Message Date
Ben Shi
4fa9dc9482 [AVR] Fix incorrect expansion of the pseudo 'ELPMBRdZ' instruction
The 'ELPM' instruction has three forms:

--------------------------
| form        | feature  |
| ----------- | -------- |
| ELPM        | hasELPM  |
| ELPM Rd, Z  | hasELPMX |
| ELPM Rd, Z+ | hasELPMX |
--------------------------

The second form is always used in the expansion of the pseudo
instruction 'ELPMBRdZ'. But for devices without ELPMX but only
with ELPM, only the first form can be emitted.

Reviewed By: jacquesguan

Differential Revision: https://reviews.llvm.org/D141221
2023-03-21 11:33:56 +08:00
Lang Hames
00c4343d21 [llvm-jitlink] Fix typo in description of llvm-jitlink's -alias option. 2023-03-20 20:12:22 -07:00
Jie Fu
064e2497e2 [llvm-readobj] Fix ambiguous call of printNumber in ELFDumper.cpp (NFC)
/Users/jiefu/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp:7175:5: error: call to member function 'printNumber' is ambiguous
  W.printNumber("TotalBuckets", NBucket);
  ~~^~~~~~~~~~~
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:201:16: note: candidate function
  virtual void printNumber(StringRef Label, uint64_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:205:16: note: candidate function
  virtual void printNumber(StringRef Label, uint32_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:209:16: note: candidate function
  virtual void printNumber(StringRef Label, uint16_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:213:16: note: candidate function
  virtual void printNumber(StringRef Label, uint8_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:217:16: note: candidate function
  virtual void printNumber(StringRef Label, int64_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:221:16: note: candidate function
  virtual void printNumber(StringRef Label, int32_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:225:16: note: candidate function
  virtual void printNumber(StringRef Label, int16_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:229:16: note: candidate function
  virtual void printNumber(StringRef Label, int8_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:237:16: note: candidate function
  virtual void printNumber(StringRef Label, float Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:241:16: note: candidate function
  virtual void printNumber(StringRef Label, double Value) {
               ^
2023-03-21 10:36:46 +08:00
Chuanqi Xu
8894fe7a6f [docs] Update the status for coroutines
According to the discussion in
https://discourse.llvm.org/t/rfc-could-we-mark-coroutines-as-unreleased-now/69220

We should mark coroutines as "it’s supported fully everywhere but on
Windows targets".

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D146187
2023-03-21 10:34:33 +08:00
Peter Collingbourne
64d96ec817 Fix Windows export list.
Should fix Windows buildbot:
https://lab.llvm.org/buildbot/#/builders/127/builds/45411
2023-03-20 19:20:43 -07:00
Michael Francis
4c483a046d [AIX] Consolidate Crt0Basename logic
when certain flags are specified, the Crt0 object files are not linked.
However, the logic for determining which files will always run. This
patch moves that logic so that the basename is only determined if it is
needed.

Differential Revision: https://reviews.llvm.org/D146443
2023-03-21 00:47:05 +00:00
Johannes Doerfert
c0f3a3d7b5 [Attributor][FIX] Avoid H2S on GPUs if the pointer can be shared
If the stack is not accessible by other threads, e.g., on a GPU, we need
to ensure heap-2-stack will not create a stack version of a pointer that
might be passed to another thread. Since passing through memory is by
default transparent, we need to register a callback and inspect stores
we might look through explicitly.
2023-03-20 17:44:24 -07:00
Johannes Doerfert
8f47fd05d5 [OpenMPOpt][FIX] Avoid removing barriers in callees
We could be smarter about this, e.g., if the callee has a single call
site, but for now we first avoid the miscompile.
2023-03-20 17:44:24 -07:00
Johannes Doerfert
b89558a2ae [OpenMP][FIX] Properly track and lookup Execution Domains
This is a two part fix. First, we need two Execution Domains (ED) to
track the values of a function. One for incoming values and one for
outgoing values. This was conflated before. Second, at the function
entry we need to look at the incoming information from call sites not
iterate over non-existing predecessors.
2023-03-20 17:44:24 -07:00
Johannes Doerfert
0fc63d4e64 [Attributor][FIX] Ensure loop PHI replacements are dynamically unique
Similar to loads, PHIs can be used to introduce non-dynamically unique
values into the simplification "algorithm". We need to check that PHIs
do not carry such a value from one iteration into the next as can cause
downstream reasoning to fail, e.g., downstream could think a comparison
is equal because the simplified values are equal while they are defined
in different loop iterations. Similarly, instructions in cycles are now
conservatively treated as non-dynamically unique. We could do better but
I'll leave that for the future.

The change in AAUnderlyingObjects allows us to ignore dynamically unique
when we simply look for underlying objects. The user of that AA should
be aware that the result might not be a dynamically unique value.
2023-03-20 17:44:24 -07:00
Johannes Doerfert
d14ea2f6b4 [Attributor][NFC] Precommit test exposing a bug 2023-03-20 17:44:23 -07:00
Johannes Doerfert
19529458c4 [Attributor][NFC] Reduce output verbosity 2023-03-20 17:44:23 -07:00
Michael Jones
9e2b164570 [libc] temporarily disable wctob entrypoint
Differential Revision: https://reviews.llvm.org/D146484
2023-03-20 17:42:00 -07:00
Michael Jones
3d9e646c7c [libc][obvious] fix missing stdio dependency
Differential Revision: https://reviews.llvm.org/D146482
2023-03-20 17:37:09 -07:00
Paul Kirth
0d3f7d2ab3 [llvm-readobj] Provide Hash Histogram for all ELFDumper implementations
Previously, the GNUELFDumper was the only implementer for Hash Histograms.
This patch moves the implementation for printHashHistogram and
printGnuHashHistogram into the ELFDumper base class, and allows each
derived class to specialize how it outputs that information.

This change also prevents the JSONELFDumper from emitting invalid JSON,
since the shared implementation in LLVMELFDumper no longer emits a
warning message to the output stream.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D137096
2023-03-21 00:28:03 +00:00
Paul Kirth
89359df8ca [support] Support printing floats in ScopedPrinter
llvm-readobj will need the ability to print floats for use in
HashHistograms. This adds that functionality to the ScopedPrinter and
JSONScopedPrinter.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D145277
2023-03-21 00:26:31 +00:00
Michael Jones
23ea2c4f4a [libc][obvious] remove currently unused types
Somehow having MBState and StructTmType in the definition for wchar was
causing test failures. This should fix those.

Differential Revision: https://reviews.llvm.org/D146476
2023-03-20 17:22:52 -07:00
LLVM GN Syncbot
1a79b25d36 [gn build] Port e4c1dfed38 2023-03-21 00:14:05 +00:00
Luo, Yuanke
e4c1dfed38 [X86] Create extra prolog/epilog for stack realignment
The base pointer register is reserved by compiler when there is
dynamic size alloca and stack realign in a function. However the
base pointer register is not defined in X86 ABI, so user can use
this register in inline assembly. The inline assembly would
clobber base pointer register without being awared by user. This
patch is to create extra prolog to save the stack pointer to a
scratch register and use this register to reference argument from
stack. For some calling convention (e.g. regcall), there may be
few scratch register.
Below is the example code for such case.

```
extern int bar(void *p);
long long foo(size_t size, char c, int id) {
  __attribute__((__aligned__(64))) int a;
  char *p = (char *)alloca(size);
  asm volatile ("nop"::"S"(405):);
  asm volatile ("movl %0, %1"::"r"(id), "m"(a):);
  p[2] = 8;
  memset(p, c, size);
  return bar(p);
}
```
And below prolog/epilog will be emit for this case.
```
leal    4(%esp), %ebx
.cfi_def_cfa %ebx, 0
andl    $-128, %esp
pushl   -4(%ebx)
...
leal    4(%ebx), %esp
.cfi_def_cfa %esp, 4
```

Differential Revision: https://reviews.llvm.org/D145650
2023-03-21 08:09:56 +08:00
ziqingluo-90
6a0f2e539b [-Wunsafe-buffer-usage] Add Fixable for dereference of simple ptr arithmetic
For each expression `e` of the form `*(DRE + n)` (or `*(n + DRE)`), where
`DRE` has a pointer type and `n` is an integer literal, `e` will be
transformed to `DRE[n]` (or `n[DRE]` respectively), if
- `e` is at the left-hand side of an assignment or is an lvalue being casted to an rvalue; and
- the variable referred by `DRE` is going to be transformed to be of `std::span` type.

Reviewed by: jkorous, NoQ

Differential revision: https://reviews.llvm.org/D142795
2023-03-20 17:07:03 -07:00
LLVM GN Syncbot
b6f7e598ac [gn build] Port ee232506b8 2023-03-20 23:57:12 +00:00
wren romano
72455b314f [mlir][sparse] Fixing -Wunused-variable in Sparsification.cpp
Reviewed By: aartbik, Peiming

Differential Revision: https://reviews.llvm.org/D146474
2023-03-20 16:53:19 -07:00
Jim Ingham
c1e4a0d4db Follow on to 2c7abc83f6.
I didn't refactor the test that's failing on arm64 correctly so it
failed everywhere.

Looks like the step test passes on other aarch64 systems as well as
Darwin.  Turn off the xfail and see how far that gets.
2023-03-20 16:49:05 -07:00
Michael Jones
07cdf4a10d [libc][obvious] fix missing type headers
forgot to add wint_t and wchar_t type headers to the wchar
headergen definition.

Differential Revision: https://reviews.llvm.org/D146472
2023-03-20 16:43:09 -07:00
Peter Collingbourne
1bd8e87e1b Disable __sancov_lowest_stack on Windows.
Should fix Windows buildbot:
https://lab.llvm.org/buildbot/#/builders/127/builds/45401
2023-03-20 16:40:06 -07:00
Andrew Litteken
75c8abc0e0 Revert "[IRSim] Check largest sections first when analyzing similarity"
This reverts commit 805ec19d7d.

Did not update llvm-sim tests
2023-03-20 18:39:34 -05:00
Michael Jones
46b5087227 [libc] add basic wide char functions
This patch adds the wchar header, as well as the functions to convert to
and from wide chars. The header also sets up the definitions for wint
and wchar.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D145995
2023-03-20 16:36:21 -07:00
Dave MacLachlan
c600b99e5e Expose __tsan_on_thread_idle as part of tsan shared interface
`__tsan_on_thread_idle` is part of the tsan interface that was not being
exported in shared libraries. Fixes it so that we can link to dynamic
versions of tsan and still call `__tsan_on_thread_idle`.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D146166
2023-03-20 16:33:51 -07:00
Andrew Litteken
805ec19d7d [IRSim] Check largest sections first when analyzing similarity
When we check for similarity, right now there is no order to how it is checked, except for via the suffix tree ordering.

We can reduce how much structural analysis we perform by checking the the regions in decreasing size. In doing so, we know that if two large sections match, each of their contained regions also match. This allows us to skip the structural checking for each smaller section. IT does require that we use the large regions as a "bridge" to create the canonical mapping between the two regions.

This reduces compile time significantly for some benchmarks. It will not perform as well for programs with many small items.

Reviewer: paquette
Differential Revision: https://reviews.llvm.org/D139338
2023-03-20 18:27:44 -05:00
Peter Collingbourne
402dd79a29 sanitizer_common: Use plain thread_local for __sancov_lowest_stack definition.
We can't use initial-exec for the definition of __sancov_lowest_stack
because it gets linked into shared libraries such as the UBSan and
HWASan runtimes on Android. I think we can expect plain thread_local
to work unconditionally in sanitizer_common as several other sanitizers
are already using it, so drop the platform-dependent macro and just use
thread_local in the definition.

Differential Revision: https://reviews.llvm.org/D146351
2023-03-20 16:26:02 -07:00
Vitaly Buka
3b9732132d [NFC][tsan] Clang-format includes 2023-03-20 16:20:33 -07:00
wren romano
1f58ae8066 [mlir][sparse] Making TensorExp::Kind a nested enum-class
This improves namespacing, and follows the pattern used for "Kind" enums elsewhere in MLIR.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D146086
2023-03-20 16:12:31 -07:00
Jim Ingham
2c7abc83f6 Reapply 8d024a79ea w/o the extra bits. 2023-03-20 16:11:00 -07:00
Jim Ingham
9b655c2627 Revert "Fix a problem with "watchpoint triggers before" watchpoint handling."
This reverts commit 8d024a79ea.

I accidentally included some "in progress" work that wasn't supposed to
go with this commit.
2023-03-20 16:05:57 -07:00
Vitaly Buka
e520800eda [NFC] Include tsan_interface.h in tests 2023-03-20 16:01:20 -07:00
Vitaly Buka
33789125ca [NFC][tsan] Add include guards 2023-03-20 15:59:49 -07:00
Alex Langford
ee232506b8 [lldb] Move UnixSignals creation into Platform plugins
The high level goal of this change is to remove lldbTarget's dependency
on lldbPluginProcessUtility. The reason for this existing dependency is
so that we can create the appropriate UnixSignals object based on an
ArchSpec. Instead of using the ArchSpec, we can instead take advantage
of the Platform associated with the current Target.

This is accomplished by adding a new method to Platform,
CreateUnixSignals, which will create the correct UnixSignals object for
us. We then can use `Platform::GetUnixSignals` and rely on that to give
us the correct signals as needed.

Differential Revision: https://reviews.llvm.org/D146263
2023-03-20 15:41:06 -07:00
yijia1212
ff48a2925f modify dir of dep in OpenMPCommon
Fix dir error of deps in OpenMPCommon bazel build

Differential Revision: https://reviews.llvm.org/D146461
2023-03-20 23:33:55 +01:00
Lang Hames
f05ac803ff Re-apply "[JITLink][ELF] Don't skip debug info sections by default."
This reapplies 57aeb30546, which was reverted in
f721fcb6ed due to buildbot failures.

The cause of the failure was missing support for R_AARCH64_ABS32, which was
added in fb1b9945be.
2023-03-20 22:24:04 +00:00
Peiming Liu
1328bb6ef1 [mlir][sparse] extend loop emitter and optimize lattices with the awareness of slice based iteration
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D142929
2023-03-20 22:19:57 +00:00
Jim Ingham
8d024a79ea Fix a problem with "watchpoint triggers before" watchpoint handling.
We need to step the watchpoint instruction in these cases, but the
when we queued the ThreadPlanStepOverWatchpoint to do this, we didn't
make it a Controlling plan.  So if you are stepping, this plan returns as
though it were a utility plan, and the stepping plan keeps going.

This only partially fixes the problem on Darwin; there's another bug
with reporting a watchpoint when we're instruction single stepping over
an instruction that triggers a watchpoint.  The kernel reports the
"single step completed" but not the watchpoint hit.  So this commit
also refactors the test into a part that works (at least on Darwin) and
a part that still fails.

We may have to adjust the test result expectations for other systems after
this fix.

Differential Revision: https://reviews.llvm.org/D146337
2023-03-20 15:17:15 -07:00
Michal Paszkowski
b333f33939 [SPIR-V] Add Machine Value Type for SPIR-V builtins
Differential Revision: https://reviews.llvm.org/D145703
2023-03-20 23:15:34 +01:00
Ian Anderson
1187d8a62b [libunwind][Modules] Add unwind_arm_ehabi.h and unwind_itanium.h to the unwind module)
Add unwind_arm_ehabi.h and unwind_itanium.h to the unwind module and use angle includes to include them.

Reviewed By: ldionne, #libunwind

Differential Revision: https://reviews.llvm.org/D144323
2023-03-20 15:13:14 -07:00
Michael Jones
99047c0501 [libc][bazel] add targets for sprintf
The bazel build is currently overlay mode only, so the FILE functions
are still out of reach for it, but sprintf only uses strings. This adds
targets for sprintf, snprintf, and all the interal printf pieces, as
well as tests.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D146100
2023-03-20 15:09:20 -07:00
Michael Jones
f2c3a9cbd2 [libc][obvious] fix missing memory_check_utils
memmove and bcopy tests were missing a dependancy on memory_check_utils
in the bazel build, causing build failures.

Differential Revision: https://reviews.llvm.org/D146462
2023-03-20 15:06:58 -07:00
Dave MacLachlan
919a3f1c75 Add declaration for __tsan_default_options to tsan_interface.h
`__tsan_default_options` is part of the tsan interface so should be
exposed in tsan_interface.h.

Differential Revision: https://reviews.llvm.org/D146259
2023-03-20 15:02:57 -07:00
Nemanja Ivanovic
6ee4ea8e2f [PowerPC][NFC] Test needs to include constant pool values 2023-03-20 16:43:59 -05:00
Peiming Liu
d03805f2ee [mlir][sparse] add merger/topo sort support for slice-based affine sparse index codegen
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D142928
2023-03-20 21:24:10 +00:00
Mahesh Ravishankar
411b1d8f07 [mlir][Tensor] Make TilingInterface implementation only return handle to the created pad operation.
Pad tiling implementation only needs to return the tiled pad
operation. The rest of the generated code is related to handling
boundary conditions.

Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D146439
2023-03-20 21:23:18 +00:00
Mahesh Ravishankar
d0e507f569 [mlir][Tensor] Fix build error due to missing <> in D146440.
Differential Revision: https://reviews.llvm.org/D146458
2023-03-20 21:21:50 +00:00