Commit Graph

11277 Commits

Author SHA1 Message Date
LLVM GN Syncbot 51f63589ae [gn build] Port 569d663020 2022-05-26 08:51:13 +00:00
Arthur Eubanks 3d546191ad [gn build] Fix D126415 to only set `llvm_have_mallinfo2 = true` on linux
Otherwise mac builds are broken, e.g. http://45.33.8.238/macm1/36056/step_4.txt

../../llvm/lib/Support/Unix/Process.inc:35:10: fatal error: 'malloc.h' file not found
 #include <malloc.h>
2022-05-25 14:48:56 -07:00
Arthur Eubanks 534b19fbaa [gn build] Manually port bed9efed71 2022-05-25 14:36:42 -07:00
Arthur Eubanks 67e2e6e66d [gn build] Set llvm_have_mallinfo2 to true by default
If you are using an old enough glibc which doesn't have mallinfo2, set
`llvm_have_mallinfo2 = false`.

At this point it's likely that most people using the gn build are
compiling against a recent enough glibc (glibc 2.33 which was released
in Feb 2021).

Reviewed By: peterwaller-arm

Differential Revision: https://reviews.llvm.org/D126415
2022-05-25 13:56:05 -07:00
Nico Weber c85688a22b [gn build] (manually) port some of cd2292ef82 2022-05-25 07:19:41 -04:00
LLVM GN Syncbot 9ffb5944a6 [gn build] Port 7af89a379c 2022-05-25 08:31:45 +00:00
LLVM GN Syncbot b81171ce19 [gn build] Port 29a5a7c6d4 2022-05-25 08:31:44 +00:00
Nico Weber 1b976f2cb2 [gn build] Reformat all build files
Ran:

    git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format
2022-05-24 12:16:55 -04:00
Nico Weber 154f93ca90 [gn build] (semi-automatically) port 0360b9f159 2022-05-24 11:41:28 -04:00
Sylvestre Ledru 1e2b746390 Revert "[TableGen] Remove code beads"
It is breaking the build with:

/build/llvm-toolchain-snapshot-15~++20220524114008+96323c9f4c10/llvm/lib/Target/M68k/MCTargetDesc/M68kMCCodeEmitter.cpp:478:10: fatal error: 'M68kGenMCCodeBeads.inc' file not found
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Remove the #include causes:
error: undefined reference to 'llvm::M68k::getMCInstrBeads(unsigned int)'

This reverts commit f50be3d218.
2022-05-24 14:17:49 +02:00
Sheng f50be3d218 [TableGen] Remove code beads
Code beads is useless since the only user, M68k, has moved on to
a new encoding/decoding infrastructure.
2022-05-24 17:39:51 +08:00
LLVM GN Syncbot 3245e2edd5 [gn build] Port 1d1a191edc 2022-05-24 08:37:12 +00:00
LLVM GN Syncbot 1868f3c17d [gn build] Port 496156ac57 2022-05-24 05:44:48 +00:00
Tom Stellard 21c060c497 github: Switch release PR repository to llvm/llvm-project-release-prs
As discussed in https://discourse.llvm.org/t/creating-a-new-repository-for-release-branch-pull-requests/61339

Reviewed By: asl

Differential Revision: https://reviews.llvm.org/D125851
2022-05-23 15:10:27 -07:00
NAKAMURA Takumi c8e0870829 [TableGen] emitStringLiteralDef: Pad trailing '\0' at the end of char array.
Fixup for https://reviews.llvm.org/D73044
String literal has an implicit terminator '\0'. This commit adjusts char array
to long literal.

This causes difference of artifacts between -long-string-literals=true
and false.

Differential Revision: https://reviews.llvm.org/D126136
2022-05-24 06:25:10 +09:00
NAKAMURA Takumi 40b9a2616e emitStringLiteralDef: Return earlier here. NFC.
Differential Revision: https://reviews.llvm.org/D126135
2022-05-24 06:02:16 +09:00
LLVM GN Syncbot 7ffc99bedc [gn build] Port eebc1fb772 2022-05-23 18:52:16 +00:00
Andre Vieira 572fc7d2fd [AArch64] Order STP Q's by ascending address
This patch adds an AArch64 specific PostRA MachineScheduler to try to schedule
STP Q's to the same base-address in ascending order of offsets. We have found
this to improve performance on Neoverse N1 and should not hurt other AArch64
cores.

Differential Revision: https://reviews.llvm.org/D125377
2022-05-23 09:50:44 +01:00
Nico Weber 98d141481e [gn build] (manually) port 480dcdc897 (llvm-ifs OptTable) 2022-05-20 13:13:37 -04:00
Vitaly Buka d33c36235d [lit] Fix setup of sanitizer environment
Not all options were propageted into tests.

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D122869
2022-05-19 19:24:16 -07:00
Bill Wendling 6e00a34cdb [AArch64] Add support for -fzero-call-used-regs
Support the "-fzero-call-used-regs" option on AArch64. This involves much less
specialized code than the X86 version. Most of the checks can be done with
TableGen.

Reviewed By: nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D124836
2022-05-19 16:58:28 -07:00
Bill Wendling 88043c1958 [TableGen] Add generation of argument register lists
There are cases, like with -fzero-call-used-regs,  where we need to know
which registers can be used by a certain calling convention. This change
generates a list of registers used by each calling convention defined in
*CallingConv.td.

Calling conventions that use registers conditioned on Swift have those
registers placed in a separate list. This allows us to be flexible about
whether to use the Swift registers or not.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D125421
2022-05-19 15:18:25 -07:00
Bill Wendling db0ea51c83 Revert "[TableGen] Add generation of argument register lists"
There are build bot failures.

This reverts commit 3fa1b6557d.
2022-05-19 15:16:08 -07:00
Bill Wendling 3fa1b6557d [TableGen] Add generation of argument register lists
There are cases, like with -fzero-call-used-regs,  where we need to know
which registers can be used by a certain calling convention. This change
generates a list of registers used by each calling convention defined in
*CallingConv.td.

Calling conventions that use registers conditioned on Swift have those
registers placed in a separate list. This allows us to be flexible about
whether to use the Swift registers or not.

Reviewed By: nickdesaulniers

Differential Revision: https://reviews.llvm.org/D125421
2022-05-19 15:03:14 -07:00
Nico Weber e0b98902a2 [gn build] (manually) port 505ddb6b74 (remove Unit/lit.site.cfg.py) 2022-05-19 15:18:56 -04:00
Heejin Ahn cde083e010 [WebAssembly] Fix register use-def in FixIrreducibleControlFlow
FixIrreducibleControlFlow pass adds dispatch blocks with a `br_table`
that has multiple predecessors and successors, because it serves as
something like a traffic hub for BBs. As a result of this, there can be
register uses that are not dominated by a def in every path from the
entry block. For example, suppose register %a is defined in BB1 and used
in BB2, and there is a single path from BB1 and BB2:
```
BB1 -> ... -> BB2
```
After FixIrreducibleControlFlow runs, there can be a dispatch block
between these two BBs:
```
BB1 -> ... -> Dispatch -> ... -> BB2
```
And this dispatch block has multiple predecessors, now
there is a path to BB2 that does not first visit BB1, and in that path
%a is not dominated by a def anymore.

To fix this problem, we have been adding `IMPLICIT_DEF`s to all
registers in PrepareForLiveInternals pass, and then remove unnecessary
ones in OptimizeLiveIntervals pass after computing `LiveIntervals`. But
FixIrreducibleControlFlow pass itself ends up violating register use-def
relationship, resulting in invalid code. This was OK so far because
MIR verifier apparently didn't check this in validation. But @arsenm
fixed this and it caught this bug in validation
(https://github.com/llvm/llvm-project/issues/55249).

This CL moves the `IMPLICIT_DEF` adding routine from
PrepareForLiveInternals to FixIrreducibleControlFlow. We only run it
when FixIrreducibleControlFlow changes the code. And then
PrepareForLiveInternals doesn't do anything other than setting
`TracksLiveness` property, which is a prerequisite for running
`LiveIntervals` analysis, which is required by the next pass
OptimizeLiveIntervals.

But in our backend we don't seem to do anything that invalidates this up
until OptimizeLiveIntervals, and I'm not sure why we are calling
`invalidateLiveness` in ReplacePhysRegs pass, because what that pass
does is to replace physical registers with virtual ones 1-to-1. I
deleted the `invalidateLiveness` call there and we don't need to set
that flag explicitly, which obviates all the need for
PrepareForLiveInternals.

(By the way, This 'Liveness' here is different from `LiveIntervals`
analysis. Setting this only means BBs' live-in info is correct, all uses
are dominated by defs, `kill` flag is conservatively correct, which
means if there is a `kill` flag set it should be the last use. See
2a0837aab1/llvm/include/llvm/CodeGen/MachineFunction.h (L125-L134)
for details.)

So this CL removes PrepareForLiveInternals pass altogether. Something
similar to this was attempted by D56091 long ago but that came short of
actually removing the pass, and I couldn't land it because
FixIrreducibleControlFlow violated use-def relationship, which this CL
fixes.

This doesn't change output in any meaningful way. All test changes
except `irreducible-cfg.mir` are register numbering.

Also this will likely to reduce compilation time, because we have been
adding `IMPLICIT_DEF` for all registers every time `-O2` is given, but
now we do that only when there is irreducible control flow, which is
rare.

Fixes https://github.com/llvm/llvm-project/issues/55249.

Reviewed By: dschuff, kripken

Differential Revision: https://reviews.llvm.org/D125515
2022-05-19 11:13:37 -07:00
LLVM GN Syncbot a49d3055c7 [gn build] Port ca7c307d18 2022-05-19 16:42:14 +00:00
Jay Foad 6bec3e9303 [APInt] Remove all uses of zextOrSelf, sextOrSelf and truncOrSelf
Most clients only used these methods because they wanted to be able to
extend or truncate to the same bit width (which is a no-op). Now that
the standard zext, sext and trunc allow this, there is no reason to use
the OrSelf versions.

The OrSelf versions additionally have the strange behaviour of allowing
extending to a *smaller* width, or truncating to a *larger* width, which
are also treated as no-ops. A small amount of client code relied on this
(ConstantRange::castOp and MicrosoftCXXNameMangler::mangleNumber) and
needed rewriting.

Differential Revision: https://reviews.llvm.org/D125557
2022-05-19 11:23:13 +01:00
Konrad Kleine c0f5beef2f [release] Add cmake as an extra tarball and not bundle it
Revert "Add cmake/ to release tarballs via concatenation"

This reverts commit 3a33664e88.

Revert "Add cmake to source release tarballs"

This reverts commit 32a0482a65.

Reviewed By: tstellar, aaronpuchert

Differential Revision: https://reviews.llvm.org/D125798
2022-05-19 11:12:54 +02:00
LLVM GN Syncbot 3948962b45 [gn build] Port 4df795bff7 2022-05-19 08:04:45 +00:00
LLVM GN Syncbot dfd3a385d6 [gn build] Port 03ea140b3a 2022-05-19 06:13:53 +00:00
LLVM GN Syncbot e60c8c301c [gn build] Port 4d8268fbf4 2022-05-18 18:23:14 +00:00
LLVM GN Syncbot d8de7244f2 [gn build] Port 15c809e8e7 2022-05-18 18:05:17 +00:00
Nico Weber 91a8caa831 [gn build] port 6694491aff
Needed to link llvm-debuginfod-find after eafa053041.
2022-05-18 13:16:50 -04:00
LLVM GN Syncbot 66dfa36e7d [gn build] Port 29e556fc2b 2022-05-18 15:49:22 +00:00
LLVM GN Syncbot ca302f07b4 [gn build] Port 77533ea443 2022-05-18 15:43:23 +00:00
LLVM GN Syncbot 0990d5b549 [gn build] Port ca875539f7 2022-05-18 13:39:15 +00:00
Sam McCall 1236b66a98 [lit] pass LLVM_SYMBOLIZER_PATH through to tests.
Currently several buildbots give unsymbolized traces on crash.
I suspect these are configuring the symbolizer in this way and regressed in
D122251 or thereabouts.

Trying this coupled with a reland of patch that failed on a couple of bots with
no useful stacktrace...
2022-05-18 15:30:37 +02:00
LLVM GN Syncbot 6947945080 [gn build] Port 1f49714d3e 2022-05-17 19:47:10 +00:00
LLVM GN Syncbot 6f803caa6d [gn build] Port 1188faa7ab 2022-05-17 19:47:09 +00:00
LLVM GN Syncbot 8d53f2fc0d [gn build] Port 6aabf60f2f 2022-05-17 19:38:35 +00:00
LLVM GN Syncbot d910508a65 [gn build] Port ccdb56ac10 2022-05-17 19:07:18 +00:00
David Green 4c6a070a2c [AArch64] Teach perfect shuffles tables about D-lane movs
Similar to D123386, this adds D-Movs to the AArch64 perfect shuffle
tables, slightly lowering the costs a little more. This is a rough
improvement in general, especially if you ignore mov v0.16b, v2.16b type
moves that are often artefacts of the calling convention.

The D register movs are encoded as (0x4 | LaneIdx), and to generate a D
register move we are required to bitcast into a higher type, but it is
otherwise very similar to the S-lane mov's already supported.

Differential Revision: https://reviews.llvm.org/D125477
2022-05-17 18:16:45 +01:00
LLVM GN Syncbot f032690a7c [gn build] Port 76ddbb1ca7 2022-05-17 15:17:39 +00:00
LLVM GN Syncbot c8cb644185 [gn build] Port ecaa4d9662 2022-05-17 14:51:11 +00:00
Konrad Kleine 329dc5587c [pgo] Fix doc typo: thingswith -> things with
The title says it all.

Reviewed By: thakis

Differential Revision: https://reviews.llvm.org/D125763
2022-05-17 12:58:23 +00:00
Alex Bradbury 601ed0b605 [WebAssembly][NFC] Convert StackBased instruction field to 'bit' from string
This is (IMHO) cleaner and (objectively) more strongly typed than using strings.

A follow-on patch will do the same for IsWasm64.

Differential Revision: https://reviews.llvm.org/D125713
2022-05-17 11:02:30 +01:00
Alex Bradbury 9203063531 [WebAssembly][TableGen][NFCI] Use getValueAsBit rather than converting TableGen 'bit' to string
The logic around IsCanonical previously used getAsString and compared to
"1". Just using getValueAsBit is simpler.
2022-05-16 18:49:48 +01:00
LLVM GN Syncbot c71f6376eb [gn build] Port 0a0d6489ef 2022-05-16 06:42:42 +00:00
Sheng c644488a8b Rename `MCFixedLenDisassembler.h` as `MCDecoderOps.h`
The name `MCFixedLenDisassembler.h` is out of date after D120958.

Rename it as `MCDecoderOps.h` to reflect the change.

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D124987
2022-05-15 08:44:58 +08:00