1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

192198 Commits

Author SHA1 Message Date
Craig Topper
de5f34315e [X86] Split X86ISD::CMP into an integer and FP opcode. 2020-02-16 10:10:19 -08:00
LLVM GN Syncbot
c716c3ff18 [gn build] Port ee2c0f76d74 2020-02-16 17:32:06 +00:00
Eric Astor
ca668acee6 [ms] [llvm-ml] Add a draft MASM parser
Summary:
Many directives are unavailable, and support for others may be limited.

This first draft has preliminary support for:
    - conditional directives (including errors),
    - data allocation (unsigned types up to 8 bytes, and ALIGN),
    - equates/variables (numeric and text),
    - and procedure directives (without parameters),
as well as COMMENT, ECHO, INCLUDE, INCLUDELIB, PUBLIC, and EXTERN. Text variables (aka text macros) are expanded in-place wherever the identifier occurs.

We deliberately ignore all ml.exe processor directives.

Prominent features not yet supported:
    - structs
    - macros (both procedures and functions)
    - procedures (with specified parameters)
    - substitution & expansion operators

Conditional directives are complicated by the fact that "ifdef rax" is a valid way to check if a file is being assembled for a 64-bit x86 processor; we add support for "ifdef <register>" in general, which requires adding a tryParseRegister method to all MCTargetAsmParsers. (Some targets require backtracking in the non-register case.)

Reviewers: rnk, thakis

Reviewed By: thakis

Subscribers: kerbowa, merge_guards_bot, wuzish, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, mgorny, sbc100, jgravelle-google, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72680
2020-02-16 12:30:46 -05:00
Nikita Popov
8b20125228 [IRBuilder] Prefer InsertPointGuard over full copy; NFC
Don't copy the IRBuilder when an InsertPointGuard would also do.
2020-02-16 18:02:29 +01:00
Nikita Popov
d43d09bc84 [IRBuilder] Fix unnecessary IRBuilder copies; NFC
Fix a few cases where an IRBuilder is passed to a helper function
by value, while a by reference pass was intended.
2020-02-16 17:57:18 +01:00
Simon Pilgrim
dd8d9953a0 [X86] combineX86ShuffleChain - add support for combining 512-bit shuffles to PALIGNR 2020-02-16 16:13:26 +00:00
Simon Pilgrim
d3230253b1 [X86] combineX86ShuffleChain - add support for combining 512-bit shuffles to bit shifts 2020-02-16 16:13:25 +00:00
Nikita Popov
163465c064 Revert "[IRBuilder] Virtualize IRBuilder"
This reverts commit 0765d3824d069f37596bc5a890399099b776c2a0.
This reverts commit 1b04866a3db9f816a559860f941da067fe1eccf1.

Relevant looking crashes observed on:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win
2020-02-16 17:01:10 +01:00
Sanjay Patel
ace163be2a [VectorCombine] fix cost calc for extract-cmp
getOperationCost() is not the cost we wanted; that's not the
throughput value that the rest of the calculation uses.

We may want to switch everything in this code to use the
getInstructionThroughput() wrapper to avoid these kinds of
problems, but I'll look at that as a follow-up because that
can create other logical diffs via using optional parameters
(we'd need to speculatively create the vector instruction to
make a fair(er) comparison).
2020-02-16 10:40:28 -05:00
Sanjay Patel
e1da7dc606 [x86] form broadcast of scalar memop even with >1 use
The unseen logic diff occurs because MayFoldLoad() is defined like this:

static bool MayFoldLoad(SDValue Op) {
  return Op.hasOneUse() && ISD::isNormalLoad(Op.getNode());
}

The test diffs here all seem ok to me on screen/paper, but it's hard to know
if that will lead to universally better perf for all targets. For example,
if a target implements broadcast from mem as multiple uops, we would have to
weigh the potential reduction of instructions and register pressure vs.
possible increase in number of uops. I don't know if we can make a truly
informed decision on this at compile-time.

The motivating case that I'm looking at in PR42024:
https://bugs.llvm.org/show_bug.cgi?id=42024
...resembles the diff in extract-concat.ll, but we're not going to change the
larger example there without at least 1 other fix.

Differential Revision: https://reviews.llvm.org/D74088
2020-02-16 10:32:56 -05:00
Nikita Popov
344cb40499 [InstCombine] Create new log2 intrinsic; NFCI
Rather than mixing creation of new instructions and in-place
modification here, create a new log2 intrinsic. This should be
NFC apart from worklist order changes.
2020-02-16 15:52:09 +01:00
Nikita Popov
f51c934143 [InstCombine] Add multiuse tests for cttz transform; NFC
These show incorrect duplication of instructions.
2020-02-16 15:52:09 +01:00
Nikita Popov
16d8ab7026 [IRBuilder] Try to fix warnings
Try to fix -Wnon-virtual-dtor warnings that cause build failure
on clang-pcc64le-rhel.
2020-02-16 15:32:11 +01:00
Nikita Popov
f3c97cd987 [IRBuilder] Virtualize IRBuilder
Related llvm-dev thread:
http://lists.llvm.org/pipermail/llvm-dev/2020-February/138951.html

This patch moves the IRBuilder from templating over the constant
folder and inserter towards making both of these virtual.
There are a couple of motivations for this:

1. It's not possible to share code between use-sites that use
different IRBuilder folders/inserters (short of templating the code
and moving it into headers).
2. Methods currently defined on IRBuilderBase (which is not templated)
do not use the custom inserter, resulting in subtle bugs (e.g.
incorrect InstCombine worklist management). It would be possible to
move those into the templated IRBuilder, but...
3. The vast majority of the IRBuilder implementation has to live
in the header, because it depends on the template arguments.
4. We have many unnecessary dependencies on IRBuilder.h,
because it is not easy to forward-declare. (Significant parts of
the backend depend on it via TargetLowering.h, for example.)

This patch addresses the issue by making the following changes:

* IRBuilderDefaultInserter::InsertHelper becomes virtual.
  IRBuilderBase accepts a reference to it.
* IRBuilderFolder is introduced as a virtual base class. It is
 implemented by ConstantFolder (default), NoFolder and TargetFolder.
  IRBuilderBase has a reference to this as well.
* All the logic is moved from IRBuilder to IRBuilderBase. This means
  that methods can in the future replace their IRBuilder<> & uses
  (or other specific IRBuilder types) with IRBuilderBase & and thus
  be usable with different IRBuilders.
* The IRBuilder class is now a thin wrapper around IRBuilderBase.
  Essentially it only stores the folder and inserter and takes care
  of constructing the base builder.

What this patch doesn't do, but should be simple followups after this change:

* Fixing use of the inserter for creation methods originally defined
  on IRBuilderBase.
* Replacing IRBuilder<> uses in arguments with IRBuilderBase, where useful.
* Moving code from the IRBuilder header to the source file.

From the user perspective, these changes should be mostly transparent:
The only thing that consumers using a custom inserted may need to do is
inherit from IRBuilderDefaultInserter publicly and mark their InsertHelper
as public.

Differential Revision: https://reviews.llvm.org/D73835
2020-02-16 13:48:55 +01:00
Georgii Rymar
86793686ea [llvm-readobj] - Refactor the code that dumps relocations.
The current code has following issues:
1) It has a duplicated logic part.
2) This logic relies on unwrapOrError calls, but if we want to convert
   them to warnings, we will need to change all of them what is hard to do
   because of the duplication.

In this patch I've created a new method that returns Expected<> what allows
now to catch all errors in a single place and remove the code duplication.

Note: this change is itself a refactor NFC. It does not change the current logic
anyhow. It prepares the code for the follow-up(s).

Differential revision: https://reviews.llvm.org/D74545
2020-02-16 14:39:24 +03:00
Johannes Doerfert
0c3be93d04 [Attributor][FIX] Use pointer not reference as it can be null 2020-02-15 20:38:49 -06:00
Greg Clayton
0f9e8cbf13 [NFC] Move ValidTextRanges out of DwarfTransformer and into GsymCreator and unify address is not in GSYM errors so all strings match. 2020-02-15 16:48:23 -08:00
Simon Pilgrim
581191183a [X86] Add test cases showing failure to simplify target shuffles to bit shifts 2020-02-15 23:34:31 +00:00
Simon Pilgrim
fbb23f6a16 Fix Wdocumentation unknown parameter warnings. NFCI. 2020-02-15 23:33:17 +00:00
Simon Pilgrim
65f71cef2b [X86][AVX512] Split AVX512F and AVX512BW shuffle combining tests
Split off shuffle combine tests that use AVX512F intrinsics, so we can test it with/without AVX512BW support.
2020-02-15 22:48:52 +00:00
Fangrui Song
c5ceb65199 [X86][AsmPrinter] PrintSymbolOperand: prefer to lower ELF MO_GlobalAddress to .Lfoo$local 2020-02-15 13:45:29 -08:00
Florian Hahn
0c03d6c1a0 [ValueLattice] Update markConstantRange to return false equal ranges.
Currently we always return true, when markConstantRange is used on an
object already containing a constant range. If NewR is equal to the
existing constant range however, nothing changes and we should return
false.

I also went ahead and added a clarifying comment and improved the
assertion.

Reviewers: efriedma, davide, nikic

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D73240
2020-02-15 22:06:55 +01:00
Craig Topper
5dec6107a4 [X86] Merge two switches together to simplify some code. NFC 2020-02-15 12:55:51 -08:00
Craig Topper
d691bd34c9 [X86] Fix typo in comment. NFC 2020-02-15 12:48:19 -08:00
Simon Pilgrim
de7864d8a0 [X86] combineX86ShuffleChain - add support for combining to X86ISD::ROTLI
Refactors matchShuffleAsBitRotate to allow use by both lowerShuffleAsBitRotate and matchUnaryPermuteShuffle.
2020-02-15 20:04:54 +00:00
Florian Hahn
cbe8e4d716 [ValueLattice] Make mark* functions public, return if value changed.
This patch prepares ValueLatticeElement to be used by SCCP, by:
* making the mark* functions public
* make the mark* functions return a bool indicating if the value has changed.

Reviewers: efriedma, davide, mssimpso, nikic

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D60581
2020-02-15 20:54:58 +01:00
Simon Pilgrim
43c6ded458 [X86] Add test showing failure to combine shuffle to bit rotation 2020-02-15 19:23:00 +00:00
Craig Topper
3dabf9d8ed [X86] Move combineIncDecVector logic from Select to PreprocessISelDAG.
This allows it to work properly with masked inc/dec for avx512. Those
would have a vselect as the root node so didn't get a chance to call
combineIncDecVector.

This also simplifies the logic because we don't have to manage
the topological ordering.
2020-02-15 09:59:12 -08:00
Florian Hahn
61a834b1e0 Recommit "[SCCP] Remove forcedconstant, go to overdefined instead"
This includes a fix for cases where things get marked as overdefined in
ResolvedUndefsIn, but we later discover a constant. To avoid crashing,
we consistently bail out on overdefined values in the visitors. This is
similar to the previous behavior with forcedconstant.

This reverts the revert commit 02b72f564c8be0b4f4337d5c4a3fcf7e8018a818.
2020-02-15 18:36:44 +01:00
Fangrui Song
181d5382b7 [MC] De-capitalize MCStreamer::Emit{Bundle,Addrsig}* etc
So far, all non-COFF-related Emit* functions have been de-capitalized.
2020-02-15 09:11:48 -08:00
Simon Pilgrim
3f5216e7a4 Fix gcc9.2 -Winit-list-lifetime warning. NFCI.
Reported by @lbenes (Luke Benes)
2020-02-15 16:48:51 +00:00
Georgii Rymar
c2baa24e5c [obj2yaml] - Fix a -Wsign-compare warning gived by GCC 9.2
I was reported that with commit:
https://github.com/llvm/llvm-project/commit/d3963051c490

gcc-9.2 is giving the warning below.
This should help (I have no gcc 9.2 to test).

[ 57%] Building CXX object tools/obj2yaml/CMakeFiles/obj2yaml.dir/elf2yaml.cpp.o
/llvm/tools/obj2yaml/elf2yaml.cpp: In instantiation of ‘llvm::Expected<llvm::ELFYAML::Object*>
{anonymous}::ELFDumper<ELFT>::dump() [with ELFT = llvm::object::ELFType<llvm::support::little, false>]’:
/llvm/tools/obj2yaml/elf2yaml.cpp:1218:31:   required from ‘llvm::Error elf2yaml(llvm::raw_ostream&,
const llvm::object::ELFFile<ELFT>&) [with ELFT = llvm::object::ELFType<llvm::support::little, false>]’
/llvm/tools/obj2yaml/elf2yaml.cpp:1231:47:   required from here
/llvm/tools/obj2yaml/elf2yaml.cpp:207:41: warning: comparison of integer expressions of different
signedness: ‘llvm::support::detail::packed_endian_specific_integral<unsigned int, llvm::support::little, 1>::value_type’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
  207 |     if (!SymTab || SymTabShndx->sh_link != SymTab - Sections.begin())
/llvm/tools/obj2yaml/elf2yaml.cpp: In instantiation of ‘llvm::Expected<llvm::ELFYAML::Object*>
{anonymous}::ELFDumper<ELFT>::dump() [with ELFT = llvm::object::ELFType<llvm::support::big, false>]’:
...
2020-02-15 18:35:57 +03:00
Alexandre Ganea
2a2b6dfe5d [Support] In tests, fix warning: variable ‘Threads’ set but not used 2020-02-15 09:05:01 -05:00
Simon Pilgrim
66f957c5c7 Fix boolean/bitwise operator precedence warnings. NFCI. 2020-02-15 13:53:18 +00:00
Simon Pilgrim
26e0896acf [APInt] byteSwap - handle any whole byte bitwidth greater than 16-bits
As noted on D74621, the bswap intrinsic has a self imposed limitation that the type's bitwidth must be divisible by 16, but there's no reason that APInt::byteSwap must have the same limitation, given that it can already handle any byte width.
2020-02-15 13:27:06 +00:00
Pavel Iliin
e26f5e1a13 [AArch64][FIX] Correct register live range during pseudo expansion.
This commit fixes the broken tests after
commit b6a9fe209992789be3ed95664d25196361cfad34
on the expensive check builder:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-ubuntu/builds/2884
2020-02-15 12:16:56 +00:00
Simon Pilgrim
e7cae8e092 [APInt] byteSwap - simplify sub 64-bits cases to match general implementation. NFCI.
We can just byteSwap the entire uint64_t VAL and then shift down into place like we do for the multi-word case.
2020-02-15 12:16:14 +00:00
Simon Pilgrim
27b3f50fc2 [APInt] Add some procedural APInt::byteSwap unit tests
rGf0181cc7bac3 added specific tests up to i64, this adds a general loop to test some basic byte moves for larger APInts.
2020-02-15 11:58:10 +00:00
David Green
d40763588e [AArch64] Fixup kill flags on BSL generation
This hopefully fixes up the expensive checks bot.
2020-02-15 11:44:23 +00:00
Nico Weber
d41b688f21 [gn build] unbreak win build by removing flags that only work with a sysroot 2020-02-15 06:25:21 -05:00
Alexey Lapshin
4c1f969392 [Debuginfo][NFC] Remove usages of WithColor::error and WithColor::warning.
Summary:
This patch is extracted from D74308.

It patches all usages of WithColor::error() and WithColor::warning
in DebugInfoDWARF library.

Depends on D74481

Reviewers: jhenderson, dblaikie, probinson, aprantl, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74635
2020-02-15 14:18:45 +03:00
serge-sans-paille
011d0efc47 Fix standalone build interaction with compiler extension
As suggested in https://github.com/llvm/llvm-project/issues/120, don't try to
generate the extension file from clang, only do the linking step.

Fixes the regression introduced in D74464 when running cmake inside the clang
directory.

Differential Revision: https://reviews.llvm.org/D74602
2020-02-15 11:10:51 +01:00
Alexey Lapshin
d1dbbf13e4 [Debuginfo][NFC] Create common error handlers for DWARFContext.
Summary:
this review is extracted from D74308.

It creates two error handlers which allow to redefine error
reporting routine and should be used for all places
where errors are reported:

  std::function<void(Error)> RecoverableErrorHandler = defaultErrorHandler;
  std::function<void(Error)> WarningHandler = defaultWarningHandler;

It also creates accessors to above handlers which should be used to
report errors.

  function_ref<void(Error)> getRecoverableErrorHandler() {
    return RecoverableErrorHandler;
  }

  function_ref<void(Error)> getWarningHandler() { return WarningHandler; }

It patches all error reporting places inside DWARFContext and DWARLinker.

Reviewers: jhenderson, dblaikie, probinson, aprantl, JDevlieghere

Reviewed By: jhenderson, JDevlieghere

Subscribers: hiraditya, llvm-commits

Tags: #llvm, #debug-info

Differential Revision: https://reviews.llvm.org/D74481
2020-02-15 12:46:17 +03:00
Johannes Doerfert
795d2346ea [Attributor] Collect memory accesses with their respective kind and location
In addition to a single bit per memory locations, e.g., globals and
arguments, we now collect more information about the actual accesses,
e.g., what instruction caused it, was it a read/write/read+write, and
what the underlying base pointer was. Follow up patches will make
explicit use of this.

Reviewed By: uenoku

Differential Revision: https://reviews.llvm.org/D73527
2020-02-15 02:12:04 -06:00
Johannes Doerfert
47445cc212 [NFC] Revert unnecessary parts of b91c267380
In b91c267380 I accidentally introduced fixes that were not necessary
after 1a93285c686a. All but the `llvm_unreachable` are reverted again.
2020-02-15 01:38:58 -06:00
Johannes Doerfert
7d3a8bee8f [FIX] Order macros after D72304 2020-02-15 01:37:23 -06:00
Johannes Doerfert
f3fc31d93c [FIX] Remove warnings and UB after 1228d42ddab8 2020-02-15 01:15:45 -06:00
Fady Ghanim
cd1dadf1ae [OpenMP][OMPIRBuilder] Add Directives (master and critical) to OMPBuilder.
Add support for Master and Critical directive in the OMPIRBuilder. Both make use of a new common interface for emitting inlined OMP regions called `emitInlinedRegion` which was added in this patch as well.

Also this patch modifies clang to use the new directives when  `-fopenmp-enable-irbuilder` commandline option is passed.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D72304
2020-02-15 01:15:45 -06:00
Fangrui Song
13339a0dea [MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex} 2020-02-14 23:08:40 -08:00
Atmn Patel
c66b5fa601 [OpenMP][NFCI] Use the libFrontend DefaultKind in Clang
This swaps out the OpenMPDefaultClauseKind enum with a
llvm::omp::DefaultKind enum which is stored in OMPConstants.h.

This should not change any functionality.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D74513
2020-02-15 00:38:12 -06:00