Commit Graph

130601 Commits

Author SHA1 Message Date
Mehdi Amini
12a3bb49b1 Use std::move on the enum to insert it into the pair to please MSVC
(I have no idea why is it needed)
Fixup for r267103

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267104 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 04:45:57 +00:00
Mehdi Amini
90c7bb067d Refactor IRObjectFile, extract a static CollectAsmUndefinedRefs() method to parse inline assembly (NFC)
I plan to call this from ThinLTOCodeGenerator.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267103 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 04:28:05 +00:00
Nicolai Haehnle
3441786e27 AMDGPU/SI: add llvm.amdgcn.ps.live intrinsic
Summary:
This intrinsic returns true if the current thread belongs to a live pixel
and false if it belongs to a pixel that we are executing only for derivative
computation. It will be used by Mesa to implement gl_HelperInvocation.

Note that for pixels that are killed during the shader, this implementation
also returns true, but it doesn't matter because those pixels are always
disabled in the EXEC mask.

This unearthed a corner case in the instruction verifier, which complained
about a v_cndmask 0, 1, exec, exec<imp-use> instruction. That's stupid but
correct code, so make the verifier accept it as such.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267102 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 04:04:08 +00:00
Craig Topper
758524fcea [AVX512] Teach lowering to use vplzcntd/q to implement 128/256-bit CTTZ_ZERO_UNDEF even without VLX support. We can just extend to 512-bits and extract like we do for CTLZ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267100 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 03:22:38 +00:00
Duncan P. N. Exon Smith
5ab1a4f5d9 ValueMapper/Enumerator: Clean up code in post-order traversals, NFC
Re-layer the functions in the new (i.e., newly correct) post-order
traversals in ValueEnumerator (r266947) and ValueMapper (r266949).
Instead of adding a node to the worklist in a helper function and
returning a flag to say what happened, return the node itself.  This
makes the code way cleaner: the worklist is local to the main function,
there is no flag for an early loop exit (since we can cleanly bury the
loop), and it's perfectly clear when pointers into the worklist might be
invalidated.

I'm fixing both algorithms in the same commit to avoid repeating the
commit message; if you take the time to understand one the other should
be easy.  The diff itself isn't entirely obvious since the traversals
have some noise (i.e., things to do), but here's the high-level change:

    auto helper = [&WL](T *Op) {     auto helper = [](T **&I, T **E) {
                                 =>    while (I != E) {
      if (shouldVisit(Op)) {             T *Op = *I++;
        WL.push(Op, Op->begin());        if (shouldVisit(Op)) {
        return true;                       return Op;
      }                                }
      return false;                    return nullptr;
    };                               };
                                 =>
    WL.push(S, S->begin());          WL.push(S, S->begin());
    while (!empty()) {               while (!empty()) {
      auto *N = WL.top().N;            auto *N = WL.top().N;
      auto *&I = WL.top().I;           auto *&I = WL.top().I;
      bool DidChange = false;
      while (I != N->end())
        if (helper(*I++)) {      =>    if (T *Op = helper(I, N->end()) {
          DidChange = true;              WL.push(Op, Op->begin());
          break;                         continue;
        }                              }
      if (DidChange)
        continue;

      POT.push(WL.pop());        =>    POT.push(WL.pop());
    }                                }

Thanks to Mehdi for helping me find a better way to layer this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267099 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 02:33:06 +00:00
Gerolf Hoflehner
7c23aa2d8c [MachineCombiner] Support for floating-point FMA on ARM64
Evaluates fmul+fadd -> fmadd combines and similar code sequences in the
machine combiner. It adds support for float and double similar to the existing
integer implementation. The key features are:

- DAGCombiner checks whether it should combine greedily or let the machine
combiner do the evaluation. This is only supported on ARM64.
- It gives preference to throughput over latency: the heuristic used is
to combine always in loops. The targets decides whether the machine
combiner should optimize for throughput or latency.
- Supports for fmadd, f(n)msub, fmla, fmls patterns
- On by default at O3 ffast-math



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267098 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 02:15:19 +00:00
Teresa Johnson
acfba51b27 [ThinLTO] Remove unused/incomplete lazy summary reading support (NFC)
This removes the interfaces added (and not yet complete) to support
lazy reading of summaries. This support is not expected to be needed
since we are moving to a model where the full index is only being
traversed in the thin link step, instead of the back ends.

(The second part of this that I plan to do next is remove the
GlobalValueInfo from the ModuleSummaryIndex - it was mostly needed to
support lazy parsing of summaries. The index can instead reference the
summary structures directly.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267097 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 01:52:00 +00:00
NAKAMURA Takumi
14eb0b531d Untabify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267096 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 01:33:50 +00:00
Nico Weber
b725c76f82 Try to fix UNRESOLVED: LLVM :: CodeGen/AArch64/arm64-regress-opt-cmp.s on bots.
This test used to write a .s file until r266971 fixed that.  But on most bots,
the .s file still exists.  Add an rm statement to clean up the bots.  In a few
days, this statement can go away again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267095 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 01:08:56 +00:00
Saleem Abdulrasool
817fdeb9cc ARM: fix test for Windows division
This was meant to be part of SVN r267080.  cbz cannot use a high register, which
would be silently truncated.  This has now been fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267092 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 01:03:38 +00:00
Dan Gohman
e0dd87a040 [WebAssembly] Limit alignment hints to natural alignment.
This follows the current binary format rules.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267082 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 23:59:48 +00:00
Saleem Abdulrasool
197563ef14 ARM: restrict register class for WIN__DBZCHK
WIN__DBZCHK will insert a CBZ instruction into the stream.  This instruction
reserves 3 bits for the condition register (rn).  As such, we must ensure that
we restrict the register to a low register.  Use the tGPR class instead of GPR
to ensure that this is properly constrained.  In debug builds, we would attempt
to use lr as a condition register which would silently get truncated with no
hint that the register selection was incorrect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267080 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 23:53:19 +00:00
Mike Aizatsky
aa724817e4 [sancov] using normalized filenames for blacklist checks.
Differential Revision: http://reviews.llvm.org/D19395

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267078 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 23:38:45 +00:00
David Blaikie
259641db60 Fix more -Wunused-variable in non-asserts build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267077 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 23:24:09 +00:00
Tim Northover
361618ec68 MachO: enable .data_region directives everywhere
We'd disabled them on x86 because back in the early days some host tools
couldn't handle the new load commands. This no longer holds: anyone capable of
deploying Clang should be able to deploy its copies of ar/ranlib/etc.

rdar://25254790

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267075 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 23:00:17 +00:00
David Blaikie
12098d3b4a Fix some -Wunused-variable warnings in non-asserts builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267073 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 22:53:33 +00:00
Vedant Kumar
a0a870ff27 [Support] Fix Wcast-qual warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267072 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 22:40:59 +00:00
Reid Kleckner
a1d19be01d Fix PDB warnings and test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267071 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 22:37:55 +00:00
Derek Schuff
4913b3f2cf Improve error message reporting for MachineFunctionProperties
When printing the properties required by a pass, only print the
properties that are set, and not those that are clear (only properties
that are set are verified, clear properties are "don't-care").

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 22:19:24 +00:00
Amaury Sechet
cfbb8a788e Remove dead code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267069 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 22:17:39 +00:00
Zachary Turner
46d5ec0afd Fix -Wreturn-type warning with HAVE_DIA_SDK is false.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267068 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 22:16:19 +00:00
Zachary Turner
9c2e16e35e Fix pdbdump-headers.test after guid format change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267067 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 22:13:25 +00:00
Zachary Turner
d192551402 Fix for case sensitive filename failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267066 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 22:08:27 +00:00
Mike Aizatsky
de4d323c44 Fixed flag description
Summary:
asan-use-after-return control feature we call use-after-return or
stack-use-after-return.

Reviewers: kcc, aizatsky, eugenis

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267064 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 22:00:13 +00:00
Amaury Sechet
48c9c5be8d Remove various warnings. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267061 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 21:36:11 +00:00
Derek Bruening
3494767094 [esan] EfficiencySanitizer instrumentation pass
Summary:
Adds an instrumentation pass for the new EfficiencySanitizer ("esan")
performance tuning family of tools.  Multiple tools will be supported
within the same framework.  Preliminary support for a cache fragmentation
tool is included here.

The shared instrumentation includes:
+ Turn mem{set,cpy,move} instrinsics into library calls.
+ Slowpath instrumentation of loads and stores via callouts to
  the runtime library.
+ Fastpath instrumentation will be per-tool.
+ Which memory accesses to ignore will be per-tool.

Reviewers: eugenis, vitalybuka, aizatsky, filcab

Subscribers: filcab, vkalintiris, pcc, silvas, llvm-commits, zhaoqin, kcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267058 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 21:30:22 +00:00
Amaury Sechet
b50527515a Add utility function to manipulate attributes on CallSite. NFC
Summary: As per title. This will help work on the C API.

Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267057 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 21:29:10 +00:00
Kevin Enderby
1164632966 Fix a typo in an error message. Caught by Sean Silva!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267056 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 21:20:40 +00:00
Vedant Kumar
089f755c04 [ProfileData] Report errors from InstrProfSymtab::create
InstrProfSymtab::create can fail with instrprof_error::malformed, but
this error is silently dropped. Propagate the error up to the caller so
we fail early.

Eventually, I'd like to transition ProfileData over to the new Error
class so we can't ignore hard failures like this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267055 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 21:07:25 +00:00
Sanjay Patel
bf8e161bd9 add tests for disguised fabs/fneg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267053 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 21:02:25 +00:00
Quentin Colombet
f2cd15729a [MachineBasicBlock] Make the pass argument truly mandatory when
splitting edges.

MachineBasicBlock::SplitCriticalEdges will crash if a nullptr would have
been passed for the Pass argument. Do not allow that by turning this
argument into a reference.
The alternative would have been to make the Pass a truly optional
argument, but although this is easy to do, I was afraid users using it
like this would not be aware the livness information, dominator tree and
such would silently be broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267052 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 21:01:13 +00:00
Sanjay Patel
d993f1c024 use FileCheck; add test for disguised fabs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267051 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 20:58:58 +00:00
Zachary Turner
6efffd31d2 Add natvis visualizers for endian types.
This allows ulittle* and ubig* types to be visualized properly
in VS.

Differential Revision: http://reviews.llvm.org/D19339
Reviewed By: Aaron Ballman

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 20:58:41 +00:00
Zachary Turner
ec474295eb Refactor raw pdb dumper into library
PDB parsing code was hand-rolled into llvm-pdbdump. This patch moves the
parsing of this code into DebugInfoPDB and makes the dumper use this.

This is achieved by implementing the skeleton of RawPdbSession, the
non-DIA counterpart to the existing PDB read interface. None of the type /
source file / etc information is accessible yet, so this implementation is
not yet close to achieving parity with the DIA counterpart, but the
RawSession class simply holds a reference to a PDBFile class which handles
parsing the file format. Additionally a PDBStream class is introduced
which allows accessing the bytes of a particular stream in a PDB file.

Differential Revision: http://reviews.llvm.org/D19343
Reviewed By: majnemer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 20:58:35 +00:00
Quentin Colombet
e4d168d65f [MachineBasicBlock] Refactor SplitCriticalEdge to expose a query API.
Introduce canSplitCriticalEdge, so that clients can now query whether or
not a critical edge can be split without actually needing to split it.
This may be useful when gathering information for cost models for
instance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267046 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 20:46:27 +00:00
Kevin Enderby
c7e7d3290e hange the variable name big_size to BigSize. Caught by Rafael Espíndola!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267043 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 20:29:49 +00:00
Andrew Kaylor
7c699fb008 Zero-initialize members of the CpuHashInfoTy structure for AsmParser
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267042 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 20:09:35 +00:00
Lang Hames
484ff8d53d [RuntimeDyld] Fix conservative over-allocation of memory for common symbols.
The previous allocation code was over-estimating the amount of memory required.

No test case: we don't currently have a good way to detect conervative
over-allocation.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267041 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 20:08:06 +00:00
JF Bastien
8f964ad73a NFC: fix copy / paste comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267039 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 19:53:39 +00:00
Krzysztof Parzyszek
ad7d56b336 [Hexagon] Properly recognize register alt names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267038 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 19:49:53 +00:00
Kevin Enderby
13eabc323f Fix crash in llvm-objdump with -macho -objc-meta-data that was trying dump a non-existent section.
Showed up in running on a large binary with the missing section.  I could create a fake
test case if anyone really wants but the fix is pretty obvious.

rdar://25837034


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267037 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 19:49:29 +00:00
JF Bastien
372b2d6464 NFC: fix nonsensical comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 19:41:48 +00:00
Sanjoy Das
80fd5b26e3 Folding compares with unescaped allocations
Summary:
If we know that the pointer allocated within a function does not escape,
we can fold away comparisons that are done with global pointers

Patch by Anna Thomas!

Reviewers: reames, majnemer, sanjoy

Subscribers: mgrang, mcrosier, majnemer, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267035 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 19:26:45 +00:00
Krzysztof Parzyszek
c552ed7f63 [Hexagon] Expand handling of the small-data/bss section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267034 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 18:56:45 +00:00
Quentin Colombet
0e156ed701 [RegisterBankInfo] Change the API for the verify methods.
Return bool instead of void so that it is natural to put the calls into
asserts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 18:34:43 +00:00
Matt Arsenault
4ec85d0131 AMDGPU: Fix debug name of pass to better match
I get this wrong every time I try to debug this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267030 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 18:21:54 +00:00
Matt Arsenault
193934bd68 LegalizeDAG: Move unaligned load/store expansion to TLI
When custom lowered, this is not called if the store is custom
lowered. Move it to be a utility function so targets can
easily expand unaligned accesses when custom lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267029 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 18:19:11 +00:00
Quentin Colombet
99b0ca43ae [RegisterBankInfo] Change the representation of the partial mappings.
Instead of holding a mask, hold two value: the start index and the
length of the mapping. This is a more compact representation, although
less powerful. That being said, arbitrary masks would not have worked
for the generic so do not allow them in the first place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267025 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 18:09:34 +00:00
Matt Arsenault
88c88b2b19 DAGCombiner: Reduce 64-bit BFE pattern to pattern on 32-bit component
If the extracted bits are restricted to the upper half or lower half,
this can be truncated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 18:03:06 +00:00
Philip Reames
43a1464ccf [instcombine][unordered] Extend load(select) transform to handle unordered loads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267023 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 17:59:40 +00:00