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

150338 Commits

Author SHA1 Message Date
Craig Topper
996c15f14b [TargetLowering] Use ConstantSDNode::isOne and getSExtValue instead of getting the underlying APInt first. NFC
llvm-svn: 305604
2017-06-16 23:19:10 +00:00
Wei Mi
52f17fe913 Revert rL305578. There is still some buildbot failure to be fixed.
llvm-svn: 305603
2017-06-16 23:14:35 +00:00
Adrian Prantl
8ea051f3c8 Move testcase into the target-appropriate subdirectory.
llvm-svn: 305602
2017-06-16 23:02:05 +00:00
Adrian Prantl
fcd1037fbe Improve the accuracy of variable ranges .debug_loc location lists.
For the following motivating example
  bool c();
  void f();
  bool start() {
    bool result = c();
    if (!c()) {
      result = false;
      goto exit;
    }
    f();
    result = true;
  exit:
    return result;
  }

we would previously generate a single DW_AT_const_value(1) because
only the DBG_VALUE in the second-to-last basic block survived
codegen. This patch improves the heuristic used to determine when a
DBG_VALUE is available at the beginning of its variable's enclosing
lexical scope:

- Stop giving singular constants blanket permission to take over the
  entire scope. There is still a special case for constants in the
  function prologue that we also miight want to retire later.

- Use the lexical scope information to determine available-at-entry
  instead of proximity to the function prologue.

After this patch we generate a location list with a more accurate
narrower availability for the constant true value. As a pleasant side
effect, we also generate inline locations instead of location lists
where a loacation covers the entire range of the enclosing lexical
scope.

Measured on compiling llc with four targets this doesn't have an
effect on compile time and reduces the size of the debug info for llc
by ~600K.

rdar://problem/30286912

llvm-svn: 305599
2017-06-16 22:40:04 +00:00
Peter Collingbourne
ab0bdae718 utils: Add a git-r utility for mapping svn revisions to git revisions in the monorepo.
llvm-svn: 305598
2017-06-16 22:15:18 +00:00
Spyridoula Gravani
8bf6ce7a74 [DWARF] Corrected behavior for when no .apple_names section is present in the object.
The verifier should not output any message in such a case.
Added test case with no .apple_name section in the file to verify new functionality.
Made existing test case more specific.

llvm-svn: 305597
2017-06-16 22:03:21 +00:00
Eric Beckmann
3ec9bb7eb9 Clean up some things in the WindowsResource changes.
llvm-svn: 305596
2017-06-16 22:00:42 +00:00
Benjamin Kramer
4dab231cef [Object] Remove redundant std::move.
Found by -Wpessimizing-move.

llvm-svn: 305595
2017-06-16 21:27:12 +00:00
Eric Beckmann
9452ff37f8 Switch external cvtres.exe for llvm's own resource library.
In this patch, I flip the switch in DriverUtils from using the external
cvtres.exe tool to using the Windows Resource library in llvm.

I also fixed a bug where .rsrc sections were marked as discardable
memory and therefore were placed in the wrong order in the final PE.

Furthermore, I modified WindowsResource to write the coff directly to a
memory buffer instead of to file, also had it use the machine types
already declared in COFF.h instead creating my own enum.

Finally, I flipped the switch to allow all unit tests that had
previously run only on windows due to a winres dependency to run
cross-platform.

Reviewers: zturner, ruiu

Subscribers: llvm-commits, hiraditya

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

llvm-svn: 305592
2017-06-16 21:13:24 +00:00
Anna Thomas
05594a9b6d [InstCombine] Set correct insertion point for selects generated while folding phis
Summary:
When we fold vector constants that are operands of phi's that feed into select,
we need to set the correct insertion point for the *new* selects that get generated.
The correct insertion point is the incoming block for the phi.
Such cases can occur with patch r298845, which fixed folding of
vector constants, but the new selects could be inserted incorrectly (as the added
test case shows).

Reviewers: majnemer, spatel, sanjoy

Reviewed by: spatel

Subscribers: llvm-commits

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

llvm-svn: 305591
2017-06-16 21:08:37 +00:00
Evgeniy Stepanov
aeb7884ca0 Change YAML traits for vector<string> to flow_vector.
This is a workaround for an ODR conflict with the definition in
AMDGPUCodeObjectMetadata.cpp.

llvm-svn: 305584
2017-06-16 20:50:41 +00:00
Davide Italiano
71a085016e [SCCP] Simplify the code a bit. NFCI.
llvm-svn: 305583
2017-06-16 20:50:31 +00:00
Davide Italiano
6439eb0ad5 [SCCP] Clarify a comment about unhandled instructions.
llvm-svn: 305579
2017-06-16 20:27:17 +00:00
Wei Mi
f679f9ac2e [GVN] Recommit the patch "Add phi-translate support in scalarpre".
The recommit fixes two bugs: The first one is to use CurrentBlock instead of
PREInstr's Parent as param of performScalarPREInsertion because the Parent
of a clone instruction may be uninitialized. The second one is stop PRE when
CurrentBlock to its predecessor is a backedge and an operand of CurInst is
defined inside of CurrentBlock. The same value defined inside of loop in last
iteration can not be regarded as available.

Right now scalarpre doesn't have phi-translate support, so it will miss some
simple pre opportunities. Like the following testcase, current scalarpre cannot
recognize the last "a * b" is fully redundent because a and b used by the last
"a * b" expr are both defined by phis.

long a[100], b[100], g1, g2, g3;
__attribute__((pure)) long goo();

void foo(long a, long b, long c, long d) {

  g1 = a * b;
  if (__builtin_expect(g2 > 3, 0)) {
    a = c;
    b = d;
    g2 = a * b;
  }
  g3 = a * b;      // fully redundant.

}
The patch adds phi-translate support in scalarpre. This is only a temporary
solution before the newpre based on newgvn is available.

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

llvm-svn: 305578
2017-06-16 20:21:01 +00:00
Davide Italiano
fd35e65327 [SCCP] Remove redundant instruction visitors.
Whenever we don't know what to do with an instruction, we send
it to overdefined anyway.

llvm-svn: 305575
2017-06-16 19:43:57 +00:00
Spyridoula Gravani
311a94cdf7 [DWARF] Replaced mem-initializers with non-static data member initializers in DWARFVerifier class.
llvm-svn: 305570
2017-06-16 18:55:01 +00:00
Matthias Braun
120ef06239 Revert "RegScavenging: Add scavengeRegisterBackwards()"
Revert because of reports of some PPC input starting to spill when it
was predicted that it wouldn't and no spillslot was reserved.

This reverts commit r305516.

llvm-svn: 305566
2017-06-16 17:48:08 +00:00
Xinliang David Li
e1463564d2 Fix function name /NFC
llvm-svn: 305564
2017-06-16 16:54:13 +00:00
Craig Topper
09de50ef2e [InstCombine] Add test cases to show missed opportunities due to overly conservative single use checks. NFC
llvm-svn: 305562
2017-06-16 16:44:36 +00:00
Yonghong Song
a6c7bc9945 bpf: avoid load from read-only sections
If users tried to have a structure decl/init code like below
   struct test_t t = { .memeber1 = 45 };
It is very likely that compiler will generate a readonly section
to hold up the init values for variable t. Later load of t members,
e.g., t.member1 will result in a read from readonly section.

BPF program cannot handle relocation. This will force users to
write:
  struct test_t t = {};
  t.member1 = 45;
This is just inconvenient and unintuitive.

This patch addresses this issue by implementing BPF PreprocessISelDAG.
For any load from a global constant structure or an global array of
constant struct, it attempts to
translate it into a constant directly. The traversal of the
constant struct and other constant data structures are similar
to where the assembler emits read-only sections.

Four different unit test cases are also added to cover
different scenarios.

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 305560
2017-06-16 15:41:16 +00:00
Yonghong Song
0e4184c6b7 bpf: set missing types in insn tablegen file
o This is discovered during my study of 32-bit subregister
  support.
o This is no impact on current functionality since we
  only support 64-bit registers.
o Searching the web, looks like the issue has been discovered
  before, so fix it now.

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 305559
2017-06-16 15:30:55 +00:00
Daniel Neilson
88ff739fcf [Atomics] Rename and change prototype for atomic memcpy intrinsic
Summary:

Background: http://lists.llvm.org/pipermail/llvm-dev/2017-May/112779.html

This change is to alter the prototype for the atomic memcpy intrinsic. The prototype itself is being changed to more closely resemble the semantics and parameters of the llvm.memcpy intrinsic -- to ease later combination of the llvm.memcpy and atomic memcpy intrinsics. Furthermore, the name of the atomic memcpy intrinsic is being changed to make it clear that it is not a generic atomic memcpy, but specifically a memcpy is unordered atomic.

Reviewers: reames, sanjoy, efriedma

Reviewed By: reames

Subscribers: mzolotukhin, anna, llvm-commits, skatkov

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

llvm-svn: 305558
2017-06-16 14:43:59 +00:00
Simon Dardis
944a2897a6 Revert "[mips][microMIPS] Extending size reduction pass with ADDIUSP and ADDIUR1SP"
This reverts commit r305455. This commit was reported as breaking one of
the sanitizer buildbots. Reverting until lab.llvm.org comes back online.

llvm-svn: 305557
2017-06-16 14:00:33 +00:00
Krzysztof Parzyszek
877f78ec39 [TableGen] Do not assume that the first variant is the original pattern
The variant generation for commutative/associative patterns would simply
delete the first output from the list assuming that it was identical to
the original pattern. This does not have to be the case, and a legitimate
variant could actually be removed that way. 

llvm-svn: 305556
2017-06-16 13:44:34 +00:00
Krzysztof Parzyszek
22c3b372f0 [Hexagon] Don't kill live registers when creating mux out of tfr
The second part of r305300: when placing the mux at the later location,
make sure that it won't use any register that was killed between the
two original instructions. Remove any such kills and transfer them to
the mux.

llvm-svn: 305553
2017-06-16 12:24:03 +00:00
Hiroshi Inoue
186daa5345 [MachineBlockPlacement] trivial fix in comments, NFC
- Topologocal is abbreviated as "topo" in comments, but "top" is used in only one comment. Modify it for consistency.
- Capitalize "succ" and "pred" for consistency in one figure.
- Other trivial fixes.

llvm-svn: 305552
2017-06-16 12:23:04 +00:00
Craig Topper
1143a42e8a [InstCombine] Fold (!iszero(A & K1) & !iszero(A & K2)) -> (A & (K1 | K2)) == (K1 | K2) if K1 and K2 are a 1-bit mask
Summary: This is the demorganed version of the case we already handle for the OR of iszero.

Reviewers: spatel

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 305548
2017-06-16 05:10:37 +00:00
Rui Ueyama
e74563b0e7 Fix buildbots.
llvm-svn: 305542
2017-06-16 02:42:33 +00:00
Rui Ueyama
b17b435a35 Fix msan buildbot.
This patch should fix sanitizer-x86_64-linux-fast bot.

The problem was that the contents of this stream are aligned to 4 byte,
and the paddings were created just by incrementing `Offset`, so paddings
had undefined values. When the entire stream is written to an output,
it triggered msan.

llvm-svn: 305541
2017-06-16 02:17:35 +00:00
Craig Topper
d7e5c4ef0a [CorrelatedValuePropagation] Remove superfluous semicolon. NFC
llvm-svn: 305538
2017-06-16 01:53:20 +00:00
Eugene Zelenko
c6c564803c [BinaryFormat, Option, TableGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 305537
2017-06-16 00:43:26 +00:00
Evgeniy Stepanov
5dde3d6dc0 Fix build warning on 32-bit targets where sizeof(size_t) < sizeof(long long).
llvm-svn: 305535
2017-06-16 00:32:11 +00:00
Evgeniy Stepanov
286f104576 [cfi] CFI-ICall for ThinLTO.
Implement ControlFlowIntegrity for indirect function calls in ThinLTO.
Design follows the RFC in llvm-dev, see
https://groups.google.com/d/msg/llvm-dev/MgUlaphu4Qc/kywu0AqjAQAJ

llvm-svn: 305533
2017-06-16 00:18:29 +00:00
Zachary Turner
3ed15eeb87 [llvm-pdbutil] Add support for dumping cross module imports/exports.
llvm-svn: 305532
2017-06-16 00:04:24 +00:00
Zachary Turner
c17ab3eddf [llvm-pdbutil] Add a function for iterating over debug subsections.
NFC, just adds a helper function to reduce boilerplate.

llvm-svn: 305531
2017-06-15 23:59:56 +00:00
Xinliang David Li
ae9029243d [PartialInlining] Code Refactoring
This is a NFC code refactoring and interface cleanup. This paves the
way to enable outlining-only mode for the partial inliner.

llvm-svn: 305530
2017-06-15 23:56:59 +00:00
Zachary Turner
240abe68ab [llvm-pdbutil] Add support for dumping lines and inlinee lines.
llvm-svn: 305529
2017-06-15 23:56:19 +00:00
Zachary Turner
82c49846be Try to fix uninitialized read reported by msan.
llvm-svn: 305528
2017-06-15 23:44:19 +00:00
Ahmed Bougacha
71279ceee2 Revert "[DAG] Allow truncated and extend memory operations in Store Merge. NFCI."
This reverts commit r305468, as it caused PR33475.

llvm-svn: 305527
2017-06-15 23:29:47 +00:00
Zachary Turner
cc221d2ddd [llvm-pdbutil] Add back support for dumping file checksums.
When dumping module source files, also dump checksums.

llvm-svn: 305526
2017-06-15 23:12:41 +00:00
Tom Stellard
57022a74dc test-release.sh: Run the test-suite using phase3 clang
Summary: We were using the system compiler to run the test suite.

Reviewers: hansw

Subscribers: llvm-commits

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

llvm-svn: 305525
2017-06-15 23:05:21 +00:00
Zachary Turner
8eaa56ff25 [llvm-pdbutil] Add back the ability to dump hashes and index offsets.
This was regressed in a previous patch that re-wrote the dumper,
and I'm incrementally adding back the pieces that are missing.

llvm-svn: 305524
2017-06-15 23:04:42 +00:00
Alfred Huang
91a99ca4b8 [AMDGPU] Testing commit access only, no real change
llvm-svn: 305523
2017-06-15 23:02:55 +00:00
Matthias Braun
c273bf9f3a UnitTests: Followup to 305519
We have to use ASSERT_XXX instead of EXPECT_XXX if the test cannot
continue in the failure case.

llvm-svn: 305522
2017-06-15 22:50:57 +00:00
Kostya Serebryany
7ae6cd32d6 [libFuzzer] change the default max_len from 64 to 4096. This will affect cases where libFuzzer is run w/o initial corpus or with a corpus of very small items.
llvm-svn: 305521
2017-06-15 22:43:40 +00:00
Matthias Braun
0b1a4c3213 UnitTests: Replace some if(x)report_fatal_error() with EXPECT_TRUE(!x)
llvm-svn: 305519
2017-06-15 22:31:08 +00:00
Zachary Turner
8b022e96fb Resubmit "[llvm-pdbutil] rewrite the "raw" output style."
This resubmits commit c0c249e9f2ef83e1d1e5f166b50673d92f3579d7.

It was broken due to some weird template issues, which have
since been fixed.

llvm-svn: 305517
2017-06-15 22:24:24 +00:00
Matthias Braun
04697c0362 RegScavenging: Add scavengeRegisterBackwards()
Re-apply r276044/r279124. Trying to reproduce or disprove the ppc64
problems reported in the stage2 build last time, which I cannot
reproduce right now.

This is a variant of scavengeRegister() that works for
enterBasicBlockEnd()/backward(). The benefit of the backward mode is
that it is not affected by incomplete kill flags.

This patch also changes
PrologEpilogInserter::doScavengeFrameVirtualRegs() to use the register
scavenger in backwards mode.

Differential Revision: http://reviews.llvm.org/D21885

llvm-svn: 305516
2017-06-15 22:14:55 +00:00
Matthias Braun
3177034f73 docs/Phabricator: Better git examples to produce full context patches
llvm-svn: 305515
2017-06-15 22:09:30 +00:00
Craig Topper
c16b200865 [InstCombine] Add two FIXMEs for bad single use checks. NFC
llvm-svn: 305510
2017-06-15 21:38:48 +00:00