Commit Graph

97796 Commits

Author SHA1 Message Date
David Blaikie
fbf70b383d Remove redundant explicit default initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194980 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 21:57:33 +00:00
David Blaikie
08e51e1d97 DwarfCompileUnit: Add type safety to createGlobalVariableDIE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194979 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 21:55:13 +00:00
Ahmed Bougacha
b923d2f5f5 TableGen: Generate an enum for all named Operand types in tblgen'd InstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194978 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 21:24:41 +00:00
Ahmed Bougacha
0df7f51365 Docs: Clearly separate Operand-related paragraphs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194977 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 21:24:37 +00:00
Ahmed Bougacha
3bcf1e3bc0 Docs: Fix typo: NoIntinerary -> NoItinerary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194976 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 21:24:34 +00:00
Manman Ren
6950be2851 Debug Info: fix typo in function name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194975 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 19:35:03 +00:00
Manman Ren
9564d643d7 Debug Info Verifier: fix when to find debug info nodes and when to verify them.
We used to collect debug info MDNodes in doInitialization and verify them in
doFinalization. That is incorrect since MDNodes can be modified by passes run
between doInitialization and doFinalization.

To fix the problem, we handle debug info MDNodes that can be reached from a
function in runOnFunction (i.e we collect those nodes by calling processDeclare,
processValue and processLocation, and then verify them in runOnFunction).

We handle debug info MDNodes that can be reached from named metadata in
doFinalization. This is in line with how Verifier handles module-level data
(they are verified in doFinalization).

rdar://15472296


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194974 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 18:48:57 +00:00
Manman Ren
2b31b8227f Debug Info Verifier: enable public functions of Finder to update the type map.
We used to depend on running processModule before the other public functions
such as processDeclare, processValue and processLocation. We are now relaxing
the constraint by adding a module argument to the three functions and
letting the three functions to initialize the type map. This will be used in
a follow-on patch that collects nodes reachable from a Function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194973 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 18:42:37 +00:00
NAKAMURA Takumi
80ccd9ea59 Utils/LoopUnroll.cpp: Tweak (StringRef)OldName to be valid until it is used, since r194601.
eraseFromParent() invalidates OldName.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194970 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 18:05:34 +00:00
Hal Finkel
c8dc96be28 Add a loop rerolling flag to the PassManagerBuilder
This adds a boolean member variable to the PassManagerBuilder to control loop
rerolling (just like we have for unrolling and the various vectorization
options). This is necessary for control by the frontend. Loop rerolling remains
disabled by default at all optimization levels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194966 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 16:02:50 +00:00
Anders Waldenborg
e8a957d2a9 python: Fix check for disasm creation failure
Check should be for pointer being NULL, not what it points to.

Also adds a test for this case.

Reviewed By: indygreg

Differential Revision: http://llvm-reviews.chandlerc.com/D1878



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194965 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 15:40:57 +00:00
Anders Waldenborg
60e4d7f618 python: Properly initialize before trying to create disasm
As the "LLVMInitializeAll*" functions are not available as symbols in
the shared library they can't be used, and as a workaround a list of
the targets is kept and the individual symbols tried. As soon as the
"All"-functions are changed to proper symbols (as opposed to static
inlines in the headers) this hack will be replace with simple calls
to the corresponding "LLVMInitializeAll*" functions.

Reviewed By: indygreg

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1879



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194964 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 15:17:08 +00:00
Alp Toker
d192b52a61 Update CREDITS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194962 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 11:44:36 +00:00
Bill Wendling
281e8eb9fd Testcase for PR17964
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194961 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 10:53:19 +00:00
Bill Wendling
fe128c6ac8 Revert "Micro-optimization"
This reverts commit f1d9fe9d04.

This was causing PR17964. We need to use thread data before regular data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194960 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 10:53:13 +00:00
Benjamin Kramer
d5ae5b0186 DAGCombiner: Partially revert r192795, getNOT was fixed not to create illegal constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194959 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 10:40:03 +00:00
Yaron Keren
e5a694ab57 DebugLoc defines LineCol as 32 bit in comment but unsigned in code.
This patch modifies LineCol to be a uint32_t.

See http://llvm.org/bugs/show_bug.cgi?id=17957



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194957 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 09:47:39 +00:00
Michael Gottesman
e7a1e3ee82 [block-freq] Add BlockFrequency::scale that returns a remainder from the division and make the private scale in BlockFrequency more performant.
This change is the first in a series of changes improving LLVM's Block
Frequency propogation implementation to not lose probability mass in
branchy code when propogating block frequency information from a basic
block to its successors. This patch is a simple infrastructure
improvement that does not actually modify the block frequency
algorithm. The specific changes are:

1. Changes the division algorithm used when scaling block frequencies by
branch probabilities to a short division algorithm. This gives us the
remainder for free as well as provides a nice speed boost. When I
benched the old routine and the new routine on a Sandy Bridge iMac with
disabled turbo mode performing 8192 iterations on an array of length
32768, I saw ~600% increase in speed in mean/median performance.

2. Exposes a scale method that returns a remainder. This is important so
we can ensure that when we scale a block frequency by some branch
probability BP = N/D, the remainder from the division by D can be
retrieved and propagated to other children to ensure no probability mass
is lost (more to come on this).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194950 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 03:25:24 +00:00
Chandler Carruth
8417e85781 [PM] Completely remove support for explicit 'require' methods on the
AnalysisManager. All this method did was assert something and we have
a perfectly good way to trigger that assert from the query path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194947 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 03:18:05 +00:00
Matt Arsenault
ca1b7799aa Use more getZExtOrTruncs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194945 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 02:31:26 +00:00
Matt Arsenault
91053d585a Use getZExtOrTrunc instead of repeating the same logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194944 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 02:24:21 +00:00
Hal Finkel
390564206f Add the cold attribute to error-reporting call sites
Generally speaking, control flow paths with error reporting calls are cold.
So far, error reporting calls are calls to perror and calls to fprintf,
fwrite, etc. with stderr as the stream. This can be extended in the future.

The primary motivation is to improve block placement (the cold attribute
affects the static branch prediction heuristics).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194943 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 02:06:35 +00:00
Andrew Trick
bb756ca244 Added a size field to the stack map record to handle subregister spills.
Implementing this on bigendian platforms could get strange. I added a
target hook, getStackSlotRange, per Jakob's recommendation to make
this as explicit as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194942 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 01:36:23 +00:00
Hal Finkel
b7dabccbce Fix ndebug-build unused variable in loop rerolling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194941 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 01:21:54 +00:00
Matt Arsenault
94437c9691 Use right address space pointer size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194940 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17 00:06:39 +00:00
Hal Finkel
bebe48dbfe Add a loop rerolling pass
This adds a loop rerolling pass: the opposite of (partial) loop unrolling. The
transformation aims to take loops like this:

for (int i = 0; i < 3200; i += 5) {
  a[i]     += alpha * b[i];
  a[i + 1] += alpha * b[i + 1];
  a[i + 2] += alpha * b[i + 2];
  a[i + 3] += alpha * b[i + 3];
  a[i + 4] += alpha * b[i + 4];
}

and turn them into this:

for (int i = 0; i < 3200; ++i) {
  a[i] += alpha * b[i];
}

and loops like this:

for (int i = 0; i < 500; ++i) {
  x[3*i] = foo(0);
  x[3*i+1] = foo(0);
  x[3*i+2] = foo(0);
}

and turn them into this:

for (int i = 0; i < 1500; ++i) {
  x[i] = foo(0);
}

There are two motivations for this transformation:

  1. Code-size reduction (especially relevant, obviously, when compiling for
code size).

  2. Providing greater choice to the loop vectorizer (and generic unroller) to
choose the unrolling factor (and a better ability to vectorize). The loop
vectorizer can take vector lengths and register pressure into account when
choosing an unrolling factor, for example, and a pre-unrolled loop limits that
choice. This is especially problematic if the manual unrolling was optimized
for a machine different from the current target.

The current implementation is limited to single basic-block loops only. The
rerolling recognition should work regardless of how the loop iterations are
intermixed within the loop body (subject to dependency and side-effect
constraints), but the significant restriction is that the order of the
instructions in each iteration must be identical. This seems sufficient to
capture all current use cases.

This pass is not currently enabled by default at any optimization level.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194939 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 23:59:05 +00:00
Juergen Ributzka
0ccb37a733 The WebKit_JS CC preserves the same registers as the C CC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194936 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 22:08:58 +00:00
Hal Finkel
64fa501b10 Apply the InstCombine fptrunc sqrt optimization to llvm.sqrt
InstCombine, in visitFPTrunc, applies the following optimization to sqrt calls:

  (fptrunc (sqrt (fpext x))) -> (sqrtf x)

but does not apply the same optimization to llvm.sqrt. This is a problem
because, to enable vectorization, Clang generates llvm.sqrt instead of sqrt in
fast-math mode, and because this optimization is being applied to sqrt and not
applied to llvm.sqrt, sometimes the fast-math code is slower.

This change makes InstCombine apply this optimization to llvm.sqrt as well.

This fixes the specific problem in PR17758, although the same underlying issue
(optimizations applied to libcalls are not applied to intrinsics) exists for
other optimizations in SimplifyLibCalls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194935 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 21:29:08 +00:00
Matt Arsenault
e6e811277f Fix assert on unaligned access to global with different address space size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194934 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 20:50:54 +00:00
Matt Arsenault
4fe5b640ee Fix codegen for null different sized pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194932 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 20:24:41 +00:00
Benjamin Kramer
2905440bdd ScalarEvolution: Warn if the result of setFlags/clearFlags is unused.
This was a source of bugs in the past.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194929 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 16:25:47 +00:00
Benjamin Kramer
b69143c6a9 Annotate APInt methods where it's not clear whether they are in place with warn_unused_result.
Fix ScalarEvolution bugs uncovered by this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194928 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 16:25:41 +00:00
Vincent Lejeune
4110797853 R600: Make dot_4 instructions predicable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194927 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 16:24:41 +00:00
Duncan P. N. Exon Smith
0fb32eb56a Use array_pod_sort instead of std::sort
Per Rafael's review of r194514.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194926 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 16:15:56 +00:00
Benjamin Kramer
e9cdbf68e5 InstCombine: fold (A >> C) == (B >> C) --> (A^B) < (1 << C) for constant Cs.
This is common in bitfield code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194925 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 16:00:48 +00:00
Duncan P. N. Exon Smith
bd9f36f4db Fix filename in header comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194924 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 15:40:54 +00:00
NAKAMURA Takumi
793622668e gtest-death-test.cc: Move ~DeathTestFactory() to unbreak cygming build since r194865.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194918 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 05:26:49 +00:00
Manman Ren
3d429d80e4 Debug Info Verifier: remove un-used argument in verifyDebugInfo.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194917 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 02:34:57 +00:00
Jim Grosbach
35de9946d5 X86: Encode the 'h' cpu subtype in the MachO header for x86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194906 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 00:52:57 +00:00
Matt Arsenault
07df65cbb1 Mention address space related changes in release notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194904 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 00:36:46 +00:00
Matt Arsenault
74c996cbd1 Use correct size for address space in BasicAA.
The tests just hit this with a different sized
address space since I haven't figured out how
to use this to break it.

I thought I committed this a long time ago,
and I'm not sure why missing this hasn't caused
any problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194903 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 00:36:43 +00:00
David Blaikie
1dc2723996 DwarfCompileUnit: Push type safety of DIDescriptor through CompileUnit::createAndAddDIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194902 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 00:29:01 +00:00
David Blaikie
21c9708c09 DwarfCompileUnit: Remove unnecessary OwningPtr<T>::get() call
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194901 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 00:28:15 +00:00
Owen Anderson
e553feab84 Small improvement to InstrinsicEmitter::EmitAttributes. This change removes the “pushing” and “clearing” of the SmallVector and instead uses const arrays to pass the attributeKinds to AttributeSet::get .
Patch by Aditya Nandakumar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194899 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 00:20:01 +00:00
Eric Christopher
87fd14d9b5 For dwarf4 use the correct form for referencing debug_loc locations,
and update test cases accordingly.

This doesn't affect the output dumped using llvm-dwarfdump, but
readelf does now dump the debug_loc section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194898 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-16 00:18:40 +00:00
David Blaikie
7b86771094 DwarfCompileUnit: Add type safety to CompileUnit::getNode by returning DICompileUnit instead of a raw MDNode*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194895 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 23:54:45 +00:00
David Blaikie
942431fa71 DwarfCompileUnit: Add type safety by using DICompileUnit rather than raw MDNode* for the CU metadata node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194893 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 23:52:02 +00:00
David Blaikie
aedaa723c2 DwarfCompileUnit: Simplify getLanguage() calls to use existing member function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194892 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 23:50:53 +00:00
Ana Pazos
a53bf06f7a Implemented aarch64 Neon scalar vmulx_lane intrinsics
Implemented aarch64 Neon scalar vfma_lane intrinsics
Implemented aarch64 Neon scalar vfms_lane intrinsics

Implemented legacy vmul_n_f64, vmul_lane_f64, vmul_laneq_f64
intrinsics (v1f64 parameter type) using Neon scalar instructions.

Implemented legacy vfma_lane_f64, vfms_lane_f64,
vfma_laneq_f64, vfms_laneq_f64 intrinsics (v1f64 parameter type)
using Neon scalar instructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194888 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 23:32:10 +00:00
Adrian Prantl
6bc810a499 Replace the dangling context hotfix with an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194883 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 23:21:39 +00:00