Commit Graph

135496 Commits

Author SHA1 Message Date
Benjamin Kramer ffecbde8b3 [DemandedBits] Reduce number of duplicated DenseMap lookups.
No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276278 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 13:37:55 +00:00
Benjamin Kramer 1a324fd49a [DenseMap] Add a C++17-style try_emplace method.
This provides an elegant pattern to solve the "construct if not in map
already" problem we have many times in LLVM. Without try_emplace we
either have to rely on a sentinel value (nullptr) or do two lookups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276277 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 13:37:53 +00:00
Benjamin Kramer b11b3529ce Rename StringMap::emplace_second to try_emplace.
Coincidentally this function maps to the C++17 try_emplace. Rename it
for consistentcy with C++17 std::map. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276276 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 13:37:48 +00:00
Sam Kolton 50e9ffb710 [AMDGPU] Some code cleaning in SIRegisterInfo.td
Reviewers: tstellarAMD, vpykhtin

Subscribers: arsenm, kzhuravl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276274 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 13:29:57 +00:00
Marina Yatsina a264c851a4 ExecutionDepsFix - Fix bug in clearance calculation
The clearance calculation did not take into account registers defined as outputs or clobbers in inline assembly machine instructions because these register defs are implicit.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 12:37:07 +00:00
Benjamin Kramer 367e93b45c [GCOV] Remove a layer of indirection.
StringMap is designed to hold large values. No functionality change
intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276265 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 12:06:31 +00:00
Renato Golin e657dbc0c9 [docs] Update release docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276264 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 12:00:50 +00:00
Matt Arsenault a9994065f9 AMDGPU: Fix phis from blocks split due to register indexing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 09:40:57 +00:00
David Majnemer 00101d65c2 [GVNHoist] Preserve optimization hints which agree
If we have optimization hints with agree with each other along different
paths, preserve them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 07:16:26 +00:00
David Majnemer 2839fb67f7 [GVNHoist] Don't wrongly preserve TBAA
We hoisted loads/stores without taking into account which can cause
miscompiles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 05:59:53 +00:00
David Majnemer 724a2ec18a [MergedLoadStoreMotion] Remove out of date comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276239 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 05:59:51 +00:00
Amaury Sechet 83833ac566 Add missing import to fix the build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276237 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 04:31:38 +00:00
Amaury Sechet 8fad35613e Expose AttributeSetNode, use it to provide aggregate getter for attribute in the C API.
Summary: See D19181 for context.

Reviewers: whitequark, Wallbraker, jyknight, echristo, bkramer, void

Subscribers: mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 04:25:06 +00:00
Matthias Braun fc02f97363 IPRA: Fix RegMask calculation for alias registers
This patch fixes a very subtle bug in regmask calculation. Thanks to zan
jyu Wong <zyfwong@gmail.com> for bringing this to notice.
For example if CL is only clobbered than CH should not be marked
clobbered but CX, RCX and ECX should be mark clobbered. Previously for
each modified register all of its aliases are marked clobbered by
markRegClobbred() in RegUsageInfoCollector.cpp but that is wrong because
when CL is clobbered then MRI::isPhysRegModified() will return true for
CL, CX, ECX, RCX which is correct behavior but then for CX, EXC, RCX we
mark CH also clobbered as CH is aliased to CX,ECX,RCX so
markRegClobbred() is not required because isPhysRegModified already take
cares of proper aliasing register. A very simple test case has been
added to verify this change.
Please find relevant bug report here :
http://llvm.org/PR28567

Patch by Vivek Pandya <vivekvpandya@gmail.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276235 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 03:50:39 +00:00
Adam Nemet 20e71624df [OptDiag] Missed these when making the IR Value a const pointer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276224 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 01:11:12 +00:00
Adam Nemet 42a372e9b8 [OptDiag,LV] Add hotness attribute to applied-optimization remarks
Test coverage is provided by modifying the function in the FP-math
testcase that we are allowed to vectorize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 01:07:13 +00:00
Matthias Braun 956e0754db X86InstrInfo: No need for liveness analysis in classifyLEAReg()
classifyLEAReg() deals with switching operands from 32bit to 64bit in
order to use a LEA64_32 instruction (for three address code goodness).
It currently performs a liveness analysis to determine the kill/undef
flag for the newly added operand. This should not be necessary:

- If the previous operand had a kill flag, then the 32bit part of the
  register gets killed, this will kill the super register as well.
- If the previous operand had an undef flag then we didn't care what
  value we read, just use the same flag on the new operand.
  (No matter what an operand with an undef flag won't affect liveness)

This makes the code independent of the presence of kill flags because it
avoids a call to MachineBasicBlock::computeRegisterLiveness().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 00:33:38 +00:00
Sanjay Patel a2db716bbb [InstCombine] LogicOpc (zext X), C --> zext (LogicOpc X, C) (PR28476)
The benefits of this change include:
1. Remove DeMorgan-matching code that was added specifically to work-around 
   the missing transform in http://reviews.llvm.org/rL248634.
2. Makes the DeMorgan transform work for vectors too.
3. Fix PR28476: https://llvm.org/bugs/show_bug.cgi?id=28476

Extending this transform to other casts and other associative operators may
be useful too. See https://reviews.llvm.org/D22421 for a prerequisite for
doing that though.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276221 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-21 00:24:18 +00:00
Adam Nemet cebe016761 [OptDiag,LV] Add hotness attribute to the derived analysis remarks
This includes FPCompute and Aliasing.

Testcase is based on no_fpmath.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 23:50:32 +00:00
Sanjay Patel 4c8b3b4588 [InstSimplify][InstCombine] don't crash when folding vector selects of icmp
Differential Revision: https://reviews.llvm.org/D22602


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 23:40:01 +00:00
George Burgess IV 6b817ea4e2 Make help text more consistent. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276205 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 23:14:29 +00:00
Tim Northover cd887433f5 GlobalISel: Remove explicit enumerator values from .def file.
They were all auto-incremented from 0 anyway, and I'm getting really annoying
conflicts and runtime failures when different people add more for GlobalISel
(and even when I'm refactoring my own patches).

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 22:58:01 +00:00
Xinliang David Li a0113c20a0 Fix test failure on Win
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 22:53:39 +00:00
George Burgess IV 7a905f9108 [CFLAA] Add offset tracking in CFLGraph.
(Also, refactor our constexpr handling to be less insane).

This patch lets us track field offsets in the CFL Graph, which is the
first step to making CFLAA field/offset sensitive. Woohoo! Note that
this patch shouldn't visibly change our behavior (since we make no use
of the offsets we're now tracking), so we can't quite add tests for this
yet.

Patch by Jia Chen.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 22:53:30 +00:00
Vedant Kumar efcefc9206 [utils] Add script to check for code coverage regressions
Differential Revision: https://reviews.llvm.org/D22544

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276199 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 22:44:16 +00:00
Xinliang David Li 30a3883a4d Reapply r276185
Fix the test case that should not depend on dir iteration order.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276197 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 22:24:52 +00:00
Justin Lebar e1e21627c0 [NVPTX] Enable the load-store vectorizer on nvptx.
Reviewers: tra

Subscribers: jholewinski, arsenm, asbirlea

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 22:11:36 +00:00
Xinliang David Li 64865dfb7e Revert r276185 -- build bot failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:50:38 +00:00
Geoff Berry 265e1496c0 [AArch64] Register AArch64LoadStoreOptimizer so it can be run by llc -run-pass. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276193 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:45:58 +00:00
Adam Nemet 957976efe6 [OptDiag,LV] Add hotness attribute to analysis remarks
The earlier change added hotness attribute to missed-optimization
remarks.  This follows up with the analysis remarks (the ones explaining
the reason for the missed optimization).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:44:26 +00:00
Adam Nemet ef4767cee4 [OptDiag] Take the IR Value as a const pointer
This helps because LoopAccessReport is passed around as a const
reference and we derive the basic block passed as the Value parameter
from the instruction in LoopAccessReport.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:44:22 +00:00
Adam Nemet 9ce2fff872 [OptDiag] Wrap a long line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:44:18 +00:00
Artem Belevich 5001c928a7 [NVPTX] Renamed NVPTXLowerKernelArgs -> NVPTXLowerArgs. NFC.
After r276153 the pass applies to both kernels and regular functions.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276189 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:44:07 +00:00
Xinliang David Li d05d2538c7 [Profile] support directory reading in profile merging
Differential Revision:  http://reviews.llvm.org/D22560




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276185 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:31:29 +00:00
Tim Northover 6f08925c54 GlobalISel: implement Legalization querying framework.
This adds an (incomplete, inefficient) framework for deciding what to do with
some operation on a given type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:13:29 +00:00
Ahmed Bougacha 518182510a [AArch64][FastISel] Select -O0 legal cmpxchg.
At -O0, cmpxchg survives AtomicExpand: it's mostly straightforward
to select it in fast-isel, and let the pseudo be expanded later.

extractvalues on the result are the tricky part: the generic logic
only works for legal types (and it would be painful to make it
support illegal types), so we can only support i32/i64 cmpxchg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:12:32 +00:00
Ahmed Bougacha e212aa990b [AArch64][FastISel] Select atomic stores into STLR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:12:27 +00:00
David Majnemer 991d814755 [GVNHoist] Don't hoist PHI nodes
We hoisted PHIs without respecting their special insertion point in the
block, leading to verfier errors.

This fixes PR28626.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276181 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 21:05:01 +00:00
Davide Italiano c2a8447473 [SCCP] Zap multiple return values.
We can replace the return values with undef if we replaced all
the call uses with a constant/undef.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 20:17:13 +00:00
Justin Lebar 0cd5bfadb9 [LSV] Don't move stores across may-load instrs, and loosen restrictions on moving loads.
Summary:
Previously we wouldn't move loads/stores across instructions that had
side-effects, where that was defined as may-write or may-throw.  But
this is not sufficiently restrictive: Stores can't safely be moved
across instructions that may load.

This patch also adds a DEBUG check that all instructions in our chain
are either loads or stores.

Reviewers: asbirlea

Subscribers: llvm-commits, jholewinski, arsenm, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 20:07:37 +00:00
Justin Lebar 05fc242425 [LSV] Vectorize up to side-effecting instructions.
Summary:
Previously if we had a chain that contained a side-effecting
instruction, we wouldn't vectorize it at all.  Now we'll vectorize
everything that comes before the side-effecting instruction.

Reviewers: asbirlea

Subscribers: arsenm, jholewinski, llvm-commits, mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276170 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 20:07:34 +00:00
George Burgess IV bd986a7d74 [MSSA] Add an overload for getClobberingMemoryAccess.
A seemingly common use for the walker's getClobberingMemoryAccess
function is:

```
MemoryAccess *getClobber(MemorySSAWalker *W, MemoryUseOrDef *MUD) {
  const Instruction *I = MUD->getMemoryInst();
  return W->getClobberingMemoryAccess(I);
}
```

Which is kind of redundant, since walkers will ultimately query MSSA to
find out which MemoryAccess `I` maps to (...which is always `MUD`).

So, this patch adds an overload of getClobberingMemoryAccess that
accepts MemoryAccesses directly. As a result, the Instruction overload
of getClobberingMemoryAccess becomes a lightweight wrapper around our
new overload.

Additionally, this patch un`virtual`izes the Instruction overload of
getClobberingMemoryAccess, since there doesn't seem to be a walker that
benefits from that being virtual, and I can't think of how else one
would implement it. Happy to make it virtual again if we would benefit
from doing so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276169 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 19:51:34 +00:00
Rui Ueyama e30c989e49 [pdbdump] Use the "flow" style to print out a sequence of uint32_t.
Summary: Lists can be written either with "-" or "[]" in YAML.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 19:41:47 +00:00
Tim Northover 6d11357f4b GlobalISel: properly conditionalize LLT use.
We can't guard the include of LowLevelType.h because getType and setType are
(trivial) functions even when GlobalISel isn't built.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276160 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 19:17:29 +00:00
Tim Northover 4951996d06 GlobalISel: implement low-level type with just size & vector lanes.
This should be all the low-level instruction selection needs to determine how
to implement an operation, with the remaining context taken from the opcode
(e.g. G_ADD vs G_FADD) or other flags not based on type (e.g. fast-math).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276158 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 19:09:30 +00:00
Alina Sbirlea c5f802f164 Properly ifdef the use of cpuid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276156 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 18:54:26 +00:00
Artem Belevich 6de1b85db3 [NVPTX] deal with all aggregate return types.
Fixes a crash in llvm_unreachable when a function has array return type.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276154 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 18:39:52 +00:00
Artem Belevich 86d9bce726 [NVPTX] Improve lowering of byval args of device functions.
Avoid unnecessary spills of byval arguments of device functions to
local space on SASS level and subsequent pointer conversion to generic
address space that follows. Instead, make a local copy in IR, provide
a way to access arguments directly, and let LLVM optimize the copy away
when possible.

Differential Review: https://reviews.llvm.org/D21421

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276153 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 18:39:47 +00:00
Adam Nemet 5f9c124059 [OptDiag] Fix function comment
Function is not passed unlike in the original of this
(llvm::emitOptimizationRemarkMissed).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276150 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 18:16:45 +00:00
Alina Sbirlea e422546afb [cpu-detection] Cleanup of Host.cpp.
Summary:
Mirroring most cleanup changed from compiler-rt/lib/builtins/cpu_model.
x86 methods are still returning a bool.

Reviewers: llvm-commits, echristo, craig.topper, sanjoy

Subscribers: mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 18:15:29 +00:00