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

156880 Commits

Author SHA1 Message Date
Vedant Kumar
96e5de6b03 [llvm-profdata] Fix a dangling reference to an error string
llvm-svn: 318502
2017-11-17 02:58:23 +00:00
Aditya Nandakumar
20bb22fbf9 [GISel]: DCE copy instructions during legalization
We might have instructions such as ext(copy(trunc)), and while cleaning
up legalization artifacts, we can also dce the copies that are in
between legalization artifacts.

llvm-svn: 318501
2017-11-17 02:44:55 +00:00
Vedant Kumar
98286d10ab [SelectionDAG] Consolidate (t|T)ransferDbgValues methods, NFC (reapply)
TransferDbgValues (capital 'T') is wired into ReplaceAllUsesWith, and
transferDbgValues (lowercase 't') is used elsewhere (e.g in Legalize).

Both functions should be doing the exact same thing. This patch
consolidates the logic into one place.

This was reverted in r318455 because some newly introduced asserts,
which I thought were NFC, were firing. I filed PR35338. For now I've
weakened the asserts.

Testing: check-llvm, check-clang, and a stage2 Rel+Deb build of clang

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

llvm-svn: 318498
2017-11-17 01:48:33 +00:00
Walter Lee
447cf74704 [asan] Test ASan instrumentation for shadow scale value of 5
Add additional RUN clauses to test for -asan-mapping-scale=5 in
selective tests, with special CHECK statements where needed.

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

llvm-svn: 318493
2017-11-17 01:15:31 +00:00
David Blaikie
e01dc73ad2 Fix a bunch more layering of CodeGen headers that are in Target
All these headers already depend on CodeGen headers so moving them into
CodeGen fixes the layering (since CodeGen depends on Target, not the
other way around).

llvm-svn: 318490
2017-11-17 01:07:10 +00:00
Zachary Turner
5cd7c2a1c3 Don't #include MemoryBuffer.h from Host.h.
It turns out this #include isn't used from Host.h anyway,
but by having it it causes circular include dependencies.
This issues only surfaced while I was working on a separate
patch, so I'm submitting this first so that it's independent
of the other, unrelated patch.

llvm-svn: 318489
2017-11-17 01:00:35 +00:00
Mandeep Singh Grang
feb35af5f1 [PredicateInfo] Add comment about why we require stable sort
llvm-svn: 318487
2017-11-17 00:43:24 +00:00
Zachary Turner
1d6366ddcf Re-revert "Refactor debuginfo-tests"
This is still broken because it causes certain tests to be
run twice with slightly different configurations, which is
wrong in some cases.

You can observe this by running:

  ninja -nv check-all | grep debuginfo-tests

And seeing that it passes clang/test and clang/test/debuginfo-tests
to lit, which causes it to run debuginfo-tests twice.  The fix is
going to involve either:

  a) figuring out that we're running in this "deprecated" configuration,
     and then deleting the clang/test/debuginfo-tests path, which should
     cause it to behave identically to before, or:
  b) make lit smart enough that it doesn't descend into a sub-suite if
     that sub-suite already has a lit.cfg file.

llvm-svn: 318486
2017-11-17 00:41:18 +00:00
Dmitry Mikulin
0ad04bbd7c Current implementation of Value::replaceUsesExceptBlockAddr() uses UseList
iterator to walk the list which keeps changing inside the loop. When the
UseList contains several uses with the same user, we end processing the same
user more than once, which leads to an assert.

With this fix, unique users are saved and processed later to avoid
processing duplicates.

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

llvm-svn: 318477
2017-11-17 00:30:24 +00:00
Yi Kong
c60ac51adb [ARM] 't' asm constraint should accept i32
't' constraint normally only accepts f32 operands, but for VCVT the
operands can be i32. LLVM is overly restrictive and rejects asm like:

  float foo() {
    float result;
    __asm__ __volatile__(
      "vcvt.f32.s32 %[result], %[arg1]\n"
      : [result]"=t"(result)
      : [arg1]"t"(0x01020304) );
    return result;
  }

Relax the value type for 't' constraint to either f32 or i32.

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

llvm-svn: 318472
2017-11-16 23:38:17 +00:00
Craig Topper
9cdf3fe9b9 [X86] Add DAG combine to remove sext i32->i64 from gather/scatter instructions.
Only do this pre-legalize in case we're using the sign extend to legalize for KNL.

This recovers all of the tests that changed when I stopped SelectionDAGBuilder from deleting sign extends.

There's more work that could be done here particularly to fix the i8->i64 test case that experienced split.

llvm-svn: 318468
2017-11-16 23:09:06 +00:00
Craig Topper
ac0978154e [X86] Add gather test with index sign extended from i8 type.
Previously SelectionDAGBuilder would remove this sign extend leading to a failure during isel.

The codegen here isn't very nice as we ended up triggering a split.

llvm-svn: 318467
2017-11-16 23:09:03 +00:00
Craig Topper
175cfd772a [X86] Don't remove sign extend of gather/scatter indices during SelectionDAGBuilder.
The sign extend might be from an i16 or i8 type and was inserted by InstCombine to match the pointer width. X86 gather legalization isn't currently detecting this to reinsert a sign extend to make things legal.

It's a bit weird for the SelectionDAGBuilder to do this kind of optimization in the first place. With this removed we can at least lean on InstCombine somewhat to ensure the index is i32 or i64.

I'll work on trying to recover some of the test cases by removing sign extends in the backend when its safe to do so with an understanding of the current legalizer capabilities.

This should fix PR30690.

llvm-svn: 318466
2017-11-16 23:08:57 +00:00
Lang Hames
cc650e79a6 [Support] Support NetBSD PaX MPROTECT in sys::Memory.
Removes AllocateRWX, setWritable and setExecutable from sys::Memory and
standardizes on allocateMappedMemory / protectMappedMemory. The
allocateMappedMemory method is updated to request full permissions for memory
blocks so that they can be marked executable later.

llvm-svn: 318464
2017-11-16 23:04:44 +00:00
David Blaikie
1e888f3ef2 Attempt to fix inscrutible build break...
llvm-svn: 318463
2017-11-16 22:40:02 +00:00
Zachary Turner
d88146d1b5 Fix some undefined beahvior in FileMapping.
This was broken when building a 32-bit native toolchain, as
shifting a size_t right by 32 is UB when sizeof(size_t) == 8.

llvm-svn: 318462
2017-11-16 22:39:55 +00:00
David Blaikie
8f207e5630 llvm-readobj/ARMEHABIPrinter.h: Make this a real/modular header
Had several non-inline/strong function definitions that needed to be
marked inline, etc.

llvm-svn: 318461
2017-11-16 22:30:36 +00:00
Rafael Espindola
db7cc4b840 Convert the last use of sys::fs::createUniqueFile in bugpoint.
llvm-svn: 318459
2017-11-16 21:53:51 +00:00
Rafael Espindola
cad5ba463c Convert another use of createUniqueFile to TempFile::create.
This one requires a new small feature in TempFile: the ability to keep
the temporary file with the temporary name.

llvm-svn: 318458
2017-11-16 21:40:10 +00:00
Petr Hosek
3c7e0ecc5e [CMake][runtimes] Use cmake_parse_arguments in runtimes functions
Passing lists to functions in CMake is tricky, any list argument
has to be quoted otherwise it'll be expanded. To avoid this issue,
use cmake_parse_arguments in runtime functions and pass lists using
a keyword argument which eliminates any ambiguity when dealing with
lists.

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

llvm-svn: 318457
2017-11-16 21:28:54 +00:00
Vedant Kumar
e9ef86732c Revert "[SelectionDAG] Consolidate (t|T)ransferDbgValues methods, NFC."
This reverts commit r318448. It looks like some of the asserts need to
be weakened.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/16296

llvm-svn: 318455
2017-11-16 21:08:51 +00:00
Mandeep Singh Grang
b72281613a [RISCV] Fix 64-bit data layout mismatch between backend and target description
Reviewers: asb

Reviewed By: asb

Subscribers: rbar, johnrusso, simoncook, jordy.potman.lists, llvm-commits

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

llvm-svn: 318454
2017-11-16 20:30:49 +00:00
Craig Topper
13ab19e610 [X86] Pre-truncate gather/scatter indices that have element sizes larger than 64-bits before Legalize.
The wider element type will normally cause legalize to try to split and scalarize the gather/scatter, but we can't handle that. Instead, truncate the index early so the gather/scatter node is insulated from the legalization.

This really shouldn't happen in practice since InstCombine will normalize index types to the same size as pointers.

llvm-svn: 318452
2017-11-16 20:23:22 +00:00
Craig Topper
8e9eafb64c [X86] DAGCombinerInfo is in TargetLowering not X86TargetLowering.
llvm-svn: 318451
2017-11-16 20:23:17 +00:00
Craig Topper
1021e0b04d [DAGCombiner] Use cast instead of an unchecked dyn_cast.
llvm-svn: 318450
2017-11-16 20:23:12 +00:00
Justin Bogner
733d507c5a llvm-objdump: Add missing requires for the test in r313921
This test needs an arm backend in addition to the arm64 one that's
already checked in the test directory.

llvm-svn: 318449
2017-11-16 20:20:56 +00:00
Vedant Kumar
645bd0cd75 [SelectionDAG] Consolidate (t|T)ransferDbgValues methods, NFC.
TransferDbgValues (capital 'T') is wired into ReplaceAllUsesWith, and
transferDbgValues (lowercase 't') is used elsewhere (e.g in Legalize).

Both functions should be doing the exact same thing. This patch
consolidates the logic into one place.

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

llvm-svn: 318448
2017-11-16 19:50:24 +00:00
Reid Kleckner
edf5cde5e0 Fix my typo of PDB_TableType
llvm-svn: 318447
2017-11-16 19:41:12 +00:00
Reid Kleckner
3dbc869dca Fix -Wreturn-type falling off the end of a function in new DIA code
llvm-svn: 318444
2017-11-16 19:32:53 +00:00
Daniel Sanders
205f900c36 [arc] Fix ambiguous overloaded operator error
lib/Target/ARC/ARCISelLowering.cpp:490:22: error: use of overloaded operator '<<' is ambiguous (with operand types 'llvm::raw_ostream' and 'llvm::MVT::SimpleValueType')
                     << RegVT.getSimpleVT().SimpleTy << "\n");
                     ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

llvm-svn: 318443
2017-11-16 19:16:56 +00:00
Yonghong Song
e8b3966318 bpf: print backward branch target properly
Currently, it prints the backward branch offset as unsigned value
like below:
       7:       7d 34 0b 00 00 00 00 00         if r4 s>= r3 goto 11 <LBB0_3>
       8:       b7 00 00 00 00 00 00 00         r0 = 0
LBB0_2:
       9:       07 00 00 00 01 00 00 00         r0 += 1
      ......
      17:       bf 31 00 00 00 00 00 00         r1 = r3
      18:       6d 32 f6 ff 00 00 00 00         if r2 s> r3 goto 65526 <LBB0_3+0x7FFB0>

The correct print insn 18 should be:
      18:       6d 32 f6 ff 00 00 00 00         if r2 s> r3 goto -10 <LBB0_2>

To provide better clarity and be consistent with kernel verifier output,
the insn 7 output is changed to the following with "+" added to
non-negative branch offset:
       7:       7d 34 0b 00 00 00 00 00         if r4 s>= r3 goto +11 <LBB0_3>

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 318442
2017-11-16 19:15:36 +00:00
Daniel Sanders
9fe1cdf16e [arc] Update TargetInfo to include the new backend name argument
Also update a comment about the usage of RegisterTarget() that didn't mention
the new argument.

llvm-svn: 318441
2017-11-16 19:10:26 +00:00
Kostya Serebryany
38d0d8cae2 [libFuzzer] add docs for -reduce_inputs
llvm-svn: 318439
2017-11-16 18:58:14 +00:00
Azharuddin Mohammed
0f17d7a34d Fix RISCV build after r318352
Reviewers: asb, apazos, mgrang

Reviewed By: mgrang

Subscribers: rbar, johnrusso, simoncook, jordy.potman.lists, llvm-commits

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

llvm-svn: 318437
2017-11-16 18:39:31 +00:00
Guozhi Wei
8114b623a7 [PPC] Change i32 constant in store instruction to i64
This patch changes all i32 constant in store instruction to i64 with truncation, to increase the chance that the referenced constant can be shared with other i64 constant.

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

llvm-svn: 318436
2017-11-16 18:27:34 +00:00
Zachary Turner
4c235f94ec Resubmit "Refactor debuginfo-tests"
This was reverted due to some failures on specific darwin buildbots,
the issue being that the new lit configuration was not setting the
SDKROOT environment variable.  We've tested a fix locally and confirmed
that it works, so this patch resubmits everything with the fix
applied.

llvm-svn: 318435
2017-11-16 18:26:20 +00:00
Dave Lee
e8a3b2bc92 Add ELF dynamic symbol support to yaml2obj/obj2yaml
Summary:
This change introduces a `DynamicSymbols` field to the ELF specific YAML
supported by `yaml2obj` and `obj2yaml`. This grouping of symbols provides a way
to represent ELF dynamic symbols. The `DynamicSymbols` structure is identical to
the existing `Symbols`.

Reviewers: compnerd, jakehehrlich, silvas

Reviewed By: silvas

Subscribers: silvas, jakehehrlich, llvm-commits

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

llvm-svn: 318433
2017-11-16 18:10:15 +00:00
Sanjay Patel
fb0fa312c4 [InstCombine] add tests for pow(); NFC
Also, increase test diversity (and show another bug) by varying the types.

llvm-svn: 318430
2017-11-16 17:49:54 +00:00
Rafael Espindola
7b14da3b51 make exitDsymutil static.
The objective is to remove it completelly.

This first patch removes the last use outside dsymutil.cpp and makes
it static.

llvm-svn: 318429
2017-11-16 17:46:43 +00:00
Dave Lee
df15563b5f Allow empty mappings for optional YAML input
Summary:
This change fixes a bug where `obj2yaml` can in some cases produce YAML that
causes `yaml2obj` to error.

The ELF YAML document structure has a `Sections` mapping, which contains three
mappings, all of which are optional: `Local`, `Global`, and `Weak.` Any one of
these can be missing, but if all three are missing, then `yaml2obj` errors. This
change allows YAML input for cases like this one.

I have tested this with check-llvm and check-lld, and all tests passed.

This change is the result of test failures while working on D39582, which
introduces a `DynamicSymbols` mapping, which will be empty at times.

Reviewers: compnerd, jakehehrlich, silvas, kledzik, mehdi_amini, pcc

Reviewed By: compnerd

Subscribers: silvas, llvm-commits

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

llvm-svn: 318428
2017-11-16 17:46:11 +00:00
Rafael Espindola
7e005d18fb Convert another use of createUniqueFile to TempFile::create.
llvm-svn: 318427
2017-11-16 17:35:50 +00:00
Aaron Smith
1cce544b4e [DebugInfo/PDB] Exclude the PDB/DIA files added in my previous commit from modulemap
llvm-svn: 318425
2017-11-16 17:24:49 +00:00
Sanjay Patel
185d87cc9a [InstCombine] add tests for 'afn' FMF; NFC
llvm-svn: 318423
2017-11-16 17:06:36 +00:00
Walter Lee
7805cc6517 [asan] Fix small X86_64 ShadowOffset for non-default shadow scale
The requirement is that shadow memory must be aligned to page
boundaries (4k in this case).  Use a closed form equation that always
satisfies this requirement.

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

llvm-svn: 318421
2017-11-16 17:03:00 +00:00
Sanjay Patel
68dab63007 [InstCombine] regenerate test checks; NFC
llvm-svn: 318420
2017-11-16 17:01:09 +00:00
Rafael Espindola
f461f8e9c8 Revert "[Support][CachePruning] Fix regression in pruning interval"
This reverts commit r318397.

It broke tools/gold/X86/cache.ll.

llvm-svn: 318419
2017-11-16 17:00:48 +00:00
Sanjay Patel
6d1a8c6fd5 [InstCombine] regenerate test checks; NFC
Also, remove some unnecessary bits. I don't think we need fcmp in any test here either?

llvm-svn: 318418
2017-11-16 16:59:49 +00:00
Sanjay Patel
3a2f99aa58 [InstCombine] regenerate test checks; NFC
llvm-svn: 318417
2017-11-16 16:38:42 +00:00
Sanjay Patel
d197340c48 [InstCombine] regenerate test checks; NFC
llvm-svn: 318416
2017-11-16 16:36:48 +00:00
Yaxun Liu
aeeb963599 Let llvm.invariant.group.barrier accepts pointer to any address space
llvm.invariant.group.barrier may accept pointers to arbitrary address space.

This patch let it accept pointers to i8 in any address space and returns
pointer to i8 in the same address space.

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

llvm-svn: 318413
2017-11-16 16:32:16 +00:00