Commit Graph

113113 Commits

Author SHA1 Message Date
Benjamin Kramer
a54b82a9fe ValueTracking: Make isBytewiseValue simpler and more powerful at the same time.
Turns out there is a simpler way of checking that all bytes in a word are equal
than binary decomposition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228503 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 19:29:02 +00:00
Bjorn Steinbrink
2dd5f23a1d Properly update AA metadata when performing call slot optimization
Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228500 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 17:54:36 +00:00
Jonathan Roelofs
f516614e8a Fix docs typo regarding lit.local.cfg files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228499 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 17:18:26 +00:00
Ahmed Bougacha
9c252165a7 [BasicAA] Try to disambiguate GEPs through arrays of structs into
different fields.

We can show that two GEPs off of the same (possibly multidimensional)
array of structs, into different fields, can't alias.  Quoting:

For two GEPOperators GEP1 and GEP2, if we find that:
- both GEPs begin indexing from the exact same pointer;
- the last indices in both GEPs are constants, indexing into a struct;
- said indices are different, hence,the pointed-to fields are different;
- and both GEPs only index through arrays prior to that;

this lets us determine that the struct that GEP1 indexes into and the
struct that GEP2 indexes into must either precisely overlap or be
completely disjoint.  Because they cannot partially overlap, indexing
into different non-overlapping fields of the struct will never alias.

The other BasicAA::aliasGEP rules worked in some cases, but not all
(for example, the i32x3 struct in the testcase).
We can add this simple ad-hoc rule to complement them.

rdar://19717375
Differential Revision: http://reviews.llvm.org/D7453


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228498 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 17:04:29 +00:00
Benjamin Kramer
0e0271af87 SCEV: Compress disposition pairs.
Composing DenseMaps and SmallVectors is still somewhat suboptimal,
but this at least halves the size of the vector elements. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228497 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 16:41:12 +00:00
Benjamin Kramer
ff53b757ea SmallVector: Move emplace_back to SmallVectorImpl.
This resolves the strange effect that emplace_back is only available
when the type contained in the vector is not trivially copyable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228496 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 16:41:02 +00:00
Simon Pilgrim
3281412d2a [X86] Force fp stack folding tests to keep to specific domain.
General boolean instructions (AND, ANDN, OR, XOR) need to use a specific domain instruction (and not just the default).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228495 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 16:14:55 +00:00
Simon Pilgrim
bf4a435d0a [X86][AVX2] More AVX2 integer stack folding tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228494 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 16:07:27 +00:00
Andrea Di Biagio
0e0dfd99f9 Fix typos; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228493 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 13:56:20 +00:00
Benjamin Kramer
74cdff870f Move DebugLocs around instead of copying.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228491 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 12:28:15 +00:00
David Majnemer
fdac306a12 MC: Emit COFF section flags in the "proper" order
COFF section flags are not idempotent:
  'rd' will make a read-write section because 'd' implies write
  'dr' will make a read-only section because 'r' disables write

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228490 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 08:26:40 +00:00
Chandler Carruth
7e940c4725 Consistently use override rather than virtual.
This fixes -Winconsistent-missing-override warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228489 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 08:12:22 +00:00
Hal Finkel
05bd43dc6e [PowerPC] Handle loop predecessor invokes
If a loop predecessor has an invoke as its terminator, and the return value
from that invoke is used to determine the loop iteration space, then we can't
insert a computation based on that value in the loop predecessor prior to the
terminator (oops). If there's such an invoke, or just no predecessor for that
matter, insert a new loop preheader.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228488 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 07:32:58 +00:00
Bruce Mitchener
8143b4da3f Add more DWARF 5 language constants.
Differential Revision: http://reviews.llvm.org/D7430

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228487 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 06:35:30 +00:00
Zachary Turner
6a03769d1c Change RHS-style decltype to LHS-style decltype<declval()>.
Seems some compilers don't like the RHS-style decltype specifier.

This should fix the buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228484 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 02:02:23 +00:00
Zachary Turner
d0898f1565 Resubmit unittests for DebugInfoPDB.
These were originally submitted as part of r228428, but this part
caused a build breakage in LLVMConfig.  The library portion was
resubmitted independently since it was not causing breakage.

There were two reasons this was causing the build to fail.  The
first is that there were no Makefiles added for the PDB tests.  And
the second is that the DebugInfoPDB library was only being built by
CMake behind an "if (MSVC)" check.  This is wrong since this the
library hides platform specific details, and it was causing
LLVM-Config to not find the library when trying to build unittests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228482 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 01:47:14 +00:00
Sean Silva
cd04094266 [docs][LLVM-style RTTI] Add a mention of multiple inheritance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228479 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 01:16:26 +00:00
Duncan P. N. Exon Smith
f28bf6c7aa Support: Fix tests for VirtualityString
Since these `dwarf` functions return `const char *`, the tests need to
use `StringRef` for checks.  Should fix, e.g., hexagon [1].

[1]: http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/22435

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228478 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 01:07:30 +00:00
Duncan P. N. Exon Smith
5a504d487c Support: Add dwarf::getVirtuality()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228474 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 00:37:15 +00:00
Duncan P. N. Exon Smith
a496490358 Support: Use Dwarf.def for DW_VIRTUALITY, NFC
Use definition file for `DW_VIRTUALITY_*`.  Add a `DW_VIRTUALITY_max`
both for ease of testing and for future use by the `LLParser`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228473 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-07 00:36:23 +00:00
Duncan P. N. Exon Smith
e29c334dd4 Support: Add dwarf::getAttributeEncoding()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228470 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:46:49 +00:00
Duncan P. N. Exon Smith
87c9a125d8 Support: Rewrite AttributeEncodingString(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228469 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:45:37 +00:00
Duncan P. N. Exon Smith
f0d7e8a1b8 Support: Stop stringifying DW_ATE_{lo,hi}_user
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228468 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:44:24 +00:00
Hal Finkel
9ce4011708 [PowerPC] Fixup incomplete revert of test/CodeGen/PowerPC/tls-pic.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228467 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:30:06 +00:00
Lang Hames
2db85d688d [Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-irgen.
This tutorial builds on the lazy_codegen kaleidoscope/orc tutorial by making
a small set of changes (~75 lines diff) to defer ir-generation for function
definitions until functions are actually referenced.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228466 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:26:33 +00:00
Kevin Enderby
4e96e52cbe Add code to llvm-objdump so the -section option with -macho will dump literal
sections with the Mach-O S_{4,8,16}BYTE_LITERALS section types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228465 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:25:38 +00:00
Ahmed Bougacha
8650883afb [AArch64] Use the source location of the IR branch when creating Bcc
from a conditional branch fed by an add/sub/mul-with-overflow node.

We previously used the SDLoc of the overflow node, for no good reason.
In some cases, this led to the Bcc and B terminators having different
source orders, and DBG_VALUEs being inserted between them.

The real issue is with the code that can't handle DBG_VALUEs between
terminators: the few places affected by this will be fixed soon.
In the meantime, fixing the SDLoc is a positive change no matter what.

No tests, as I have no idea how to get .loc emitted for branches?

rdar://19347133


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228463 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:15:39 +00:00
Simon Pilgrim
148482dd6b [X86][AVX2] Begun adding AVX2 integer stack folding tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228462 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:12:15 +00:00
Hal Finkel
9168f717c9 Revert "r227976 - [PowerPC] Yet another approach to __tls_get_addr" and related fixups
Unfortunately, even with the workaround of disabling the linker TLS
optimizations in Clang restored (which has already been done), this still
breaks self-hosting on my P7 machine (-O3 -DNDEBUG -mcpu=native).

Bill is currently working on an alternate implementation to address the TLS
issue in a way that also fully elides the linker bug (which, unfortunately,
this approach did not fully), so I'm reverting this now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228460 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:07:40 +00:00
Lang Hames
ead6da39e9 [Orc] Add a Kaleidoscope/Orc tutorial demonstrating lazy-codegen.
This tutorial builds on the initial kaleidoscope/orc tutorial by adding a
LazyEmittingLayer to the custom stack. This extra layer defers compilation
of modules in the JIT until they are statically referenced.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228459 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 23:04:53 +00:00
Duncan P. N. Exon Smith
81bb18728b Support: Add dwarf::getLanguage()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228458 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:55:13 +00:00
Duncan P. N. Exon Smith
e0916cdbc4 Support: Rewrite dwarf::LanguageString(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228457 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:53:19 +00:00
Lang Hames
eddb26303b [Orc] Add a Kaleidoscope tutorial for Orc demonstrating eager compilation.
This tutorial demonstrates a very basic custom Orc JIT stack that performs eager
compilation: All modules are CodeGen'd immediately upon being added to the JIT.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228456 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:52:04 +00:00
Duncan P. N. Exon Smith
8713d99a25 IR: Allow 32-bits for lines in debug location
Remove unnecessary restriction of 24-bits for line numbers in
`MDLocation`.

The rest of the debug info schema (with the exception of local
variables) uses 32-bits for line numbers.  As I introduce the
specialized nodes, it makes sense to canonicalize on one size or the
other.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228455 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:50:13 +00:00
Lang Hames
4752dabe97 [Orc] Add more missing headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228454 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:48:43 +00:00
Sanjay Patel
af0a07822e use local variables; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228452 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:43:52 +00:00
Duncan P. N. Exon Smith
42f3b502ce Support: Stop stringifying DW_LANG_{lo,hi}_user
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228451 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:34:48 +00:00
Duncan P. N. Exon Smith
d4d3a4313e AsmParser: Use DW_TAG_hi_user instead of magic constant, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228448 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:29:35 +00:00
Duncan P. N. Exon Smith
ab2855852e AsmWriter: Extract writeTag(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228447 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:28:05 +00:00
Duncan P. N. Exon Smith
8b07f1bd5f AsmWriter: Extract writeMetadataAsOperand(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228446 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 22:27:22 +00:00
Evgeniy Stepanov
e9f5367fed [msan] Fix "missing origin" in atomic store.
An atomic store always make the target location fully initialized (in the
current implementation). It should not store origin. Initialized memory can't
have meaningful origin, and, due to origin granularity (4 bytes) there is a
chance that this extra store would overwrite meaningfull origin for an adjacent
location.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228444 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 21:47:39 +00:00
Cameron Esfahani
67a0f80652 Test commit to see if it triggers an email to llvm-commits. No change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228442 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 21:33:08 +00:00
Zachary Turner
4f325e4c43 Try to fix Makefile build for LLVMDebugInfoPDB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228437 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 20:42:03 +00:00
Zachary Turner
44797c5a09 Resubmit "Create lib/DebugInfo/PDB" (r228428)
This change resubmits the patch that broke the build, this time
without unittests.  The unittests will be submitted separately
after the problem has been addressed:

--Original Commit Message--

Create lib/DebugInfo/PDB.

This patch creates a platform-independent interface to a PDB reader.
There is currently no implementation of this interface, which will
be provided in future patches.  This defines the basic object model
which any implementation must conform to.

Reviewed by: David Blaikie
Differential Revision: http://reviews.llvm.org/D7356

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228435 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 20:30:52 +00:00
Michael Zolotukhin
c9da41492f Use estimated number of optimized insns in unroll-threshold computation.
If complete-unroll could help us to optimize away N% of instructions, we
might want to do this even if the final size would exceed loop-unroll
threshold. However, we don't want to unroll huge loop, and we are add
AbsoluteThreshold to avoid that - this threshold will never be crossed,
even if we expect to optimize 99% instructions after that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228434 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 20:20:40 +00:00
Michael Zolotukhin
3da8e45675 [InstSimplify] Add SimplifyFPBinOp function.
It is a variation of SimplifyBinOp, but it takes into account
FastMathFlags.

It is needed in inliner and loop-unroller to accurately predict the
transformation's outcome (previously we dropped the flags and were too
conservative in some cases).

Example:
float foo(float *a, float b) {
 float r;
 if (a[1] * b)
   r = /* a lot of expensive computations */;
 else
   r = 1;
 return r;
}
float boo(float *a) {
 return foo(a, 0.0);
}

Without this patch, we don't inline 'foo' into 'boo'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228432 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 20:02:51 +00:00
Zachary Turner
9c505a5d38 Revert "Create lib/DebugInfo/PDB."
This reverts commit 21028, as it is causing failures in LLVMConfig.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228431 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 20:00:18 +00:00
Kostya Serebryany
9b13b8c338 [fuzzer] move default sanitizer options to a separate file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228429 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 19:52:07 +00:00
Zachary Turner
1a05c567d6 Create lib/DebugInfo/PDB.
This patch creates a platform-independent interface to a PDB reader.
There is currently no implementation of this interface, which will
be provided in future patches.  This defines the basic object model
which any implementation must conform to.

Reviewed by: David Blaikie
Differential Revision: http://reviews.llvm.org/D7356

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228428 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 19:44:09 +00:00
Lang Hames
396fa9a7b3 [Orc] Move SectionMemoryManager's implementation from MCJIT to ExecutionEngine.
This is a more sensible home for SectionMemoryManager, and allows the implementation
to be shared between Orc and MCJIT.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228427 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 19:36:40 +00:00