Commit Graph

113204 Commits

Author SHA1 Message Date
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
Lang Hames
884fa87a1f [Orc] Add some missing headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228426 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 19:34:40 +00:00
Lang Hames
b20b9fb7f7 [Orc] Fix syntax error in LazyEmittingLayer::removeModuleSet.
This was a trivial think-o, but it's in a method of a templated class
and doesn't have any callers yet, so the compiler let it pass. I hope
to add a unit test to cover this soon.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228425 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 19:34:04 +00:00
Quentin Colombet
4c2a2ac196 [LiveIntervalAnalysis] Speed up creation of live ranges for physical registers
by using a segment set.

The patch addresses a compile-time performance regression in the LiveIntervals
analysis pass (see http://llvm.org/bugs/show_bug.cgi?id=18580). This regression
is especially critical when compiling long functions. Our analysis had shown
that the most of time is taken for generation of live intervals for physical
registers. Insertions in the middle of the array of live ranges cause quadratic
algorithmic complexity, which is apparently the main reason for the slow-down. 

Overview of changes:
- The patch introduces an additional std::set<Segment>* member in LiveRange for
  storing segments in the phase of initial creation. The set is used if this
  member is not NULL, otherwise everything works the old way. 
- The set of operations on LiveRange used during initial creation (i.e. used by
  createDeadDefs and extendToUses) have been reimplemented to use the segment
  set if it is available.
- After a live range is created the contents of the set are flushed to the
  segment vector, because the set is not as efficient as the vector for the
  later uses of the live range. After the flushing, the set is deleted and
  cannot be used again.
- The set is only for live ranges computed in
  LiveIntervalAnalysis::computeLiveInRegUnits() and getRegUnit() but not in
  computeVirtRegs(), because I did not bring any performance benefits to
  computeVirtRegs() and for some examples even brought a slow down.

Patch by Vaidas Gasiunas <vaidas.gasiunas@sap.com>

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228421 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 18:42:41 +00:00
Adam Nemet
b3189eac3f [LV] Move addRuntimeCheck to LoopAccessAnalysis
This will allow it to be shared with the new Loop Distribution pass.

getFirstInst is currently duplicated across LoopVectorize.cpp and
LoopAccessAnalysis.cpp.  This is a short-term work-around until we figure out
a better solution.

NFC.  (The code moved is adjusted a bit for the name of the Loop member and
that PtrRtCheck is now a reference rather than a pointer.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228418 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 18:31:04 +00:00
Reid Kleckner
6dc42dd2da Don't dllexport declarations
Fixes PR22488

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228411 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 17:59:49 +00:00
Benjamin Kramer
e003f1ac8c Make helper functions/classes/globals static. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228410 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 17:51:54 +00:00
Matthias Braun
2f2dec87fb InstCombine: Combine select sequences into a single select
Normalize
select(C0, select(C1, a, b), b) -> select((C0 & C1), a, b)
select(C0, a, select(C1, a, b)) -> select((C0 | C1), a, b)

This normal form may enable further combines on the And/Or and shortens
paths for the values. Many targets prefer the other but can go back
easily in CodeGen.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228409 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 17:49:36 +00:00
Matthias Braun
e81cc348ac LiveInterval: Fix SubRange memory leak.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228405 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 17:28:47 +00:00
Daniel Sanders
1e022d0859 [mips] Fix FileCheck prefixes with whitespace between 'CHECK' and ':'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228403 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-06 16:37:30 +00:00