Commit Graph

420640 Commits

Author SHA1 Message Date
Jean Perier 9cfa899b87 [flang] add a static assert in CheckUnitNumberInRangeImpl
Add a check that CheckUnitNumberInRangeImpl is not needlessly instantiated.

Differential Revision: https://reviews.llvm.org/D123285
2022-04-11 09:32:52 +02:00
Alexander Shaposhnikov e995526e66 [AArch64][NFC] Update comment in AArch64.td 2022-04-11 05:36:28 +00:00
Alexander Shaposhnikov 626039cdcc [AArch64] Split fuse-literals feature
This diff splits fuse-literals feature and enables fuse-adrp-add by default,
in particular, it adjusts instruction scheduling to place ADRP+ADD pairs together.
This also enables the linker to apply the relaxations described in
d2ca58c54b.

Differential revision: https://reviews.llvm.org/D120104

Test plan: make check-all
2022-04-11 05:27:11 +00:00
Patryk Wychowaniec d16a631c12 [AVR] Merge AVRRelaxMemOperations into AVRExpandPseudoInsts
This commit contains a refactoring that merges AVRRelaxMemOperations
into AVRExpandPseudoInsts, so that we have a single place in code that
expands the STDWPtrQRr opcode.

Seizing the day, I've also fixed a couple of potential bugs with our
previous implementation (e.g. when the destination register was killed,
the previous implementation would try to .addDef() that killed
register, crashing LLVM in the process - that's fixed now, as proved by
the test).

Reviewed By: benshi001

Differential Revision: https://reviews.llvm.org/D122533
2022-04-11 02:42:13 +00:00
LiaoChunyu 505fce5a9e [RISCV] Add basic code modeling for llvm.experimental.stepvector intrinsic
Scalable vectors llvm.experimental.stepvector intrinsic
will crash due to an invalid cost when run the code through the loopunroll.

Reviewed By: kito-cheng

Differential Revision: https://reviews.llvm.org/D122782
2022-04-11 10:19:23 +08:00
Yaxun (Sam) Liu 4ea1d43509 [CUDA][HIP] Externalize kernels in anonymous name space
kernels in anonymous name space needs to have unique name
to avoid duplicate symbols.

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

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D123353
2022-04-10 21:56:28 -04:00
Nico Weber a91c77ee28 [llvm-objcopy] Update comments with capitalization change from 6b575395d4
No behavior change.
2022-04-10 21:47:23 -04:00
Sheng ba59ec2843 Fix a misuse of `cast`
`cast` will assert instead of returning null pointer.
2022-04-11 01:21:15 +00:00
Florian Hahn 3c14836093
[LAA] Add test with simpler load of pointer select.
Add a simpler test for D114487/D108699.
2022-04-10 23:54:41 +02:00
Florian Hahn b42c054744
[LICM] Add test for PR51248.
Test for #51248. LICM introduces an unused load in a writeonly function.
2022-04-10 22:36:03 +02:00
Florian Hahn 9a63978b85
[LICM] Trim unneeded functions from test, add promote-able load.
Clean up the test a bit. Also add a promote-able load, to make sure LICM
always has to hoist the load.
2022-04-10 22:25:05 +02:00
eop Chen c6e83f560f [X86] Remove dead code from test case
Obvious NFC, no need to review.

Differential Revision: https://reviews.llvm.org/D123465
2022-04-10 09:23:40 -07:00
Nikolas Klauser aed0e8b805 [libc++] Rename the template arguments of the algorithm result types
Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D123463
2022-04-10 14:22:13 +02:00
Simon Pilgrim 88ff6f70c4 [X86] Extend vselect(cond, pshufb(x), pshufb(y)) -> or(pshufb(x), pshufb(y)) to include inner or(pshufb(x), pshufb(y)) chains 2022-04-10 13:04:53 +01:00
Alex Fan acb408fbbc [ORC] add lazy jit support for riscv64
This adds resolver, indirection and trampoline stubs for riscv64,
allowing lazy compilation to work.

It assumes hard float extension exists. I don't know the proper way to detect it as Triple doesn't provide the interface to check riscv +f +d abi.

I am also not sure if orclazy tests should be enabled because lli needs an additional -codemodel=melany for tests to pass.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D122543
2022-04-10 18:44:50 +08:00
Simon Pilgrim c74d729bd6 [X86] combineExtractSubvector - fold extract_subvector(insert_subvector(V,X,C1),C1)
extract_subvector(insert_subvector(V,X,C1),C1) -> insert_subvector(extract_subvector(V,C1),X,0)

More aggressively attempt to reduce the width of an extract_subvector source - we currently only do this if we're inserting into a zero vector (i.e. canonicalizing to the AVX implicit zero upper elts pattern).

But if we're extracting from the same point as the inner insert_subvector then the fold is still relatively trivial - we can probably do even better if we can ensure the subvector isn't badly split.
2022-04-10 11:03:08 +01:00
Fangrui Song a96cbb503a [Driver] Prepend - to option name in err_drv_unsupported_option_argument diagnostic 2022-04-10 01:44:53 -07:00
Florian Hahn 5f1eb74850
[VPlan] Place VPExpandSCEVRecipe in pre-header.
After D121624 models the pre-header in VPlan, VPExpandSCEVRecipes can be
placed there. This ensures SCEV expansion happens before modifying the
CFG during VPlan execution, when CFG is incomplete.

Depends on D121624.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D122095
2022-04-10 10:26:20 +02:00
Fangrui Song 8e1530ba43 [Driver] Simplify OPT_fcolor_diagnostics claim
Mostly NFC, but the diagnostic is changed to the more appropriate
err_drv_invalid_argument_to_option.
2022-04-10 01:21:31 -07:00
Fangrui Song 30b1c1f23d [Driver] Simplify -f[no-]diagnostics-color handling. NFC
Make them aliases for -f[no-]color-diagnostics.
2022-04-10 01:07:44 -07:00
Fangrui Song d74039fa8e [Frontend] Simplify -finline* handling. NFC 2022-04-10 00:31:25 -07:00
Fangrui Song ee7fb36ba0 [Driver] Fix -f[no-]inline to override -f[no-]inline-functions/-finline-hint-functions
Fix two cases to match GCC:

* -fno-inline -finline => (no cc1 option)
* -fno-inline -finline-functions => -fno-inline
2022-04-10 00:15:12 -07:00
Luo, Yuanke 690bed0cec [X86][AMX] Fix infinite loop of getShape.
When walk the user chain to get the shape of a phi node. If it is phi
node in the chain, we should walk to the user of this phi node instead
of the original phi node.
2022-04-10 14:44:51 +08:00
Craig Topper 4e561a581f [RISCV] Remove unnecessary cast to i8* when converting gather/scatter to strided load/store.
Not sure why I thought this necessary at the time.
2022-04-09 20:05:03 -07:00
Alexander Shaposhnikov 4d87344e8c [ObjCopy][NFC] Refactor handling of linkedit_data_command in MachOWriter 2022-04-10 02:09:11 +00:00
Alexander Shaposhnikov 68f87acd57 [ObjCopy][NFC] Add missing const in MachOLayoutBuilder.h 2022-04-10 01:29:24 +00:00
Alexander Shaposhnikov ddc0908949 [ObjCopy][NFC] Refactor handling of linkedit_data_command 2022-04-10 01:20:45 +00:00
Aaron Ballman bdbfaf0ca7 Giving a lot more functions prototypes; NFC
This should address https://lab.llvm.org/buildbot/#/builders/37/builds/12315
and speculatively fix other similar diagnostics.
2022-04-09 17:25:10 -04:00
Bill Wendling 77e71bcfde [randstruct] NFC change to use static 2022-04-09 13:25:25 -07:00
LLVM GN Syncbot a099bc3c77 [gn build] Port 7aa8c38a9e 2022-04-09 20:16:19 +00:00
Connor Kuehl 7aa8c38a9e [randstruct] Add randomize structure layout support
The Randstruct feature is a compile-time hardening technique that
randomizes the field layout for designated structures of a code base.
Admittedly, this is mostly useful for closed-source releases of code,
since the randomization seed would need to be available for public and
open source applications.

Why implement it? This patch set enhances Clang’s feature parity with
that of GCC which already has the Randstruct feature. It's used by the
Linux kernel in certain structures to help thwart attacks that depend on
structure layouts in memory.

This patch set is a from-scratch reimplementation of the Randstruct
feature that was originally ported to GCC. The patches for the GCC
implementation can be found here:

  https://www.openwall.com/lists/kernel-hardening/2017/04/06/14

Link: https://lists.llvm.org/pipermail/cfe-dev/2019-March/061607.html
Co-authored-by: Cole Nixon <nixontcole@gmail.com>
Co-authored-by: Connor Kuehl <cipkuehl@gmail.com>
Co-authored-by: James Foster <jafosterja@gmail.com>
Co-authored-by: Jeff Takahashi <jeffrey.takahashi@gmail.com>
Co-authored-by: Jordan Cantrell <jordan.cantrell@mail.com>
Co-authored-by: Nikk Forbus <nicholas.forbus@gmail.com>
Co-authored-by: Tim Pugh <nwtpugh@gmail.com>
Co-authored-by: Bill Wendling <isanbard@gmail.com>
Signed-off-by: Bill Wendling <isanbard@gmail.com>

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D121556
2022-04-09 13:15:36 -07:00
Florian Hahn d5e66c16c0
[IRBuilder] Remove commented out include.
Looks like this was left over during some include optimizations. Remove
it.
2022-04-09 21:33:39 +02:00
Simon Pilgrim 4fe2e42bbc [X86] Remove cfi noise from splat-for-size.ll tests 2022-04-09 17:53:27 +01:00
Fangrui Song 958251ef76 Add some prototypes to fix -Wstrict-prototypes. NFC 2022-04-09 09:46:39 -07:00
PeixinQiao 38c502b6c7 [flang] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off build
Fix the warning from D122483.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D123455
2022-04-09 23:57:50 +08:00
Craig Topper 70046438d0 [RISCV] Only try LUI+SH*ADD+ADDI for int materialization if LUI+ADDI+SH*ADD failed.
There's an assert in LUI+SH*ADD+ADDI materialization that makes sure the
lower 12 bits aren't zero since that case should have been handled as
LUI+ADDI+SH*ADD. But nothing prevented the LUI+SH*ADD+ADDI checks from
running after the earlier code handled it.

The sequence would be the same length or longer so it wouldn't replace
the earlier sequence, but the assert happened before that was checked.

The vector holding the sequence also wasn't reset before the second
check so that guaranteed the sequence would never be found to be
shorter.

This patch fixes this by only trying the second expansion when the
earlier fails.

Fixes PR54812.

Reviewed By: benshi001

Differential Revision: https://reviews.llvm.org/D123406
2022-04-09 08:52:15 -07:00
Simon Pilgrim 5d0f2cf660 [X86] Add original test coverage for Issue #54819 2022-04-09 16:47:53 +01:00
Simon Pilgrim 30a01bccda [X86] Fold concat(pshufb(x,y),pshufb(z,w)) -> pshufb(concat(x,z),concat(y,w)) 2022-04-09 16:05:50 +01:00
owenca f67e3f6e8c [clang-format] Add execute permission to dump_format_help.py 2022-04-09 07:58:33 -07:00
Aaron Ballman 40ef3e6df6 Add some prototypes to these functions; NFC
This is expected to fix the issues in this build bot:
https://lab.llvm.org/buildbot/#/builders/37/builds/12312
2022-04-09 10:53:48 -04:00
LLVM GN Syncbot c6f37ab250 [gn build] Port a96443edde 2022-04-09 14:04:27 +00:00
Nikolas Klauser a96443edde [libc++] Implement P0401R6 (allocate_at_least)
Reviewed By: ldionne, var-const, #libc

Spies: mgorny, libcxx-commits, arichardson

Differential Revision: https://reviews.llvm.org/D122877
2022-04-09 16:03:45 +02:00
Simon Pilgrim 97ee923248 [X86] lowerV64I8Shuffle - attempt to fold to SHUFFLE(ALIGNR(X,Y)) and OR(PSHUFB(X),PSHUFB(Y)) 2022-04-09 14:09:39 +01:00
Aaron Ballman 5af1ca841f Add some prototypes to these checks; NFC
This should address a build bot failure:
https://lab.llvm.org/buildbot/#/builders/18/builds/4495
2022-04-09 08:38:29 -04:00
Florian Hahn 256c6b0ba1
[VPlan] Model pre-header explicitly.
This patch extends the scope of VPlan to also model the pre-header.
The pre-header can be used to place recipes that should be code-gen'd
outside the loop, like SCEV expansion.

Depends on D121623.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D121624
2022-04-09 14:19:47 +02:00
Simon Pilgrim 3d4bb78fbe [X86][SSE] combineSelect - more aggressively create zero elements in the or(pshufb(x), pshufb(y)) fold
When we fold vselect(cond, pshufb(x), pshufb(y)) -> or(pshufb(x), pshufb(y)), ensure we convert all undef elements to zero elements - this should help us expose more known zero elements for deeper chains of these cases.

Noticed while triaging Issue #54819
2022-04-09 12:53:00 +01:00
Jonas Hahnfeld e4903d8be3 [CUDA/HIP] Remove argument from module ctor/dtor signatures
In theory, constructors can take arguments when called via .init_array
where at least glibc passes in (argc, argv, envp). This isn't used in
the generated code and if it was, the first argument should be an
integer, not a pointer. For destructors registered via atexit, the
function should never take an argument.

Differential Revision: https://reviews.llvm.org/D123370
2022-04-09 12:34:41 +02:00
Simon Pilgrim f49a763c4d [X86] Add v64i8 shuffle test coverage
Legalized shuffle masks based on the test cases from Issue #54819
2022-04-09 11:33:15 +01:00
Simon Pilgrim f5b4507486 [X86] Reduce some superfluous diffs between znver1/znver2 models. NFC
znver2 is a mainly a search+replace of the znver1 model, but for no reason some lines have been moved around - try to keep these in sync (no actual changes in the models).
2022-04-09 10:59:18 +01:00
Simon Pilgrim 450f0d76b4 [LoopVectorize] Regenerate first-order-recurrence.ll 2022-04-09 10:33:03 +01:00