1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
Commit Graph

200317 Commits

Author SHA1 Message Date
Igor Kudrin
307bae0402 [DebugInfo] Fix a possible crash when reading a malformed .debug_*lists section.
DWARFListTableHeader::length() handles the zero value of HeaderData.Length
in a special way, which makes the result different from the calculated
value of FullLength, which leads to triggering an assertion. The patch
moves the assertion a bit later when `FullLength` is already checked for
minimal allowed value.

Differential Revision: https://reviews.llvm.org/D82886
2020-07-14 16:35:17 +07:00
Igor Kudrin
2ffa4ea126 [DebugInfo] Add unit tests for DWARFListTableHeader::length().
This adds unit tests to check the expected behavior of the method in
case the unit length field is truncated.

Differential Revision: https://reviews.llvm.org/D83673
2020-07-14 16:35:17 +07:00
LLVM GN Syncbot
fbb19ba599 [gn build] Port c15e04ee5e4 2020-07-14 09:31:18 +00:00
Rainer Orth
9e02e0007f [llvm][unittests] Fix ProgramEnvTest.TestExecuteAndWaitStatistics on Solaris
The new `LLVM-Unit :: Support/./SupportTests/ProgramEnvTest.TestExecuteAndWaitStatistics` test currently FAILs on Solaris:

  [ RUN      ] ProgramEnvTest.TestExecuteAndWaitStatistics
  /vol/llvm/src/llvm-project/local/llvm/unittests/Support/ProgramTest.cpp:360: Failure
  Expected: (ProcStat->PeakMemory) > (0U), actual: 0 vs 0
  [  FAILED  ] ProgramEnvTest.TestExecuteAndWaitStatistics (22 ms)

According to `llvm/lib/Support/Unix/Program.inc (llvm::sys::Wait)`, `PeakMemory`
corresponds to `struct rusage.ru_maxrss`.

However, Solaris `getrusage(3C)` documents

  NOTES
         The ru_maxrss, ru_ixrss, ru_idrss, and ru_isrss members of  the  rusage
         structure are set to 0 in this implementation.

Since changing the test to check for `PeakMemory >= 0` instead is pointless
and would generate a warning on targets where `ru_maxrss` is unsigned, this
patch removes the check.

Tested on `amd64-pc-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D83661
2020-07-14 11:29:47 +02:00
Oliver Stannard
7e201bfc21 [llvm-objdump] Add entry_value and stack_value opcodes
Add the DW_OP_entry_value and DW_OP_stack_value opcodes to the DWARF
expression printer.

Differential revision: https://reviews.llvm.org/D74843
2020-07-14 10:24:59 +01:00
Oliver Stannard
0bff20bf2b [llvm-objdump] Add simple memory expressions to variable display
Add the DW_OP_breg0..DW_OP_breg31 and DW_OP_bregx opcodes to the DWARF
expression printer.

Differential revision: https://reviews.llvm.org/D74841
2020-07-14 10:24:59 +01:00
Oliver Stannard
c74e12623d [DebugInfo] Add unit test for compact expression printer
Add a unit test for the compact DWARF expression printer which will be
used by the llvm-objdump --debug-vars option.

Differential revision: https://reviews.llvm.org/D75250
2020-07-14 10:24:59 +01:00
Jay Foad
f4ddb9229d [AMDGPU] Fix typos in performCtlz_CttzCombine()
Fix two obvious errors in the code and also update the test check.
Also add one test to catch the failure.

Patch by Ruiling Song!

Differential Revision: https://reviews.llvm.org/D83280
2020-07-14 10:18:18 +01:00
Sjoerd Meijer
e5c42c0c3a [ARM][MVE] Only tail-fold integer add reductions
If a vector body has live-out values, it is probably a reduction, which needs a
final reduction step after the loop. MVE has a VADDV instruction to reduce
integer vectors, but doesn't have an equivalent one for float vectors. A
live-out value that is not recognised as reduction later in the optimisation
pipeline will result in the tail-predicated loop to be reverted to a
non-predicated loop and this is very expensive, i.e. it has a significant
performance impact, which is what we hope to avoid with fine tuning the ARM TTI
hook preferPredicateOverEpilogue implementation.

Differential Revision: https://reviews.llvm.org/D82953
2020-07-14 10:15:07 +01:00
Sander de Smalen
d549b86c4b [AArch64][SVE] Remove erroneous assert in resolveFrameOffsetReference
The code already supports addressing a fixed-size stack object from
the frame-pointer, by first subtracting sizeof(SVE area) from FP.

Reviewers: efriedma, cameron.mcinally, david-arm, rengolin

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D83125
2020-07-14 09:22:45 +01:00
Jay Foad
936643e784 [AMDGPU] Avoid using s_cmpk when src0 is not register
The hardware spec require src0 of s_cmpk should be a register. So, we
should not optimize s_cmp to s_cmpk if src0 is not register.

Patch by Ruiling Song!
2020-07-14 09:05:53 +01:00
serge-sans-paille
64c86a124b Double check that passes correctly set their Modified status
The approach is simple: if a pass reports that it's not modifying a
Function/Module, compute a loose hash of that Function/Module and compare it
with the original one. If we report no change but there's a hash change, then we
have an error.

This approach misses a lot of change but it's not super intrusive and can
detect most of the simple mistakes.

Differential Revision: https://reviews.llvm.org/D80916
2020-07-14 09:56:49 +02:00
Roman Lebedev
dd4ca814e4 [NFCI][InstCombine] Move store merging from visitStoreInst() into visitUnconditionalBranchInst()
Summary:
As @nikic is pointing out in https://bugs.llvm.org/show_bug.cgi?id=46680#c5,
InstCombine should not have forward instruction scans,
so let's move this transform into the proper place.

This is pretty much NFCI.

Reviewers: nikic, spatel

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits, nikic

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D83670
2020-07-14 10:41:51 +03:00
David Sherwood
1652ed61e6 [SVE][CodeGen] Add README for SVE-related warnings in tests
I have added a new file:

  llvm/test/CodeGen/AArch64/README

that describes what to do in the event one of the SVE codegen tests
fails the warnings check. In addition, I've added comments to all
the relevant SVE tests pointing users at the README file.

Differential Revision: https://reviews.llvm.org/D83467
2020-07-14 08:31:10 +01:00
David Sherwood
e2ac04d582 [SVE] Fix implicit TypeSize->uint64_t conversion getCastInstrCost
In getCastInstrCost() when comparing different sizes for src and
dst types we should be using the TypeSize comparison operators
instead of relying upon TypeSize being converted a uin64_t.
Previously this meant we were dropping the scalable property and
treating fixed and scalable vector types the same.

Differential Revision: https://reviews.llvm.org/D83461
2020-07-14 08:16:31 +01:00
David Sherwood
314ce05460 [SVE][CodeGen] Fix implicit TypeSize->uint64_t conversion in TransformFPLoadStorePair
In DAGCombiner::TransformFPLoadStorePair we were dropping the scalable
property of TypeSize when trying to create an integer type of equivalent
size. In fact, this optimisation makes no sense for scalable types
since we don't know the size at compile time. I have changed the code
to bail out when encountering scalable type sizes.

I've added a test to

  llvm/test/CodeGen/AArch64/sve-fp.ll

that exercises this code path. The test already emits an error if it
encounters warnings due to implicit TypeSize->uint64_t conversions.

Differential Revision: https://reviews.llvm.org/D83572
2020-07-14 08:07:30 +01:00
Carl Ritson
ad47441372 [AMDGPU][NFC] Tidy sgpr-control-flow.ll whitespace
Pre-commit clean up for D83641.
2020-07-14 16:03:05 +09:00
Djordje Todorovic
16115b424b [deadargelim] Attach dbg info to the insert/extractvalue instructions
Attach DbgLoc on insertvalue/extractvalue instructions created by
DeadArgumentElimination.

This fixes the PR46350.

Differential Revision: https://reviews.llvm.org/D81939
2020-07-14 08:52:04 +02:00
Carl Ritson
ac10c3fffa [AMDGPU] Propagate dead flag during pre-RA exec mask optimizations
Preserve SCC dead flags in SIOptimizeExecMaskingPreRA.
This helps with removing redundant s_andn2 instructions later.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D83637
2020-07-14 12:53:43 +09:00
Amy Kwan
9e6b3fe312 [PowerPC][Power10] Implement Test LSB by Byte Builtins in LLVM/Clang
This patch implements builtins for the Test LSB by Byte instruction introduced
in Power10.

Differential Revision: https://reviews.llvm.org/D82431
2020-07-13 22:47:47 -05:00
Amara Emerson
0a9b8a10a9 [AArch64][GlobalISel] Add post-legalize combine for sext_inreg(trunc(sextload)) -> copy
On AArch64 we generate redundant G_SEXTs or G_SEXT_INREGs because of this.

Differential Revision: https://reviews.llvm.org/D81993
2020-07-13 20:27:45 -07:00
Xing GUO
c3fbfc7970 [DWARFYAML] Replace Is64bit with Is64BitAddrSize. NFC.
Is64bit is ambiguous. In this patch, we replace it with Is64BitAddrSize
to make it clearer.
2020-07-14 10:58:35 +08:00
Kai Luo
9f42c54bb4 [PowerPC] Generate CFI directives when probing in prologue
Add missing CFI directives when probing in prologue if
`stack-clash-protection` is enabled.

Differential Revision: https://reviews.llvm.org/D83276
2020-07-14 02:56:12 +00:00
Valentin Clement
fb679b5e37 Revert "[flang][openacc] OpenACC 3.0 parser"
This reverts commit 65049d16100af360674659fb56e8f9bec96a0836.

Buildbot failure clang-ppc64le-rhel
2020-07-13 22:35:19 -04:00
Valentin Clement
58b0cf65f9 Add LINK_COMPONENTS Support 2020-07-13 22:23:23 -04:00
Jameson Nash
202eae7f23 [GVN] teach ConstantFolding correct handling of non-integral addrspace casts
Here we teach the ConstantFolding analysis pass that it is not legal to
replace a load of a bitcast constant (having a non-integral addrspace)
with a bitcast of the value of that constant (with a different
non-integral addrspace).

But also teach it that certain bit patterns are always known and
convertable (a fact it already uses elsewhere). This required us to also
fix a globalopt test, since, after this change, LLVM is able to realize
that the test actually is a valid transform (NULL is always a known
bit-pattern) and so it doesn't need to emit the failure remarks for it.

Also simplify some of the negative tests for transforms by avoiding a
type change in their bitcast, and add positive versions of the same
tests, to show that they otherwise should work.

Differential Revision: https://reviews.llvm.org/D59730
2020-07-13 21:44:17 -04:00
Jameson Nash
3f3cb11075 [VNCoercion] avoid creating bitcast for zero offsets [NFCI]
This could previously make it more complicated for ConstantFolding
later, leading to a higher likelyhood it would have to reject the
expression, even though zero seems like probably the common case here.

Differential Revision: https://reviews.llvm.org/D59730
2020-07-13 21:44:17 -04:00
Jameson Nash
2e075ec44a [GVN] add early exit to ConstantFoldLoadThroughBitcast [NFC]
And adds some additional test coverage to ensure later commits don't
introduce regressions.

Differential Revision: https://reviews.llvm.org/D59730
2020-07-13 21:44:17 -04:00
zuojian lin
e43213dbb7 Fix undefined behavior in DWARF emission
Caused by uninitialized load of llvm::DwarfDebug::PrevCU:
llvm::DwarfCompileUnit::addRange () at ../lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp:276
llvm::DwarfDebug::endFunctionImpl () at ../lib/CodeGen/AsmPrinter/DwarfDebug.cpp:1586
llvm::DebugHandlerBase::endFunction () at ../lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp:319
llvm::AsmPrinter::EmitFunctionBody () at ../lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1230
llvm::ARMAsmPrinter::runOnMachineFunction () at ../lib/Target/ARM/ARMAsmPrinter.cpp:161

Most of the DebugInfo tests under `LLVM_LIT_ARGS:STRING=-sv --vg` prior to this fix, and pass with the fix applied.

Reviewed By: aprantl, dblaikie

Differential Revision: https://reviews.llvm.org/D81631
2020-07-13 18:32:36 -07:00
clementval
789e09adda [flang][openacc] Add Support library for error handling 2020-07-13 21:06:22 -04:00
Valentin Clement
d4a1df4b8e [flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.

Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby

Reviewed By: klausler

Subscribers: SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits

Tags: #llvm, #flang

Differential Revision: https://reviews.llvm.org/D83649
2020-07-13 20:15:06 -04:00
Gui Andrade
bf5a8236eb [MSAN] Implement experimental vector reduction intrinsics
Implement llvm.experimental.vector.{add,mul,or,and,...}.
An IR test is included but no C test for lack of good way to
get the compiler to emit these.

Differential Revision: https://reviews.llvm.org/D82920
2020-07-14 00:12:10 +00:00
Mircea Trofin
6a4c481801 [llvm][NFC] Removed unused CHECKs in a ml test
The CHECKs are now in Inputs/test-module.ll
2020-07-13 16:59:14 -07:00
Fangrui Song
b8f06a9e5f [PowerPC] Fix combineVectorShuffle regression after D77448
Commit 1fed131660b2 assumed that NewShuffle (shuffle vector
canonicalization result) will always be ShuffleVectorSDNode, which may
be false (it may be a BITCAST node):

```
...
t12: v4i32 = scalar_to_vector t2
t15: v16i8 = bitcast t12  # LHS
t17: v16i8 = vector_shuffle<u,u,u,u,u,u,u,u,0,1,2,3,u,u,u,u> t15, undef:v16i8  # SVN
```

Reviewed By: #powerpc, nemanjai

Differential Revision: https://reviews.llvm.org/D83617
2020-07-13 16:57:27 -07:00
LLVM GN Syncbot
ef5b92a924 [gn build] Port caf395ee8c2 2020-07-13 23:39:28 +00:00
Gui Andrade
e14ebade1a MemorySanitizer: If a field is marked noundef, check init at call site
Adds LLVM option to control eager checking under -msan-eager-checks.
This change depends on the noundef keyword to determining cases where it
it sound to check these shadows, and falls back to passing shadows
values by TLS.

Checking at call boundaries enforces undefined behavior rules with
passing uninitialized arguments by value.

Differential Revision: https://reviews.llvm.org/D81699
2020-07-13 23:32:26 +00:00
Mircea Trofin
7ac43aebf9 [llvm][NFC] ML InlineAdvisor: Factored CHECKs in common test
The CHECKs are going to be shared with the development mode test
2020-07-13 16:31:07 -07:00
Mircea Trofin
d4fa8385c7 Reapply "[llvm] Native size estimator for training -Oz inliner"
This reverts commit 9908a3b9f521c954cbf6adcec35b14b2f6c8da49.

The fix was to exclude the content of TFUtils.h (automatically
included in the LLVM_Analysis module, when LLVM_ENABLE_MODULES is enabled).

Differential Revision: https://reviews.llvm.org/D82817
2020-07-13 16:26:26 -07:00
Lang Hames
58cf4b3a2d [ORC] Fix typo in parameter name. 2020-07-13 16:19:31 -07:00
Tyker
174a27b790 [AssumeBundles] Use operand bundles to encode alignment assumptions
Summary:
NOTE: There is a mailing list discussion on this: http://lists.llvm.org/pipermail/llvm-dev/2019-December/137632.html

Complemantary to the assumption outliner prototype in D71692, this patch
shows how we could simplify the code emitted for an alignemnt
assumption. The generated code is smaller, less fragile, and it makes it
easier to recognize the additional use as a "assumption use".

As mentioned in D71692 and on the mailing list, we could adopt this
scheme, and similar schemes for other patterns, without adopting the
assumption outlining.

Reviewers: hfinkel, xbolva00, lebedev.ri, nikic, rjmccall, spatel, jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: thopre, yamauchi, kuter, fhahn, merge_guards_bot, hiraditya, bollu, rkruppe, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D71739
2020-07-14 01:05:58 +02:00
Eric Christopher
7d5a152fbb Fold the opt size check into the assert to silence an unused variable warning. 2020-07-13 16:05:24 -07:00
Gui Andrade
d3b03aba37 [InstCombine] Erase attribute lists for simplified libcalls
Currently, a transformation like pow(2.0, x) -> exp2(x) copies the pow
attribute list verbatim and applies it to exp2. This works out fine
when the attribute list is empty, but when it isn't clang may error due
due to the mismatch.

The source function and destination don't necessarily have anything
to do with one another, attribute-wise. So it makes sense to remove
the attribute lists (this is similar to what IPO does in this
situation).

This was discovered after implementing the `noundef` param attribute.

Differential Revision: https://reviews.llvm.org/D82820
2020-07-13 22:32:33 +00:00
Vedant Kumar
df500c22d2 Revert "[InstCombine] Drop debug loc in TryToSinkInstruction (reland)"
This reverts commit 9649c2095f07a392bc2b2a93b5bd6c4c9bf5ba34. See
discussion on the llvm-commits thread: if it's OK to preserve the
location when sinking a call, it's probably OK to always preserve the
location.
2020-07-13 15:17:07 -07:00
Vedant Kumar
2cd28cf683 Check output in test/CodeGen/Generic/MIRStripDebug/no-metadata-present.mir, NFC 2020-07-13 15:15:49 -07:00
Vedant Kumar
e1fcbb0f31 [debugify] Add targeted test for 2fa656c, NFC
https://reviews.llvm.org/D78411 introduced test changes which relied on
the ability to strip debugify metadata even if module-level metadata is
missing. This introduces a more targeted test for that ability.
2020-07-13 14:40:12 -07:00
Quentin Colombet
b999fed324 [MC/AsmParser] layout-interdependency.s depends on having a proper triple
Fix the requirements for that test.

NFC
2020-07-13 14:38:47 -07:00
Nikita Popov
addd3a654c [ADT] Specialize std::swap() for SetVector
This is intended to address a compile-time regression from
1eddce4177cfddc86d4696b758904443b0b4f193. A SmallPtrSet was
replaced with a SetVector there, which had an unexpected large
compile-time impact. It turns out that this structure is getting
swapped a lot, and previously this used an optimized std::swap()
specialization for SmallPtrSet. Now it ends up using the default,
triple-move based implementation, which is much more expensive.

This patch (partly) addresses the issue by specializing std::swap()
for SetVector.

Differential Revision: https://reviews.llvm.org/D82230
2020-07-13 23:14:04 +02:00
LLVM GN Syncbot
818fdbce3f [gn build] Port 9908a3b9f52 2020-07-13 20:18:59 +00:00
Davide Italiano
5e0e121c8b Revert "[llvm] Native size estimator for training -Oz inliner"
This reverts commit 83080a294ad7d145d758821bcf4354ad0cb7d299 as
it breaks the macOS modules build.
2020-07-13 13:13:36 -07:00
Lang Hames
16e50e0984 [ORC] Remove a spurious reinterpret_cast. 2020-07-13 12:39:24 -07:00