Commit Graph

388540 Commits

Author SHA1 Message Date
Simon Pilgrim 73635adb86 X86SpeculativeLoadHardeningPass::hardenValueInRegister - assert that we have a i8/i16/i32/i64 sized register. NFCI.
Silence static analyzer warning for out-of-range access to the SubRegImms[] array.
2021-05-15 15:13:28 +01:00
Simon Pilgrim e30540a603 SampleProfileLoader::inlineHotFunctionsWithPriority - Fix uninitialized variable warning. NFCI.
findIndirectCallFunctionSamples will leave Sum uninitialized if it returns an empty vector, we don't really use Sum in this case (but we do make a copy that isn't used either) - so ensure we initialize the value to zero to at least silence the static analysis warning.
2021-05-15 15:02:52 +01:00
Simon Pilgrim c5fe383990 IfConverter::MeetIfcvtSizeLimit - Fix uninitialized variable warnings. NFCI.
Ensure the duplication instruction counts are initialized to zero (even though they aren't used) to silence static analysis warnings.
2021-05-15 14:51:54 +01:00
Nikita Popov f9e9b0cdb4 [CFG] Move reachable from entry checks into basic block variant
These checks are not specific to the instruction based variant of
isPotentiallyReachable(), they are equally valid for the basic
block based variant. Move them there, to make sure that switching
between the instruction and basic block variants cannot introduce
regressions.
2021-05-15 15:42:02 +02:00
Simon Pilgrim f9b1208681 [X86][Atom] Fix vector integer multiplication resource/throughputs
Match whats documented in the Intel AOM (and Agner/instlatx64 agree) - vector integer multiplies are pipelined - all Port0, throughput = 2 @ 128bits, 1 @ 64bits.

Noticed while checking reduction costs - now that we can use in-order models in llvm-mca, the atom model is the "worst case scenario" we have in x86.
2021-05-15 14:25:48 +01:00
Simon Pilgrim f0660a977e [Local] collectBitParts - bail out if we find more than one root input value.
All the uses that we have for collectBitParts revolve around us matching down to an operation with a single root value - I don't think we're intending to change that (and a lot of collectBitParts assumes it).

The binops cases (OR/FSHL/FSHR) already check if the providers are the same, but that would still mean we waste time collecting through unaryops before getting to them.
2021-05-15 13:58:42 +01:00
Simon Pilgrim 401d6685c0 [InstCombine] InstCombinerImpl::visitOr - enable bitreverse matching
Currently we only match bswap intrinsics from or(shl(),lshr()) style patterns when we could often match bitreverse intrinsics almost as cheaply.

Differential Revision: https://reviews.llvm.org/D90170
2021-05-15 13:39:09 +01:00
Simon Pilgrim 9ca2c50b36 [X86] Try to pass DebugLoc by const-ref to avoid costly TrackingMDNodeRef copies (REAPPLIED). NFCI.
Reapply rG5ed56a821c06 (after reverted by rG7aa89c4a22fd) - don't take reference from struct that will be erased in X86FrameLowering::eliminateCallFramePseudoInstr
2021-05-15 13:23:28 +01:00
Simon Pilgrim 28aa7d378a [Local] collectBitParts - early-out from binops. NFCI.
Minor speedup by not bothering to attempt to collect the second operand's bit parts if we already know its failed in the first operand.
2021-05-15 13:04:10 +01:00
Sanjay Patel 23f7d651b6 [GlobalOpt] add tests for store alignment (PR50253); NFC 2021-05-15 07:31:45 -04:00
Sanjay Patel 6e1a6f6537 [GlobalOpt] add test checks; NFC
I'm also adding an explicit data layout, so we can
confirm that alignment requirements/prefs are met.

I tried to use complete/scripted CHECK lines here,
but that fails with 1 of the globals, and not sure why.
2021-05-15 07:27:17 -04:00
Nikita Popov fb9ed1979a [IR] Add BasicBlock::isEntryBlock() (NFC)
This is a recurring and somewhat awkward pattern. Add a helper
method for it.
2021-05-15 12:41:58 +02:00
mydeveloperday eae445f65d [clang-format] PR50326 AlignAfterOpenBracket AlwaysBreak does not keep to the ColumnLimit
https://bugs.llvm.org/show_bug.cgi?id=50326

{D93626} caused a regression in terms of formatting a function ptr, incorrectly thinking it was a C-Style cast.

This cased a formatter regression between clang-format-11 and clang-format-12

```
void bar()
{
    size_t foo = function(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong);

    size_t foo = function(
        Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
        FoooooooooLooooong);

    size_t foo = (*(function))(Foooo, Barrrrr, Foooo, FoooooooooLooooong);

    size_t foo = (*(
        function))(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong,
        BarrrrrrrrrrrrLong, FoooooooooLooooong);
}
```

became

```
void bar()
{
    size_t foo1 = function(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong);

    size_t foo2 = function(
        Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
        FoooooooooLooooong);

    size_t foo3 = (*(function))(Foooo, Barrrrr, Foooo, FoooooooooLooooong);

    size_t foo4 = (*(
        function))(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong, FoooooooooLooooong);
}
```

This fixes this issue by simplify the clause to be specific about what is wanted rather than what is not.

Reviewed By: curdeius, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D102392
2021-05-15 11:29:56 +01:00
Nikita Popov 6418bab6f8 [CFG] Use comesBefore() (NFC)
Use comesBefore() instead of performing an instruction walk. In
line with the previous implementation, instructions are considered
to reach themselves.
2021-05-15 12:14:30 +02:00
Nikita Popov f765e54db2 [CaptureTracking] Clean up same instruction check (NFC)
Check the BeforeHere == I case once in shouldExplore, instead of
handling it in four different places.
2021-05-15 11:58:55 +02:00
Tomasz Miąsko 2ba49f6ae6 [Demangle][Rust] Parse char constants
Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D102524
2021-05-15 10:48:27 +02:00
Tomasz Miąsko fc0f2bb91d [Demangle][Rust] Parse bool constants
Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D102518
2021-05-15 09:47:17 +02:00
Tim Northover dbf8cc7b66 Verifier: second attempt to fix what I broke with swiftasync.
During a rebase I messed up this array, so trying to put it back to as it was
before with just one SwiftAsync entry.
2021-05-15 08:04:57 +01:00
Douglas Yung 59b419adc6 Revert "[Clang,Driver] Add -fveclib=Darwin_libsystem_m support."
This reverts commit 187a14e1f3.

The test added in this commit is failing on several build bots:

https://lab.llvm.org/buildbot/#/builders/139/builds/4059
https://lab.llvm.org/buildbot/#/builders/132/builds/5605
2021-05-14 22:39:12 -07:00
Vitaly Buka 0a621d3398 [sanitizer] Disable test on Android
readelf needs access to the actual compiled binary, but it's replaced
by a wrapper script.
2021-05-14 22:04:35 -07:00
Vitaly Buka 6ce7b2f026 Fix "is not used" warning 2021-05-14 20:58:58 -07:00
Lang Hames 49cdd62db5 [llvm-jitlink] Link libnetwork on Haiku in llvm-jitlink
The system's network API is in libnetwork.so, so we explicitly need to link to
them on Haiku. This patch is similar to https://reviews.llvm.org/D97633.

Patch by Niels Reedijk. Thanks Niels!

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D98405
2021-05-14 20:49:03 -07:00
Aart Bik 64ab997ff4 [mlir][sparse] remove accidental debug code
Differential Revision: https://reviews.llvm.org/D102545
2021-05-14 19:28:25 -07:00
Nico Weber 46b14dc485 [gn build] (manually) port ad7e12226f 2021-05-14 22:24:39 -04:00
Aart Bik 56fd4c1cf8 [mlir][sparse] prepare runtime support lib for multiple dim level types
We are moving from just dense/compressed to more general dim level
types, so we need more than just an "i1" array for annotations.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D102520
2021-05-14 19:12:07 -07:00
Philip Reames fcd12fed41 Extract a helper routine to simplify D91481 [NFC] 2021-05-14 18:40:23 -07:00
Hendrik Greving 9d8e83b50e [MC] Add the ability to pass MCRegisterInfo to dump_pretty.
Adds the ability to pass MCRegisterInfo to dump_pretty and to the print functions,
so that if present, target specific enums names are printed instead of enum values.
2021-05-14 18:21:57 -07:00
Dan Liew ad7e12226f [Compiler-rt] Distinguish between testing just built runtime libraries and the libraries shipped with the compiler.
The path to the runtime libraries used by the compiler under test
is normally identical to the path where just built libraries are
created. However, this is not necessarily the case when doing standalone
builds. This is because the external compiler used by tests may choose
to get its runtime libraries from somewhere else.

When doing standalone builds there are two types of testing we could be
doing:

* Test the just built runtime libraries.
* Test the runtime libraries shipped with the compile under test.

Both types of testing are valid but it confusingly turns out compiler-rt
actually did a mixture of these types of testing.

* The `test/builtins/Unit/` test suite always tested the just built runtime
  libraries.
* All other testsuites implicitly use whatever runtime library the
  compiler decides to link.

There is no way for us to infer which type of testing the developer
wants so this patch introduces a new
`COMPILER_RT_TEST_STANDALONE_BUILD_LIBS` CMake
option which explicitly declares which runtime libraries should be
tested. If it is `ON` then the just built libraries should be tested,
otherwise the libraries in the external compiler should be tested.

When testing starts the lit test suite queries the compiler used for
testing to see where it will get its runtime libraries from.  If these
paths are identical no action is taken (the common case). If the paths
are not identical then we check the value of
`COMPILER_RT_TEST_STANDALONE_BUILD_LIBS` (progated into the config as
`test_standalone_build_libs`) and check if the test suite supports testing in the
requested configuration.

* If we want to test just built libs and the test suite supports it
  (currently only `test/builtins/Unit`) then testing proceeds without any changes.
* If we want to test the just built libs and the test suite doesn't
  support it we emit a fatal error to prevent the developer from
  testing the wrong runtime libraries.
* If we are testing the compiler's built libs then we adjust
  `config.compiler_rt_libdir` to point at the compiler's runtime
  directory. This makes the `test/builtins/Unit` tests use the
  compiler's builtin library. No other changes are required because
  all other testsuites implicitly use the compiler's built libs.

To make the above work the
`test_suite_supports_overriding_runtime_lib_path` test suite config
option has been introduced so we can identify what each test suite
supports.

Note all of these checks **have to be performed** when lit runs.
We cannot run the checks at CMake generation time because
multi-configuration build systems prevent us from knowing what the
paths will be.

We could perhaps support `COMPILER_RT_TEST_STANDALONE_BUILD_LIBS` being
`ON` for most test suites (when the runtime library paths differs) in
the future by specifiying a custom compiler resource directory path.
Doing so is out of scope for this patch.

rdar://77182297

Differential Revision: https://reviews.llvm.org/D101681
2021-05-14 18:07:34 -07:00
Amara Emerson 80c534a8f9 [GlobalISel][CallLowering] Fix crash when handling a v3s32 type that's being passed as v2s64. 2021-05-14 16:30:51 -07:00
Sam Clegg 119f61af3a [lld][WebAssembly] Remove unused method declaration. NFC
This method was removed in https://reviews.llvm.org/D102265
but the declaration was missed.
2021-05-14 15:54:33 -07:00
Benjamin Kramer a558ebbd6f Reinstate gtest fix from 4f0b0bf5c6
I missed this when merging gtest 1.10.0, breaking all asan tests :|
2021-05-15 00:35:53 +02:00
Nick Desaulniers 8c72749bd9 [LowerConstantIntrinsics] reuse isManifestLogic from ConstantFolding
GlobalVariables are Constants, yet should not unconditionally be
considered true for __builtin_constant_p.

Via the LangRef
https://llvm.org/docs/LangRef.html#llvm-is-constant-intrinsic:

    This intrinsic generates no code. If its argument is known to be a
    manifest compile-time constant value, then the intrinsic will be
    converted to a constant true value. Otherwise, it will be converted
    to a constant false value.

    In particular, note that if the argument is a constant expression
    which refers to a global (the address of which _is_ a constant, but
    not manifest during the compile), then the intrinsic evaluates to
    false.

Move isManifestConstant from ConstantFolding to be a method of
Constant so that we can reuse the same logic in
LowerConstantIntrinsics.

pr/41459

Reviewed By: rsmith, george.burgess.iv

Differential Revision: https://reviews.llvm.org/D102367
2021-05-14 15:35:21 -07:00
zoecarver bede7523b1 [libcxx][ranges] Add `contiguous_iterator`.
Differential Revision: https://reviews.llvm.org/D101396
2021-05-14 15:27:40 -07:00
Benjamin Kramer cb846654c6 [compiler-rt] Fix deprection warnings on INSTANTIATE_TEST_CASE_P 2021-05-15 00:24:02 +02:00
Nicolas Vasilache dd65f420cd [mlir][Linalg] NFC - More gracefully degrade lookup into failure during comprehensive bufferization (4/n)
Differential revsion: https://reviews.llvm.org/D102420
2021-05-14 22:12:23 +00:00
Brendon Cahoon 3f7b7e7393 [AMDGPU] Update SCC defs to VCC when uses are changed to VCC
The FixSGPRCopies pass converts instructions to VALU when
removing illegal VGPR to SGPR copies. Instructions that use SCC
are changed to use VCC instead. When that happens, the pass must
also change instructions that define SCC to define VCC.

The pass was not changing the SCC definition when an ADDC is
converted due to a input that is a VGPR to SGPR copy. But, the
initial ADD insruction, which define SCC, is not converted.
This causes a compilation failure due to a use of an undefined
physical register.

This patch adds code that inserts the SCC definition in the
MoveToVALU worklist when a SCC use is converted to a VCC use.

Differential Revision: https://reviews.llvm.org/D102111
2021-05-14 18:05:05 -04:00
Mitch Phillips 597ecf9fb7 [msan] [NFC] Add newline to EOF in test. 2021-05-14 15:00:00 -07:00
Nicolas Vasilache 6f90955f69 [mlir][Linalg] Add support for subtensor_insert comprehensive bufferization (3/n)
Differential revision: https://reviews.llvm.org/D102417
2021-05-14 21:51:00 +00:00
Mitch Phillips 7aa89c4a22 Revert "[X86] Try to pass DebugLoc by const-ref to avoid costly TrackingMDNodeRef copies. NFCI."
This reverts commit 5ed56a821c.

Reason: Broke the MSan buildbots. See Phabricator for more info
(https://reviews.llvm.org/rG5ed56a821c0622869739a3ae752eea97a1ee1f48).
2021-05-14 14:30:57 -07:00
Arthur Eubanks e8448a5985 [NFC] Directly get GV type 2021-05-14 14:27:07 -07:00
Michael Kruse fb01b1461a [Polly] Run polly-update-format. NFC.
Thanks to Leonard Chan for reporting.
2021-05-14 16:23:36 -05:00
wlei e475d4d69f [CSSPGO] Fix return value of getProbeWeight
Currently we didn't support multiple return type, we work around to use error_code to represent:

1)  The dangling probe.
2)  Ignore the weight of non-probe instruction

While merging the instructions' weight for the whole BB, it will filter out the error code. But If all instructions of the BB give error_code, the outside logic will mark it as a BB requiring the inference algorithm to infer its weight. This is different from the zero value which will be treated as a cold block.

Fix one place that if we can't find the FunctionSamples in the profile data which indicates the BB is cold, we choose to return zero.

Also refine the comments.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D102007
2021-05-14 14:06:09 -07:00
Nikita Popov c4fb2a1fc2 [MemDep] Use BatchAA in more places (NFCI)
Previously, we already used BatchAA for individual simple pointer
dependency queries. This extends BatchAA usage for the non-local
case, so that only one BatchAA instance is used for all blocks,
instead of one instance per block.

Use of BatchAA is safe as IR cannot be modified during a MemDep
query.
2021-05-14 22:54:40 +02:00
Neumann Hon 8a7e2fb5f2 [SystemZ] [z/OS] Add SystemZCallingConventionRegisters class
This patch adds the abstract class SystemZCallingConventionRegisters
which is a SystemZ-specific class detailing special registers used
by calling conventions on the target. SystemZELFRegisters and
SystemZXPLINK64Registers implement this class for ELF and XPLINK64
respectively.

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D102370
2021-05-14 16:51:26 -04:00
Mateusz Mikuła f84a4cb0df [LLD][MinGW] Ignore --no-undefined flag
AFAIK this is the default behaviour when this flag is not passed.

Differential Revision: https://reviews.llvm.org/D102516
2021-05-14 23:47:50 +03:00
Mateusz Mikuła bf95a8cf86 [MinGW] Always enable -mbig-obj for LLVM build unless using Clang
It's easy to hit 2**16 limit with i686 GNU toolchains these days.
Clang does it automagically, so it's not needed there, and the option
causes warnings about being unused when linking.

Differential Revision: https://reviews.llvm.org/D102419
2021-05-14 23:47:50 +03:00
Mitch Phillips 6c913b2f37 [Scudo] Delete unused flag 'rss_limit_mb'.
EOM.

Reviewed By: cryptoad

Differential Revision: https://reviews.llvm.org/D102529
2021-05-14 13:45:43 -07:00
Florian Hahn 68d52f0dbe
[LV] Add another more complex first-order recurrence sinking test. 2021-05-14 21:26:34 +01:00
Florian Hahn 187a14e1f3
[Clang,Driver] Add -fveclib=Darwin_libsystem_m support.
Support for Darwin's libsystem_m's vector functions has been added to
LLVM in 93a9a8a8d9.

This patch adds support for -fveclib=Darwin_libsystem_m to Clang.

Reviewed By: arphaman

Differential Revision: https://reviews.llvm.org/D102489
2021-05-14 21:00:13 +01:00
Nikita Popov 5e289cc597 [AA] Support callCapturesBefore() on BatchAA (NFCI)
This is not expected to have any practical compile-time effect,
as the alias() calls inside callCapturesBefore() are rare. This
should still be supported for API completeness, and might be
useful for reachability caching.
2021-05-14 21:48:08 +02:00