1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00
Commit Graph

173877 Commits

Author SHA1 Message Date
Florian Hahn
7e4de1d530 [SelectionDAG] Add getTokenFactor, which splits nodes with > 64k operands.
This functionality is required at multiple places which potentially
create large operand lists, like SelectionDAGBuilder or DAGCombiner.

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

llvm-svn: 351552
2019-01-18 14:05:59 +00:00
James Henderson
def6797df7 Add __[_[_]]Z demangling to new common demangle function
This is a follow-up to r351448. It adds support for other _*Z extensions
of the Itanium demanling, to the newly available demangle function
heuristic.

Reviewed by: erik.pilkington, rupprecht, grimar

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

llvm-svn: 351551
2019-01-18 13:58:41 +00:00
Dmitry Preobrazhensky
13885f924c [AMDGPU][MC] Disabled use of 2 different literals with SOP2/SOPC instructions
See bug 39319: https://bugs.llvm.org/show_bug.cgi?id=39319

Reviewers: artem.tamazov, arsenm, rampitec

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

llvm-svn: 351549
2019-01-18 13:57:43 +00:00
Pavel Labath
40e9380144 [ADT] Add streaming operators for llvm::Optional
Summary:
The operators simply print the underlying value or "None".

The trickier part of this patch is making sure the streaming operators
work even in unit tests (which was my primary motivation, though I can
also see them being useful elsewhere). Since the stream operator was a
template, implicit conversions did not kick in, and our gtest glue code
was explicitly introducing an implicit conversion to make sure other
implicit conversions do not kick in :P. I resolve that by specializing
llvm_gtest::StreamSwitch for llvm:Optional<T>.

Reviewers: sammccall, dblaikie

Reviewed By: sammccall

Subscribers: mgorny, dexonsmith, kristina, llvm-commits

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

llvm-svn: 351548
2019-01-18 12:52:03 +00:00
George Rimar
3b0a98a3a9 [llvm-objdump] - Dump the archive headers when -all-headers is specified.
When -all-headers is given it is supposed to dump all headers,
but now it skips the archive headers for no reason.

The patch fixes that.

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

llvm-svn: 351547
2019-01-18 12:01:59 +00:00
George Rimar
588ddb3054 [llvm-objdump] - Move getRelocationValueString and dependenices out of the llvm-objdump.cpp
getRelocationValueString is a dispatcher function that calls the
corresponding ELF/COFF/Wasm/MachO implementations
that currently live in the llvm-objdump.cpp file.

These implementations better be moved to ELFDump.cpp,
COFFDump.cpp and other corresponding files, to move platform specific
implementation out from the common logic.

The patch does that. Also, I had to move ToolSectionFilter helper
and SectionFilterIterator, SectionFilter to a header to make them
available across the objdump code.

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

llvm-svn: 351545
2019-01-18 11:33:26 +00:00
Dylan McKay
1eb0d37da4 [AVR] Fix codegen bug in 16-bit loads
Prior to this patch, the AVR::LDWRdPtr instruction was always lowered to
instructions of this pattern:

    ld  $GPR8, [PTR:XYZ]+
    ld  $GPR8, [PTR]+1

This has a problem; the [PTR] is incremented in-place once, but never
decremented.

Future uses of the same pointer will use the now clobbered value,
leading to the pointer being incorrect by an offset of one.

This patch modifies the expansion code of the LDWRdPtr pseudo
instruction so that the pointer variable is not silently clobbered in
future uses in the same live range.

Patch by Keshav Kini.

llvm-svn: 351544
2019-01-18 11:27:38 +00:00
George Rimar
98e561489f [llvm-objdump] - Show aliases in -help.
Currently llvm-objdump is inconsistent.

When -help is specified it shows no aliases except two.
Aliases are shown with -help-hidden though.
GNU objdump also prints them by default.

This patch does a change to always show all aliases
when -help is given.

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

llvm-svn: 351542
2019-01-18 10:41:26 +00:00
Dylan McKay
1b805babbc [AVR] Fix the inst-cbr test
Now that the CBR alias has lower priority than ANDI, the assembly
printer uses ANDI instead.

Original broken in r351526.

llvm-svn: 351539
2019-01-18 10:11:33 +00:00
Florian Hahn
e2a5fa9be9 [SelectionDAG] Add static getMaxNumOperands function to SDNode.
Summary:
Use this helper to make sure we use the same value at various places.
This will likely be needed at more places were we currently crash
because we use more operands than possible.

Also makes it easier to change in the future.

Reviewers: RKSimon, craig.topper, efriedma, aemerson

Reviewed By: RKSimon

Subscribers: hiraditya, arsenm, llvm-commits

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

llvm-svn: 351537
2019-01-18 10:00:38 +00:00
Clement Courbet
439811e0d3 Revert r351529 "[llvm-objdump][NFC] Improve readability."
Breaks labels-branch.s

llvm-svn: 351534
2019-01-18 09:40:19 +00:00
Clement Courbet
f2174f1846 [llvm-objdump][NFC] Improve readability.
Summary:
Introduce a `struct SectionSymbol` instead of
`tuple<uint64_t, StringRef, uint8>`.

Reviewers: jhenderson, davide

Subscribers: rupprecht, llvm-commits

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

llvm-svn: 351529
2019-01-18 08:59:39 +00:00
Shiva Chen
34fc0540d3 [ScheduleDAGRRList] Do not preschedule the node has ADJCALLSTACKDOWN parent
We should not pre-scheduled the node has ADJCALLSTACKDOWN parent,
or else, when bottom-up scheduling, ADJCALLSTACKDOWN and
ADJCALLSTACKUP may hold CallResource too long and make other
calls can't be scheduled. If there's no other available node
to schedule, the scheduler will try to rename the register by
creating copy to avoid the conflict which will fail because
CallResource is not a real physical register.

llvm-svn: 351527
2019-01-18 08:36:06 +00:00
Dylan McKay
8f21a8ed4d [AVR] Rewrite the CBRRdK instruction as an alias of ANDIRdK
The CBR instruction is just an ANDI instruction with the immediate
complemented.

Because of this, prior to this change TableGen would warn due to a
decoding conflict.

This commit fixes the existing compilation warning:

  ===============
  [423/492] Building AVRGenDisassemblerTables.inc...
  Decoding Conflict:
                  0111............
                  01..............
                  ................
          ANDIRdK 0111____________
          CBRRdK 0111____________
  ================

After this commit, there are no more decoding conflicts in the AVR
backend's instruction definitions.

Thanks to Eli F for pointing me torward `t2_so_imm_not` as an example of
how to perform a complement in an instruction alias.

Fixes BugZilla PR38802.

llvm-svn: 351526
2019-01-18 07:31:34 +00:00
Hsiangkai Wang
3f7e001ccd [CodeGen] Fix bugs in LiveDebugVariables when debug labels are generated.
Remove DBG_LABELs in LiveDebugVariables and generate them in
VirtRegRewriter.

This bug is reported in
https://bugs.chromium.org/p/chromium/issues/detail?id=898152.

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

llvm-svn: 351525
2019-01-18 07:17:09 +00:00
Dylan McKay
e48d05bbd3 [AVR] Expand 8/16-bit multiplication to libcalls on MCUs that don't have hardware MUL
This change modifies the LLVM ISel lowering settings so that
8-bit/16-bit multiplication is expanded to calls into the compiler
runtime library if the MCU being targeted does not support
multiplication in hardware.

Before this, MUL instructions would be generated on CPUs like the
ATtiny85, triggering a CPU reset due to an illegal instruction at
runtime.

First raised in https://github.com/avr-rust/rust/issues/124.

llvm-svn: 351523
2019-01-18 06:10:41 +00:00
Craig Topper
3146fe5763 [X86] Add test cases showing failure to fold a global variable address into the gather addressing mode when using the target specific intrinsics. NFC
llvm-svn: 351522
2019-01-18 06:06:03 +00:00
Craig Topper
83ae9bd056 [X86] Change avx512-gather-scatter-intrin.ll to use x86_64-unknown-unknown instead of x86_64-apple-darwin. NFC
Will help with an upcoming patch.

llvm-svn: 351521
2019-01-18 06:06:01 +00:00
Max Kazantsev
a525eb8670 Re-enable terminator folding in LoopSimplifyCFG: underlying bugs fixed
llvm-svn: 351520
2019-01-18 04:57:32 +00:00
Nico Weber
667cf61859 gn build: unbreak mac (and maybe win) after r351258, r351277
The check-hwasan build files assert that current_os == "linux" || current_os ==
"android", so pull it in only there.

ar is unused on mac, so don't set it in the stage2 toolchain. (It'd be nicer to
use llvm-libtool on mac instead of host libtool, but llvm-libtool doesn't seem
to understand the -no_warning_for_no_symbols flag.)

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

llvm-svn: 351519
2019-01-18 04:09:30 +00:00
Xing GUO
6f2e108ee1 [DOCS] it it => it
Summary: it it => it for LLVM Language Reference Manual

Reviewers: aaron.ballman, Higuoxing, liangdzou

Reviewed By: aaron.ballman, Higuoxing, liangdzou

Subscribers: Higuoxing, llvm-commits

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

llvm-svn: 351517
2019-01-18 03:56:37 +00:00
Nico Weber
0c94c23e35 gn build: Merge r351499
llvm-svn: 351516
2019-01-18 03:38:53 +00:00
Nico Weber
9264894fc9 mac: Correctly disable tools/lto tests when building with LLVM_ENABLE_PIC=OFF
llvm/tools sets LLVM_TOOL_LTO_BUILD to Off if LLVM_ENABLE_PIC=OFF, but that's
not visible in llvm/test.

r289662 added the llvm_tool_lto_build lit parameter, there the intent was to
use it with an explicit -DLLVM_TOOL_LTO_BUILD=OFF, which is visible globally.
On the review for that (D27739), a mild preference was expressed for using a
lit parameter over checking the existence of libLTO.dylib. Since that works
with the LLVM_ENABLE_PIC=OFF case too and since it matches what we do for the
gold plugin, switch to that approach.

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

llvm-svn: 351515
2019-01-18 03:36:04 +00:00
Thomas Lively
fa5fce0016 [WebAssembly] Add languages from debug info to producers section
Reviewers: aheejin, dschuff, sbc100

Subscribers: aprantl, jgravelle-google, hiraditya, sunfish

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

llvm-svn: 351507
2019-01-18 02:47:48 +00:00
Matt Arsenault
b652401abe AMDGPU: Convert tests away from llvm.SI.load.const
llvm-svn: 351494
2019-01-17 22:47:26 +00:00
Erik Pilkington
d472f3251b Address Ried's post-commit review comment on r351477.
llvm-svn: 351493
2019-01-17 22:39:31 +00:00
Vedant Kumar
0bb21ca263 [HotColdSplit] Allow outlining with live outputs
Prior to r348205, extracting code regions with live output values was
disabled because of a miscompilation (PR39433). Lift the restriction as
PR39433 has been addressed.

Tested on LNT+externals, on a run of check-llvm in a stage2 build, and
with a full build of iOS (with hot/cold splitting enabled).

As a drive-by, remove an errant TODO.

llvm-svn: 351492
2019-01-17 22:36:05 +00:00
Vedant Kumar
47f2b63f8c [HotColdSplit] Consider resume instructions to be cold
Resuming exception unwinding is roughly as unlikely as throwing an
exception.

Tested on LNT+externals (in particular, the C++ EH regression tests
provide end-to-end test coverage), as well as with a full build of iOS.

llvm-svn: 351491
2019-01-17 22:35:47 +00:00
Vladimir Stefanovic
e467c341aa [mips] Emit .reloc R_{MICRO}MIPS_JALR along with j(al)r(c) $25
The callee address is added as an optional operand (MCSymbol) in
AdjustInstrPostInstrSelection() and then used by asm printer to insert:
'.reloc tmplabel, R_MIPS_JALR, symbol
tmplabel:'.
Controlled with '-mips-jalr-reloc', default is true.

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

llvm-svn: 351485
2019-01-17 21:50:37 +00:00
Vedant Kumar
da5a9507e7 [HotColdSplit] Relax requirement that the cold sink block be extractable
Relaxing this requirement creates opportunities to split code dominated
by an EH pad.

Tested on LNT+externals.

llvm-svn: 351483
2019-01-17 21:42:36 +00:00
Erik Pilkington
6439489b4b [demangler] Support for block literals.
llvm-svn: 351482
2019-01-17 21:37:51 +00:00
Erik Pilkington
640017f2fc [demangler] Ignore leading underscores if present
On MacOS, symbols start with a leading underscore, so just parse and
ignore it if present.

llvm-svn: 351481
2019-01-17 21:37:36 +00:00
Vedant Kumar
dbf49926e4 [HotColdSplit] Simplify tests by lowering their splitting thresholds
This gets rid of the brittle/mysterious calls to @sink()/@sideeffect()
peppered throughout the test cases. They are no longer needed to force
splitting to occur.

llvm-svn: 351480
2019-01-17 21:29:34 +00:00
Erik Pilkington
35d624dbe5 Fix an MSVC bot failure from r351474.
llvm-svn: 351477
2019-01-17 20:52:10 +00:00
Wei Mi
294d0e5707 [SampleFDO] Skip profile reading when flattened profile used in ThinLTO postlink
If the sample profile has no inlining hierachy information included, we call
the sample profile is flattened. For flattened profile, in ThinLTO postlink
phase, SampleProfileLoader's hot function inlining and profile annotation will
do nothing, so it is better to save the effort to read in the profile and run
the sample profile loader pass. It is helpful for reducing compile time when
the flattened profile is huge.

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

llvm-svn: 351476
2019-01-17 20:48:34 +00:00
Reid Kleckner
b228dab57e [InstCombine] Don't sink dynamic allocas
Summary:
InstCombine's sinking algorithm only thinks about memory. It doesn't
think about non-memory constraints like stack object lifetime. It can
sink dynamic allocas across a stacksave call, which may be used with
stackrestore, which can incorrectly reduce the lifetime of the dynamic
alloca.

Fixes PR40365

Reviewers: hfinkel, efriedma

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 351475
2019-01-17 20:46:53 +00:00
Erik Pilkington
bb4d660781 NFC: Make the copies of the demangler byte-for-byte identical
With this patch, the copies of the files ItaniumDemangle.h,
StringView.h, and Utility.h are kept byte-for-byte in sync between
libcxxabi and llvm. All differences (namespaces, fallthrough, and
unreachable macros) are defined in each copies' DemanglerConfig.h.

This patch also adds a script to copy changes from libcxxabi
(cp-to-llvm.sh), and a README.txt explaining the situation.

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

llvm-svn: 351474
2019-01-17 20:37:51 +00:00
Sanjin Sijaric
19c7db09aa Fix the buildbot failure introduced by r351404
EXPENSIVE_CHECKS buildbots are failing due to r351404.

Add x1 as live in to the funclet basic block for SEH funclets, as well as
-verify-machineinstrs to the test case that triggered the failure.

llvm-svn: 351472
2019-01-17 20:24:14 +00:00
Nico Weber
a32a50a832 llvm build: Merge r351448
llvm-svn: 351469
2019-01-17 20:20:56 +00:00
Wouter van Oortmerssen
ada3982d76 [WebAssembly] Fixing 2 more symbol offset related tests.
llvm-svn: 351465
2019-01-17 19:18:05 +00:00
Jonas Devlieghere
e6b50eff1a [Test] Fix debug-loc-0.mir with EXPENSIVE_CHECKS
The `llc` invocation was missing `-start-before=machine-cp`.

llvm-svn: 351464
2019-01-17 18:35:14 +00:00
Wouter van Oortmerssen
9741215258 [WebAssembly] Fixed objdump not parsing function headers.
Summary:
objdump was interpreting the function header containing the locals
declaration as instructions. To parse these without injecting target
specific code in objdump, MCDisassembler::onSymbolStart was added to
be implemented by the WebAssembly implemention.

WasmObjectFile now returns a code offset for the "address" of a symbol,
rather than the index. This is also more in-line with what other
targets do.

Also ensured that the AsmParser correctly puts each function
in its own segment to enable this test case.

Reviewers: sbc100, dschuff

Subscribers: jgravelle-google, aheejin, sunfish, rupprecht, llvm-commits

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

llvm-svn: 351460
2019-01-17 18:14:09 +00:00
Rui Ueyama
e4b1fe66e6 Add a missing dependency to fix build.
llvm-svn: 351458
2019-01-17 17:55:47 +00:00
Teresa Johnson
e8cb930dbb Revert "[ThinLTO] Add summary entries for index-based WPD"
Mistaken commit of something still under review!

This reverts commit r351453.

llvm-svn: 351455
2019-01-17 16:05:04 +00:00
Teresa Johnson
e47bb6d8cf Add -dump-input=always to cfi-devirt test to debug flake
To help diagnose flaky bot failures in PR40351.

llvm-svn: 351454
2019-01-17 15:49:04 +00:00
Teresa Johnson
5b4ceacd72 [ThinLTO] Add summary entries for index-based WPD
Summary:
If LTOUnit splitting is disabled, the module summary analysis computes
the summary information necessary to perform single implementation
devirtualization during the thin link with the index and no IR. The
information collected from the regular LTO IR in the current hybrid WPD
algorithm is summarized, including:
1) For vtable definitions, record the function pointers and their offset
within the vtable initializer (subsumes the information collected from
IR by tryFindVirtualCallTargets).
2) A record for each type metadata summarizing the vtable definitions
decorated with that metadata (subsumes the TypeIdentiferMap collected
from IR).

Also added are the necessary bitcode records, and the corresponding
assembly support.

The index-based WPD will be sent as a follow-on.

Depends on D53890.

Reviewers: pcc

Subscribers: mehdi_amini, Prazek, inglorion, eraman, steven_wu, dexonsmith, arphaman, llvm-commits

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

llvm-svn: 351453
2019-01-17 15:49:03 +00:00
James Henderson
bd0abc721b [llvm-readobj][ELF]Add demangling support
This change adds demangling support to the ELF side of llvm-readobj,
under the switch --demangle/-C.

The following places are demangled: symbol table dumps (static and
dynamic), relocation dumps (static and dynamic), addrsig dumps, call
graph profile dumps, and group section signature symbols.

Although GNU readelf doesn't support demangling, it is still a useful
feature to have, and brings it on a par with llvm-objdump's
capabilities.

This fixes https://bugs.llvm.org/show_bug.cgi?id=40054.

Reviewed by: grimar, rupprecht

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

llvm-svn: 351450
2019-01-17 15:34:12 +00:00
James Henderson
ccbf0e437b Move demangling function from llvm-objdump to Demangle library
This allows it to be used in an upcoming llvm-readobj change.

A small change in internal behaviour of the function is to always call
the microsoftDemangle function if the string does not have an itanium
encoding prefix, rather than only if it starts with '?'. This is
harmless because the microsoftDemangle function does the same check
already.

Reviewed by: grimar, erik.pilkington

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

llvm-svn: 351448
2019-01-17 15:18:44 +00:00
Hans Wennborg
c466a75471 build_llvm_package.bat: Run more tests
llvm-svn: 351436
2019-01-17 13:11:15 +00:00
Max Kazantsev
790a9e98ac [LoopSimplifyCFG] Form LCSSA when a parent loop becomes a sibling
During the transforms in LoopSimplifyCFG, when we remove a dead exiting edge, the
parent loop may stop being reachable from the child loop, and therefore they become
siblings. If the former child loop had uses of some values from its former parent loop,
now such uses will require LCSSA Phis, even if they weren't needed before. So we must
form LCSSA for all loops that stopped being ancestors of the current loop in this case.

Differential Revision: https://reviews.llvm.org/D56144
Reviewed By: fedor.sergeev

llvm-svn: 351434
2019-01-17 12:51:10 +00:00