1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

168851 Commits

Author SHA1 Message Date
Max Kazantsev
187869ae5d [IndVars] Set Changed when we delete dead instructions. PR38855
IndVars does not set `Changed` flag when it eliminates dead instructions. As result,
it may make IR modifications and report that it has done nothing. It leads to inconsistent
preserved analyzes results.

Differential Revision: https://reviews.llvm.org/D51770
Reviewed By: skatkov

llvm-svn: 341633
2018-09-07 07:23:39 +00:00
Dean Michael Berris
1f415314f7 Revert "[XRay] Add a BlockVerifier visitor for FDR Records"
This reverts commit r341628.

llvm-svn: 341631
2018-09-07 03:38:26 +00:00
Craig Topper
48addd78bc [X86] Add more test cases for missed opportunities for using RMW form of ADC.
llvm-svn: 341630
2018-09-07 02:39:56 +00:00
Dean Michael Berris
073b6320d5 [XRay] Add a BlockVerifier visitor for FDR Records
Summary:
This patch implements a `BlockVerifier` type which enforces the
invariants of the log structure of FDR mode logs on a per-block basis.
This ensures that the data we encounter from an FDR mode log
semantically correct (i.e. that records follow the documented "grammar"
for FDR mode log records).

This is another part of the refactoring of D50441.

Reviewers: mboerger, eizan

Subscribers: mgorny, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D51723

llvm-svn: 341628
2018-09-07 02:25:06 +00:00
Craig Topper
e6d4f2885e [X86] Fix some incorrect comments. NFC
llvm-svn: 341624
2018-09-07 01:29:42 +00:00
Jordan Rupprecht
956764b736 [llvm-strip] -p test fix for windows buildbots
Windows ls prints dates as "1997-05-05" instead of "May 05 1997", so only check for a leading space.

llvm-svn: 341614
2018-09-07 00:28:54 +00:00
Puyan Lotfi
8d891f8b4a Revert: [llvm-objcopy] Dwarf .debug section compression (Second Attempt).
Various bots still fail for unknown reason.

llvm-svn: 341613
2018-09-07 00:28:25 +00:00
Zachary Turner
4c65b09db3 [PDB] Rename some files in the native reader.
By calling these NativeType<foo>.cpp, they will all be sorted
together, and it also distinguishes the types from the symbols.

llvm-svn: 341609
2018-09-07 00:12:56 +00:00
Zachary Turner
aea39f4276 [PDB] Create a SymbolCache class.
Part of the responsibility of the native PDB reader is to cache
symbols the first time they are accessed, so they can then be
looked up by an ID.  Furthermore, we need to resolve type indices
to records that we vend to the user, and other things.  Previously
this code was all thrown together a bit haphazardly in the native
session class, but it makes sense to collect all of this into a
single class whose sole responsibility is to manage the collection
of known symbols.

llvm-svn: 341608
2018-09-07 00:12:34 +00:00
Puyan Lotfi
5d0e793f5f [llvm-objcopy] Dwarf .debug section compression support (zlib, zlib-gnu).
Second Attempt. Alignment issues resolved. zlib::isAvailable() detected.

  Usage:

  llvm-objcopy --compress-debug-sections=zlib foo.o
  llvm-objcopy --compress-debug-sections=zlib-gnu foo.o

  In both cases the debug section contents is compressed with zlib. In the GNU
  style case the header is the "ZLIB" magic string followed by the uint64 big-
  endian decompressed size. In the non-GNU mode the header is the
  Elf(32|64)_Chdr.

  Decompression support is coming soon.

  Differential Revision: https://reviews.llvm.org/D49678

llvm-svn: 341607
2018-09-06 23:59:50 +00:00
Craig Topper
950e444c6c [X86] Add RMW ADC patterns with load in operand 1.
ADC is commutable and the load could be in either operand, but we were only checking operand 0.

Ideally we'd mark X86adc_flag as commutable and tablegen would automatically do this, but the EFLAGS register mention is preventing it.

llvm-svn: 341606
2018-09-06 23:55:36 +00:00
Craig Topper
a62685a203 [X86] Add a test case showing failure to use the RMW form of ADC when the load is in operand 1 going into isel.
The ADC instruction is commutable, but we only have RMW isel patterns with a load on the left hand side. Nothing will canonicalize loads to the LHS on these ops. So we need two patterns.

llvm-svn: 341605
2018-09-06 23:55:34 +00:00
Reid Kleckner
77eea16d51 Fix SampleProf code on LLP64 platforms with stoull
Otherwise, stoul will throw an out of range exception if the integer
doesn't fit in a 32-bit number.

llvm-svn: 341604
2018-09-06 23:35:58 +00:00
George Karpenkov
0381cf0c7f Provide a method for generating deterministic IDs for pointers allocated in BumpPtrAllocator
Differential Revision: https://reviews.llvm.org/D51393

llvm-svn: 341599
2018-09-06 23:07:05 +00:00
Zachary Turner
519caed47d Fix error with SmallString implicit conversion.
llvm-svn: 341597
2018-09-06 22:47:32 +00:00
Craig Topper
fd994630aa [X86] Add isel patterns for commuting X86adc_flag with a load in the LHS.
The peephole pass likely gets this normally, but we should be doing it during isel.

Ideally we'd just make the X86adc_flag pattern SDNPCommutable, but the tablegen doesn't handle that when one of the operands is a register reference.

llvm-svn: 341596
2018-09-06 22:41:44 +00:00
Jordan Rupprecht
6c6e54bf29 [llvm-strip] Fix -p test to check for explicit spaces around dates, to avoid when the filename happens to contain 1995/1997.
llvm-svn: 341595
2018-09-06 22:34:48 +00:00
Eric Christopher
c2b29240e0 The initial .text section generated in object files was missing the
SHF_ARM_PURECODE flag when being built with the -mexecute-only flag.
All code sections of an ELF must have the flag set for the final .text
section to be execute-only, otherwise the flag gets removed.

A HasData flag is added to MCSection to aid in the determination that
the section is empty. A virtual setTargetSectionFlags is added to
MCELFObjectTargetWriter to allow subclasses to set target specific
section flags to be added to sections which we then use in the ARM
backend to set SHF_ARM_PURECODE.

Patch by Ivan Lozano!

Reviewed By: echristo

Differential Revision: https://reviews.llvm.org/D48792

llvm-svn: 341593
2018-09-06 22:09:31 +00:00
Wei Mi
47a041af4c [SampleFDO] Make sample profile loader unaware of compact format change.
The patch tries to make sample profile loader independent of profile format
change. It moves compact format related code into FunctionSamples and
SampleProfileReader classes, and sample profile loader only has to interact
with those two classes and will be unaware of profile format changes.

The cleanup also contain some fixes to further remove the difference between
compactbinary format and binary format. After the cleanup using different
formats originated from the same profile will generate the same binaries,
which we verified by compiling two large server benchmarks w/wo thinlto.

Differential Revision: https://reviews.llvm.org/D51643

llvm-svn: 341591
2018-09-06 22:03:37 +00:00
Zachary Turner
9454b327ad Fix a configure issue with Visual Studio generators.
We can't put the unittest source dir map in the configuration
specific directory because VS doesn't have a configure-specific
directory, instead it only knows this at runtime.  So we have
to remove this from the path.  This in turn means that the path
will be slightly different in VS configurations vs non vs
configurations.  In the former, the source map will be in the
parent directory of the executable, and in the latter it will
be in the same directory as the executable.  So check both.

llvm-svn: 341590
2018-09-06 22:00:38 +00:00
Scott Linder
df9ff0813f Revert r341413
Causes a regression in expensive checks.

llvm-svn: 341589
2018-09-06 21:38:56 +00:00
Jessica Paquette
19d2f5bff7 Output per-function size-info remarks
This patch adds per-function size information remarks. Previously, passing
-Rpass-analysis=size-info would only give you per-module changes. By adding
the ability to do this per-function, it's easier to see which functions
contributed the most to size changes.

https://reviews.llvm.org/D51467

llvm-svn: 341588
2018-09-06 21:19:54 +00:00
Alina Sbirlea
03b4ddc5d2 [LoopPassManager] MemorySSA should be preserved when enabled.
llvm-svn: 341587
2018-09-06 20:54:24 +00:00
Fangrui Song
7bb04ea71c Reland rL341509: "[llvm-dwp] Use buffer_stream if output file is not seekable (e.g. "-")"
It caused ambiguity between llvm:🆑:Optional and llvm::Optional, which
has been fixed by dropping `using namespace cl;` in favor of explicit
cl:: qualified names.

llvm-svn: 341586
2018-09-06 20:26:54 +00:00
Fangrui Song
079fc4a7e9 [llvm-dwp] Use cl:: instead of using namespace cl
`using namespace cl` makes llvm:🆑:Optional (in Support/CommandLine.h) visible which will cause ambiguity when unqualified `Optional` is looked up (can also refer to llvm::Optional).

cl:: is used much more than `using namespace cl`, so let's not use the latter.

Also append \n to the argument of cl::ParseCommandLineOptions

llvm-svn: 341584
2018-09-06 20:23:34 +00:00
Fangrui Song
d396e39f0f Add missing #include for Testing/Support/SupportHelpers.h
llvm-svn: 341582
2018-09-06 20:01:06 +00:00
Tatyana Krasnukha
57f2fb1635 [ARC] Prevent InstPrinter from crashing on unknown condition codes.
Summary:
Instruction printer shouldn't crash with assertions due to incorrect input data. llvm_unreachable is not intended for runtime error handling.

Reviewers: petecoup

Reviewed By: petecoup

Differential Revision: https://reviews.llvm.org/D51728

llvm-svn: 341581
2018-09-06 19:58:26 +00:00
Fangrui Song
8d4e05f4f6 Quick fix for -DBUILD_SHARED_LIBS=on build after rL341502
libLLVMTestingSupport.so references a symbol in utils/unittest/UnitTestMain/TestMain.cpp (a layering issue) and will cause a link error because of -Wl,-z,defs (cmake/modules/HandleLLVMOptions.cmake)

Waiting zturner for a better fix.

llvm-svn: 341580
2018-09-06 19:51:20 +00:00
Lang Hames
ecf8dee5a3 [ORC] Make RuntimeDyldObjectLinkingLayer2 take memory managers by unique_ptr.
The existing memory manager API can not be shared between objects when linking
concurrently (since there is no way to know which concurrent allocations were
performed on behalf of which object, and hence which allocations would be safe
to finalize when finalizeMemory is called). For now, we can work around this by
requiring a new memory manager for each object.

This change only affects the concurrent version of the ORC APIs.

llvm-svn: 341579
2018-09-06 19:39:26 +00:00
Lang Hames
3468c2d4f3 [ORC] Remove the mapSectionAddress method from RuntimeDyldObjectLinkingLayer2.
Section address mappings can be applied using the RuntimeDyld instance passed to
the RuntimeDyld::MemoryManager::notifyObjectLoaded method. Proving an alternate
route via RuntimeDyldObjectLinkingLayer2 is redundant.

llvm-svn: 341578
2018-09-06 19:39:22 +00:00
Martin Storsjo
89b9151626 [llvm-ar] Move a variable declaration closer to where it is needed. NFC.
This was from a missed review comment from D51338.

llvm-svn: 341577
2018-09-06 19:03:24 +00:00
Sanjay Patel
e7e4be6cca [x86] add tests for pow --> cbrt; NFC
llvm-svn: 341575
2018-09-06 18:42:55 +00:00
Scott Linder
da7bdb784d Move init code in AArch64SelectionDAGTest to SetUpTestCase (NFC)
llvm-svn: 341574
2018-09-06 18:40:35 +00:00
Martin Storsjo
1d8b300a4a [llvm-ar] Support * as comment char in MRI scripts
MRI scripts have two comment chars, * and ;, but only the latter was
supported before.

Also allow leading spaces before comment chars (and before any command
string), and allow comments after a command.

Differential Revision: https://reviews.llvm.org/D51338

llvm-svn: 341571
2018-09-06 18:10:45 +00:00
Jonas Devlieghere
b6ac7f553d [dsymutil] Reduce peak memory usage for the single threaded execution.
Keeping the compile units in memory is expensive. For the single
threaded case we allocate them in the analyze part and deallocate them
again once we've finished cloning. This poses a problem in the single
threaded case where we did all the analysis first followed by all the
cloning. This meant we had all the link context in memory right after
analyzing finished.

This patch changes the way we order work in the single threaded case.
Instead of doing all the analysis and cloning in serial, we now
interleave the two so we can deallocate the memory as soon as a file is
processed. The result is binary identical and peak memory usage went
down from 13.43GB to 5.73GB for a debug build of trunk clang.

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

llvm-svn: 341568
2018-09-06 17:31:59 +00:00
Matt Arsenault
5f4f22dcf5 AMDGPU: Remove old hack for function addresses
llvm-svn: 341567
2018-09-06 17:23:24 +00:00
Michael Berg
2ec7b33d6f [NFC] - in preparation for adding nsw, nuw and exact as flags to MI
llvm-svn: 341565
2018-09-06 17:07:29 +00:00
Zachary Turner
ed4f869645 Fix a warning.
llvm-svn: 341561
2018-09-06 16:34:56 +00:00
Sanjay Patel
7acef232ba [InstCombine] add xor+not folds
This fold is needed to avoid a regression when we try
to recommit rL300977. 
We can't see the most basic win currently because 
demanded bits changes the patterns:
https://rise4fun.com/Alive/plpp

llvm-svn: 341559
2018-09-06 16:23:40 +00:00
JF Bastien
a500948b04 ARM64: improve non-zero memset isel by ~2x
Summary:
I added a few ARM64 memset codegen tests in r341406 and r341493, and annotated
where the generated code was bad. This patch fixes the majority of the issues by
requesting that a 2xi64 vector be used for memset of 32 bytes and above.

The patch leaves the former request for f128 unchanged, despite f128
materialization being suboptimal: doing otherwise runs into other asserts in
isel and makes this patch too broad.

This patch hides the issue that was present in bzero_40_stack and bzero_72_stack
because the code now generates in a better order which doesn't have the store
offset issue. I'm not aware of that issue appearing elsewhere at the moment.

<rdar://problem/44157755>

Reviewers: t.p.northover, MatzeB, javed.absar

Subscribers: eraman, kristof.beyls, chrib, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D51706

llvm-svn: 341558
2018-09-06 16:03:32 +00:00
Sanjay Patel
c5c033ac0c [InstCombine] add tests for xor-not; NFC
These tests demonstrate a missing fold that would
also be needed to avoid a regression when we try 
to recommit rL300977.

llvm-svn: 341557
2018-09-06 15:35:01 +00:00
Simon Pilgrim
a6ef8c1281 Remove unnecessary semicolon to silence -Wpedantic warning. NFCI.
llvm-svn: 341555
2018-09-06 15:15:28 +00:00
Alexander Potapenko
c01b469493 [MSan] store origins for variadic function parameters in __msan_va_arg_origin_tls
Add the __msan_va_arg_origin_tls TLS array to keep the origins for variadic function parameters.
Change the instrumentation pass to store parameter origins in this array.

This is a reland of r341528.

test/msan/vararg.cc doesn't work on Mips, PPC and AArch64 (because this
patch doesn't touch them), XFAIL these arches.
Also turned out Clang crashed on i80 vararg arguments because of
incorrect origin type returned by getOriginPtrForVAArgument() - fixed it
and added a test.

llvm-svn: 341554
2018-09-06 15:14:36 +00:00
Alex Bradbury
2b2d105ff9 [RISCV][NFC] Rework test/MC/RISCV/rv{32,64}* to allow testing of symbol operands
Standardise on check lines:
* CHECK-ASM
* CHECK-OBJ
* CHECK-ASM-AND-OBJ

This allows for the addition of tests involving symbol operands, which will
not result in identical instructions in both assembly and disassembled object 
output.

This commit doesn't exploit this reworking to increase test coverage of symbol
operands - that will come in a future patch.

llvm-svn: 341546
2018-09-06 13:41:04 +00:00
Sanjay Patel
4b83f1a634 [InstCombine] fix formatting in SimplifyDemandedVectorElts->Select; NFCI
I'm preparing to add the same functionality both here and to the DAG 
version of this code in D51696 / D51433, so try to make those cases 
as similar as possible to avoid bugs.

llvm-svn: 341545
2018-09-06 13:19:22 +00:00
Alexander Potapenko
77c2634f8a [MSan] revert r341528 to unbreak the bots
llvm-svn: 341541
2018-09-06 12:19:27 +00:00
Florian Hahn
601db38419 [LoopInterchange] Cleanup unused variables.
llvm-svn: 341537
2018-09-06 10:41:01 +00:00
Sven van Haastregt
0f0a07f963 Fix argument type in MachineInstr::hasPropertyInBundle
The MCID::Flag enumeration now has more than 32 items, this means that
the hasPropertyBundle argument 'Mask' can overflow.

This patch changes the argument to be 64 bits instead.

Patch by Mikael Nilsson.

Differential Revision: https://reviews.llvm.org/D51596

llvm-svn: 341536
2018-09-06 10:25:59 +00:00
Florian Hahn
e8c0bf5c66 [LoopInterchange] Move preheader creation to transform stage and simplify.
There is no need to create preheaders in the analysis stage, we only
need them when adjusting the branches. Also, the only cases we need to
create our own preheaders is when they have more than 1 predecessors or
PHI nodes (even with only 1 predecessor, we could have an LCSSA phi
node). I have simplified the conditions and added some assertions to be
sure. Because we know the inner and outer loop need to be tightly
nested, it is sufficient to check if the inner loop preheader is the
outer loop header to check if we need to create a new preheader.

Reviewers: efriedma, mcrosier, karthikthecool

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D51703

llvm-svn: 341533
2018-09-06 09:57:27 +00:00
Max Kazantsev
05bd508cf4 [NFC] Simplify inner structure of InstructionPrecedenceTracking
Currently it has a set KnownBlocks that marks blocks as having cached
answers and a map FirstSpecialInsts that maps these blocks to first
special instructions in them. The value in the map is always non-null,
and for blocks that are known to have no special instructions the map
does not have an instance.

This patch removes KnownBlocks as obsolete. Instead, for blocks that
are known to have no special instructions, we just put a nullptr value.
This makes the code much easier to read.

llvm-svn: 341531
2018-09-06 09:29:42 +00:00