oota-llvm.git
11 years agoAdded RegisterPressureTracker::dump() for debugging.
Andrew Trick [Wed, 5 Dec 2012 06:47:08 +0000 (06:47 +0000)]
Added RegisterPressureTracker::dump() for debugging.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169359 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoComment formatting.
Andrew Trick [Wed, 5 Dec 2012 06:47:06 +0000 (06:47 +0000)]
Comment formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169358 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agodocs: Explain plain preformatted text
Sean Silva [Wed, 5 Dec 2012 04:07:33 +0000 (04:07 +0000)]
docs: Explain plain preformatted text

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169352 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agofix a typo
Shuxin Yang [Wed, 5 Dec 2012 00:33:16 +0000 (00:33 +0000)]
fix a typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169345 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCopy clang/Driver/<Option parsing stuff> to llvm.
Michael J. Spencer [Wed, 5 Dec 2012 00:29:32 +0000 (00:29 +0000)]
Copy clang/Driver/<Option parsing stuff> to llvm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169344 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agodocs: Sphinxify `docs/tutorial/`
Sean Silva [Wed, 5 Dec 2012 00:26:32 +0000 (00:26 +0000)]
docs: Sphinxify `docs/tutorial/`

Sorry for the massive commit, but I just wanted to knock this one down
and it is really straightforward.

There are still a couple trivial (i.e. not related to the content)
things left to fix:

- Use of raw HTML links where :doc:`...` and :ref:`...` could be used
  instead. If you are a newbie and want to help fix this it would make
  for some good bite-sized patches; more experienced developers should
  be focusing on adding new content (to this tutorial or elsewhere, but
  please _do not_ waste your time on formatting when there is such dire
  need for documentation (see docs/SphinxQuickstartTemplate.rst to get
  started writing)).

- Highlighting of the kaleidoscope code blocks (currently left as bare
  `::`).  I will be working on writing a custom Pygments highlighter for
  this, mostly as training for maintaining the `llvm` code-block's lexer
  in-tree. I want to do this because I am extremely unhappy with how it
  just "gives up" on the slightest deviation from the expected syntax
  and leaves the whole code-block un-highlighted.

  More generally I am looking at writing some Sphinx extensions and
  keeping them in-tree as well, to support common use cases that
  currently have no good solution (like "monospace text inside a link").

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169343 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd x86 isel lowering logic to form bit test with inverted condition. e.g.
Evan Cheng [Wed, 5 Dec 2012 00:10:38 +0000 (00:10 +0000)]
Add x86 isel lowering logic to form bit test with inverted condition. e.g.
x ^ -1.

Patch by David Majnemer.
rdar://12755626

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169339 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAppease GCC's -Wparentheses.
Matt Beaumont-Gay [Tue, 4 Dec 2012 23:54:02 +0000 (23:54 +0000)]
Appease GCC's -Wparentheses.

(TIL that Clang's -Wparentheses ignores 'x || y && "foo"' on purpose. Neat.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169337 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSplit up the ParseOptionalAttrs method into three different methods for each
Bill Wendling [Tue, 4 Dec 2012 23:40:58 +0000 (23:40 +0000)]
Split up the ParseOptionalAttrs method into three different methods for each
class of attributes. This makes it much easier to check for errors and to reuse
the code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169336 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoopVectorizer: Increase the number of pointers that can be tested at runtime. If...
Nadav Rotem [Tue, 4 Dec 2012 23:25:24 +0000 (23:25 +0000)]
LoopVectorizer: Increase the number of pointers that can be tested at runtime. If we cant prove statically that the pointers are disjoint then we add the runtime check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169334 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable if-conversion during vectorization.
Nadav Rotem [Tue, 4 Dec 2012 22:59:52 +0000 (22:59 +0000)]
Enable if-conversion during vectorization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169331 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM custom lower ctpop for vector types. Patch by Pete Couperus.
Evan Cheng [Tue, 4 Dec 2012 22:41:50 +0000 (22:41 +0000)]
ARM custom lower ctpop for vector types. Patch by Pete Couperus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169325 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a bug in vectorization of if-converted reduction variables. If the
Nadav Rotem [Tue, 4 Dec 2012 22:40:22 +0000 (22:40 +0000)]
Fix a bug in vectorization of if-converted reduction variables. If the
reduction variable is not used outside the loop then we ran into an
endless loop. This change checks if we found the original PHI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169324 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSpeed up the AllocationOrder class a bit.
Jakob Stoklund Olesen [Tue, 4 Dec 2012 22:25:16 +0000 (22:25 +0000)]
Speed up the AllocationOrder class a bit.

Allow the central functions to be inlined, and use the argumentless
isHint() function when possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169319 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago For rdar://12329730, last piece.
Shuxin Yang [Tue, 4 Dec 2012 22:15:32 +0000 (22:15 +0000)]
  For rdar://12329730, last piece.

  This change attempts to simplify (X^Y) -> X or Y in the user's context if we know that
only bits from X or Y are demanded.

  A minimized case is provided bellow. This change will simplify "t>>16" into "var1 >>16".

  =============================================================
  unsigned foo (unsigned val1, unsigned val2) {
    unsigned t = val1 ^ 1234;
    return (t >> 16) | t; // NOTE: t is used more than once.
  }
  =============================================================

  Note that if the "t" were used only once, the expression would be finally optimized as well.
However, with with this change, the optimization will take place earlier.

  Reviewed by Nadav, Thanks a lot!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169317 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoComment change made in r169304 as requested by Eric Christopher.
David Blaikie [Tue, 4 Dec 2012 22:02:33 +0000 (22:02 +0000)]
Comment change made in r169304 as requested by Eric Christopher.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169315 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDefine store instructions with base+register offset addressing mode
Jyotsna Verma [Tue, 4 Dec 2012 21:58:25 +0000 (21:58 +0000)]
Define store instructions with base+register offset addressing mode
using multiclass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169314 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse the 'count' attribute to calculate the upper bound of an array.
Bill Wendling [Tue, 4 Dec 2012 21:34:03 +0000 (21:34 +0000)]
Use the 'count' attribute to calculate the upper bound of an array.

The count attribute is more accurate with regards to the size of an array. It
also obviates the upper bound attribute in the subrange. We can also better
handle an unbound array by setting the count to -1 instead of the lower bound to
1 and upper bound to 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169312 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agodocs: Begin Sphinxification of docs/tutorial/
Sean Silva [Tue, 4 Dec 2012 21:16:41 +0000 (21:16 +0000)]
docs: Begin Sphinxification of docs/tutorial/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169309 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agodocs: fixup legacy HTML link
Sean Silva [Tue, 4 Dec 2012 21:16:34 +0000 (21:16 +0000)]
docs: fixup legacy HTML link

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169308 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReapply r160148 (reverted in r163570) fixing spurious breakpoints in modern GDB
David Blaikie [Tue, 4 Dec 2012 21:05:36 +0000 (21:05 +0000)]
Reapply r160148 (reverted in r163570) fixing spurious breakpoints in modern GDB

This reapplies the fix for PR13303 now with more justification. Based on my
execution of the GDB 7.5 test suite this results in:

expected passes: 16101 -> 20890 (+30%)
unexpected failures: 4826 -> 637 (-77%)

There are 23 checks that used to pass and now fail. They are all in
gdb.reverse. Investigating a few looks like they were accidentally passing
due to extra breakpoints being set by this bug. They're generally due to the
difference in end location between gcc and clang, the test suite is trying to
set breakpoints on the closing '}' that clang doesn't associate with any
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169304 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove a URL from code
Eli Bendersky [Tue, 4 Dec 2012 19:08:43 +0000 (19:08 +0000)]
Remove a URL from code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169293 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake NaCl naming consistent. The triple OSType is called NaCl and is represented
Eli Bendersky [Tue, 4 Dec 2012 18:37:26 +0000 (18:37 +0000)]
Make NaCl naming consistent. The triple OSType is called NaCl and is represented
textually as NativeClient. Also added a link to the native client project for
readers unfamiliar with it.

A Clang patch will follow shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169291 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for reduction variables when IF-conversion is enabled.
Nadav Rotem [Tue, 4 Dec 2012 18:17:33 +0000 (18:17 +0000)]
Add support for reduction variables when IF-conversion is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169288 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd patterns to define 'combine', 'tstbit', 'ct0/cl0' (count trailing/leading zeros)
Jyotsna Verma [Tue, 4 Dec 2012 18:05:01 +0000 (18:05 +0000)]
Add patterns to define 'combine', 'tstbit', 'ct0/cl0' (count trailing/leading zeros)
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169287 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd constant extender support to ALU32 instructions for V2.
Jyotsna Verma [Tue, 4 Dec 2012 17:12:00 +0000 (17:12 +0000)]
Add constant extender support to ALU32 instructions for V2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169284 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoA test in thid directory was not being run because lit.local.cfg didn't
Eli Bendersky [Tue, 4 Dec 2012 17:00:11 +0000 (17:00 +0000)]
A test in thid directory was not being run because lit.local.cfg didn't
include .ll files. Fix that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169283 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix comment typo.
Duncan Sands [Tue, 4 Dec 2012 16:36:05 +0000 (16:36 +0000)]
Fix comment typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169282 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThis patch introduces initial-exec model support for thread-local storage
Bill Schmidt [Tue, 4 Dec 2012 16:18:08 +0000 (16:18 +0000)]
This patch introduces initial-exec model support for thread-local storage
on 64-bit PowerPC ELF.

The patch includes code to handle external assembly and MC output with the
integrated assembler.  It intentionally does not support the "old" JIT.

For the initial-exec TLS model, the ABI requires the following to calculate
the address of external thread-local variable x:

 Code sequence            Relocation                  Symbol
  ld 9,x@got@tprel(2)      R_PPC64_GOT_TPREL16_DS      x
  add 9,9,x@tls            R_PPC64_TLS                 x

The register 9 is arbitrary here.  The linker will replace x@got@tprel
with the offset relative to the thread pointer to the generated GOT
entry for symbol x.  It will replace x@tls with the thread-pointer
register (13).

The two test cases verify correct assembly output and relocation output
as just described.

PowerPC-specific selection node variants are added for the two
instructions above:  LD_GOT_TPREL and ADD_TLS.  These are inserted
when an initial-exec global variable is encountered by
PPCTargetLowering::LowerGlobalTLSAddress(), and later lowered to
machine instructions LDgotTPREL and ADD8TLS.  LDgotTPREL is a pseudo
that uses the same LDrs support added for medium code model's LDtocL,
with a different relocation type.

The rest of the processing is straightforward.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169281 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate release notes for NVPTX
Justin Holewinski [Tue, 4 Dec 2012 16:11:51 +0000 (16:11 +0000)]
Update release notes for NVPTX

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169280 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGet rid of references to Tcl, DejagGNU, old test structure, discourage the use
Eli Bendersky [Tue, 4 Dec 2012 14:34:00 +0000 (14:34 +0000)]
Get rid of references to Tcl, DejagGNU, old test structure, discourage the use
of grep in favor of FileCheck, and other cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169269 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove the very out-of-date listing of "very important LLVM areas". I don't
Eli Bendersky [Tue, 4 Dec 2012 13:55:17 +0000 (13:55 +0000)]
Remove the very out-of-date listing of "very important LLVM areas". I don't
think it adds much and keeping it up-to-date is (obviously) a chore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169263 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoImprove MSan tests.
Evgeniy Stepanov [Tue, 4 Dec 2012 11:42:05 +0000 (11:42 +0000)]
Improve MSan tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169256 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoKillTheDoctor.cpp: Restore Win32 SDK headers before r169251.
NAKAMURA Takumi [Tue, 4 Dec 2012 11:34:27 +0000 (11:34 +0000)]
KillTheDoctor.cpp: Restore Win32 SDK headers before r169251.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169255 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoClean up the sample include orderings, not that it really matters...
Chandler Carruth [Tue, 4 Dec 2012 10:46:21 +0000 (10:46 +0000)]
Clean up the sample include orderings, not that it really matters...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169253 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSort the #include lines for tools/...
Chandler Carruth [Tue, 4 Dec 2012 10:44:52 +0000 (10:44 +0000)]
Sort the #include lines for tools/...

Again, tools are trickier to pick the main module header for than
library source files. I've started to follow the pattern of using
LLVMContext.h when it is included as a stub for program source files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169252 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSort the #include lines for utils/...
Chandler Carruth [Tue, 4 Dec 2012 10:37:14 +0000 (10:37 +0000)]
Sort the #include lines for utils/...

I've tried to find main moudle headers where possible, but the TableGen
stuff may warrant someone else looking at it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169251 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSort the #include lines for unittest/...
Chandler Carruth [Tue, 4 Dec 2012 10:23:08 +0000 (10:23 +0000)]
Sort the #include lines for unittest/...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169250 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSort the #include lines of the examples/... tree.
Chandler Carruth [Tue, 4 Dec 2012 10:16:57 +0000 (10:16 +0000)]
Sort the #include lines of the examples/... tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169249 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach the include sorter to quickly skip files with an extension that
Chandler Carruth [Tue, 4 Dec 2012 10:08:59 +0000 (10:08 +0000)]
Teach the include sorter to quickly skip files with an extension that
doesn't look like it will have C++ code in it.

Suggestions on a better heuristic are welcome.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169248 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach the include sorter to skip files under test trees and under INPUTS
Chandler Carruth [Tue, 4 Dec 2012 09:59:54 +0000 (09:59 +0000)]
Teach the include sorter to skip files under test trees and under INPUTS
trees. This allows running the input sorter on the entire clang
repository cleanly now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169247 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach the include sorting script about the gtest headers; sort them with
Chandler Carruth [Tue, 4 Dec 2012 09:44:38 +0000 (09:44 +0000)]
Teach the include sorting script about the gtest headers; sort them with
the system headers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169242 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoVMCoreTests/PassManagerTest.cpp: Appease msvc not to do "using llvm::Pass" in class...
NAKAMURA Takumi [Tue, 4 Dec 2012 07:25:24 +0000 (07:25 +0000)]
VMCoreTests/PassManagerTest.cpp: Appease msvc not to do "using llvm::Pass" in class template.

FIXME: I have not checked whether to be compiled on msvc11.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169225 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSort includes for all of the .h files under the 'lib' tree. These were
Chandler Carruth [Tue, 4 Dec 2012 07:12:27 +0000 (07:12 +0000)]
Sort includes for all of the .h files under the 'lib' tree. These were
missed in the first pass because the script didn't yet handle include
guards.

Note that the script is now able to handle all of these headers without
manual edits. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169224 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGive scalar if-converted blocks half the score because they are not always executed...
Nadav Rotem [Tue, 4 Dec 2012 07:11:52 +0000 (07:11 +0000)]
Give scalar if-converted blocks half the score because they are not always executed due to CF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169223 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAddress review comments from Matt on the sort_includes.py script.
Chandler Carruth [Tue, 4 Dec 2012 07:04:58 +0000 (07:04 +0000)]
Address review comments from Matt on the sort_includes.py script.

1) Teach it to handle files with #include on the first line -- these do
   actually exist in LLVM.
2) Support llvm-c and clang-c include projects.
3) Nuke some stail imports.
4) Switch to using os.path to split the file extension off.
5) Remove debugging leftovers.
6) Add docstring (a really puny one) for the sort function.

I'm continuing te avoid stripping the whitespace on the RHS to preserve
whatever newline characters happen to be in the original file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169222 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a comment about the requirement that the Windows.h header be last.
Chandler Carruth [Tue, 4 Dec 2012 07:04:57 +0000 (07:04 +0000)]
Add a comment about the requirement that the Windows.h header be last.
This comment has the dual effect of blocking reorderings with the
sort_include script.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169221 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a 'count' field to the DWARF subrange.
Bill Wendling [Tue, 4 Dec 2012 06:20:49 +0000 (06:20 +0000)]
Add a 'count' field to the DWARF subrange.

The count field is necessary because there isn't a difference between the 'lo'
and 'hi' attributes for a one-element array and a zero-element array. When the
count is '0', we know that this is a zero-element array. When it's >=1, then
it's a normal constant sized array. When it's -1, then the array is unbounded.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169218 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd the last part that is needed for vectorization of if-converted code.
Nadav Rotem [Tue, 4 Dec 2012 06:15:11 +0000 (06:15 +0000)]
Add the last part that is needed for vectorization of if-converted code.
Added the code that actually performs the if-conversion during vectorization.

We can now vectorize this code:

for (int i=0; i<n; ++i) {
  unsigned k = 0;

  if (a[i] > b[i])   <------ IF inside the loop.
    k = k * 5 + 3;

  a[i] = k;          <---- K is a phi node that becomes vector-select.
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169217 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[asan] add experimental -asan-realign-stack option (true by default, which does not...
Kostya Serebryany [Tue, 4 Dec 2012 06:14:01 +0000 (06:14 +0000)]
[asan] add experimental -asan-realign-stack option (true by default, which does not change the current behavior)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169216 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a 'getCount' method to get the number of elements in the subrange.
Bill Wendling [Tue, 4 Dec 2012 06:12:44 +0000 (06:12 +0000)]
Add a 'getCount' method to get the number of elements in the subrange.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169215 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd 'using' declarations to suppress -Woverloaded-virtual warnings.
Matt Beaumont-Gay [Tue, 4 Dec 2012 05:41:27 +0000 (05:41 +0000)]
Add 'using' declarations to suppress -Woverloaded-virtual warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169214 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove all operand definitions into HexagonOperands.td
Jyotsna Verma [Tue, 4 Dec 2012 05:00:31 +0000 (05:00 +0000)]
Move all operand definitions into HexagonOperands.td

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169213 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove generic Hexagon subtarget information into Hexagon.td
Jyotsna Verma [Tue, 4 Dec 2012 04:29:16 +0000 (04:29 +0000)]
Move generic Hexagon subtarget information into Hexagon.td

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169212 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agodocs: Fix broken link.
Sean Silva [Tue, 4 Dec 2012 03:45:27 +0000 (03:45 +0000)]
docs: Fix broken link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169211 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agodocs: Fix dead link.
Sean Silva [Tue, 4 Dec 2012 03:30:36 +0000 (03:30 +0000)]
docs: Fix dead link.

Apparently Dinkumware are no longer hosting their nice reference
manuals. Thankfully, `cppreference.com` can fill that role well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169210 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agordar://12329730 (2nd part, revised)
Shuxin Yang [Tue, 4 Dec 2012 03:28:32 +0000 (03:28 +0000)]
rdar://12329730 (2nd part, revised)

The type of shirt-right (logical or arithemetic) should remain unchanged
when transforming  "X << C1 >> C2" into "X << (C1-C2)"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169209 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agodocs: Convert ProgrammersManual to reST.
Sean Silva [Tue, 4 Dec 2012 03:20:08 +0000 (03:20 +0000)]
docs: Convert ProgrammersManual to reST.

Patch by Alexander Zinenko!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169208 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoASan: add initial support for handling llvm.lifetime intrinsics in ASan - emit calls...
Alexey Samsonov [Tue, 4 Dec 2012 01:34:23 +0000 (01:34 +0000)]
ASan: add initial support for handling llvm.lifetime intrinsics in ASan - emit calls into runtime library that poison memory for local variables when their lifetime is over and unpoison memory when their lifetime begins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169200 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify code. No functionality change.
Jakub Staszak [Tue, 4 Dec 2012 01:00:52 +0000 (01:00 +0000)]
Simplify code. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169198 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoStack Alignment: when creating stack objects in MachineFrameInfo, make sure
Manman Ren [Tue, 4 Dec 2012 00:52:33 +0000 (00:52 +0000)]
Stack Alignment: when creating stack objects in MachineFrameInfo, make sure
the alignment is clamped to TargetFrameLowering.getStackAlignment if the target
does not support stack realignment or the option "realign-stack" is off.

This will cause miscompile if the address is treated as aligned and add is
replaced with or in DAGCombine.

Added a bool StackRealignable to TargetFrameLowering to check whether stack
realignment is implemented for the target. Also added a bool RealignOption
to MachineFrameInfo to check whether the option "realign-stack" is on.

rdar://12713765

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169197 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse dyn_cast instead of isa and cast. No functionality change.
Jakub Staszak [Tue, 4 Dec 2012 00:50:06 +0000 (00:50 +0000)]
Use dyn_cast instead of isa and cast. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169196 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoopVectorize.cpp: Suppress a warning. [-Wunused-variable]
NAKAMURA Takumi [Tue, 4 Dec 2012 00:49:34 +0000 (00:49 +0000)]
LoopVectorize.cpp: Suppress a warning. [-Wunused-variable]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169195 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix whitespace.
NAKAMURA Takumi [Tue, 4 Dec 2012 00:49:28 +0000 (00:49 +0000)]
Fix whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169194 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove the old TRI::ResolveRegAllocHint() and getRawAllocationOrder() hooks.
Jakob Stoklund Olesen [Tue, 4 Dec 2012 00:46:13 +0000 (00:46 +0000)]
Remove the old TRI::ResolveRegAllocHint() and getRawAllocationOrder() hooks.

These functions have been replaced by TRI::getRegAllocationHints() which
provides the same capabilities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169192 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove VirtRegMap::getRegAllocPref().
Jakob Stoklund Olesen [Tue, 4 Dec 2012 00:35:59 +0000 (00:35 +0000)]
Remove VirtRegMap::getRegAllocPref().

Now that there can be multiple hint registers from targets, it doesn't
make sense to have a function that returns 'the' preferred register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169190 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse MRI::getSimpleHint() instead of getRegAllocPref() in remaining cases.
Jakob Stoklund Olesen [Tue, 4 Dec 2012 00:30:22 +0000 (00:30 +0000)]
Use MRI::getSimpleHint() instead of getRegAllocPref() in remaining cases.

Targets can provide multiple hints now, so getRegAllocPref() doesn't
make sense any longer because it only returns one preferred register.
Replace it with getSimpleHint() in the remaining heuristics. This
function only

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169188 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoStack Alignment: move functions from header file MachineFrameInfo.h.
Manman Ren [Tue, 4 Dec 2012 00:26:44 +0000 (00:26 +0000)]
Stack Alignment: move functions from header file MachineFrameInfo.h.

No functional change for this commit. The follow-up patch will add more stuff to
these functions.

rdar://12713765

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169186 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRuntimeDyld: Fix up r169178. MSVC doesn't like "or".
NAKAMURA Takumi [Tue, 4 Dec 2012 00:08:14 +0000 (00:08 +0000)]
RuntimeDyld: Fix up r169178. MSVC doesn't like "or".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169183 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agordar://12329730 (2nd part)
Shuxin Yang [Tue, 4 Dec 2012 00:04:54 +0000 (00:04 +0000)]
rdar://12329730 (2nd part)

 This change tries to simmplify E1 = " X >> C1 << C2" into :
  - E2 = "X << (C2 - C1)" if C2 > C1, or
  - E2 = "X >> (C1 - C2)" if C1 > C2, or
  - E2 = X if C1 == C2.

 Reviewed by Nadav. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169182 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd VirtRegMap::hasKnownPreference().
Jakob Stoklund Olesen [Mon, 3 Dec 2012 23:23:50 +0000 (23:23 +0000)]
Add VirtRegMap::hasKnownPreference().

Virtual registers with a known preferred register are prioritized by
RAGreedy. This function makes the condition explicit without depending
on getRegAllocPref().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169179 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRuntime dynamic linker for MCJIT should support MIPS BigEndian architecture.
Akira Hatanaka [Mon, 3 Dec 2012 23:12:19 +0000 (23:12 +0000)]
Runtime dynamic linker for MCJIT should support MIPS BigEndian architecture.
This small change adds support for that. It will make all MCJIT tests pass
in make-check on BigEndian platforms.

Patch by Petar Jovanovic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169178 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoClassic JIT is still being supported by MIPS, along with MCJIT.
Akira Hatanaka [Mon, 3 Dec 2012 23:11:12 +0000 (23:11 +0000)]
Classic JIT is still being supported by MIPS, along with MCJIT.
This change adds endian-awareness to MipsJITInfo and emitWordLE in
MipsCodeEmitter has become emitWord now to support both endianness.

Patch by Petar Jovanovic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169177 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMinor tweaking to SmallVector static size.
Michael Ilseman [Mon, 3 Dec 2012 22:57:47 +0000 (22:57 +0000)]
Minor tweaking to SmallVector static size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169176 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agominor renaming, documentation and cleanups.
Nadav Rotem [Mon, 3 Dec 2012 22:57:09 +0000 (22:57 +0000)]
minor renaming, documentation and cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169175 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFunctions in MipsCodeEmitter.cpp that expand unaligned loads/stores are dead
Akira Hatanaka [Mon, 3 Dec 2012 22:51:22 +0000 (22:51 +0000)]
Functions in MipsCodeEmitter.cpp that expand unaligned loads/stores are dead
code. Removing it.

Patch by Petar Jovanovic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169174 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse the new getRegAllocationHints() hook from AllocationOrder.
Jakob Stoklund Olesen [Mon, 3 Dec 2012 22:51:04 +0000 (22:51 +0000)]
Use the new getRegAllocationHints() hook from AllocationOrder.

This simplifies the hinting code quite a bit while making the targets
easier to write at the same time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169173 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoconstify the cost API
Nadav Rotem [Mon, 3 Dec 2012 22:47:12 +0000 (22:47 +0000)]
constify the cost API

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169172 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIF-conversion: teach the cost-model how to grade if-converted loops.
Nadav Rotem [Mon, 3 Dec 2012 22:46:31 +0000 (22:46 +0000)]
IF-conversion: teach the cost-model how to grade if-converted loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169171 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoImplement ARMBaseRegisterInfo::getRegAllocationHints().
Jakob Stoklund Olesen [Mon, 3 Dec 2012 22:35:35 +0000 (22:35 +0000)]
Implement ARMBaseRegisterInfo::getRegAllocationHints().

This provides the same functionality as getRawAllocationOrder() for the
even/odd hints, but without the many constant register arrays.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169169 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDefine store instructions with base+immediate offset addressing mode
Jyotsna Verma [Mon, 3 Dec 2012 22:26:28 +0000 (22:26 +0000)]
Define store instructions with base+immediate offset addressing mode
using multiclass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169168 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Support] Make FileOutputBuffer work on Windows.
Michael J. Spencer [Mon, 3 Dec 2012 22:09:52 +0000 (22:09 +0000)]
[Support] Make FileOutputBuffer work on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169167 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Support][FileSystem] Fix open mode in resize_file on Windows.
Michael J. Spencer [Mon, 3 Dec 2012 22:09:31 +0000 (22:09 +0000)]
[Support][FileSystem] Fix open mode in resize_file on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169166 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert the header sort on this file.
Michael J. Spencer [Mon, 3 Dec 2012 22:07:00 +0000 (22:07 +0000)]
Revert the header sort on this file.

"Windows.h" includes <Windows.h> which defines a bunch of stuff it shouldn't
(even with all the restriction macros). We have no control over this file, so
make it's scope as small as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169165 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agomoves doInitialization and doFinalization to the Pass class and removes some unreacha...
Pedro Artigas [Mon, 3 Dec 2012 21:56:57 +0000 (21:56 +0000)]
moves doInitialization and doFinalization to the Pass class and removes some unreachable code in MachineModuleInfo

reviewed by Evan Cheng <evan.cheng@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169164 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a getMemorySize() function for DenseSet.
Argyrios Kyrtzidis [Mon, 3 Dec 2012 21:46:21 +0000 (21:46 +0000)]
Add a getMemorySize() function for DenseSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169163 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoNow that we have a basic if-conversion infrastructure we can rename the
Nadav Rotem [Mon, 3 Dec 2012 21:33:08 +0000 (21:33 +0000)]
Now that we have a basic if-conversion infrastructure we can rename the
"single basic block loop vectorizer" to "innermost loop vectorizer".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169158 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSince this SmallVector immediately grows on the next line, don't waste stack space...
Michael Ilseman [Mon, 3 Dec 2012 21:29:36 +0000 (21:29 +0000)]
Since this SmallVector immediately grows on the next line, don't waste stack space. SmallVector is still needed due to existing APIs growing their arguments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169157 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a new hook for providing register allocator hints more flexibly.
Jakob Stoklund Olesen [Mon, 3 Dec 2012 21:17:00 +0000 (21:17 +0000)]
Add a new hook for providing register allocator hints more flexibly.

The TargetRegisterInfo::getRegAllocationHints() function is going to
replace the existing mechanisms for providing target-dependent hints to
the register allocator: ResolveRegAllocHint() and
getRawAllocationOrder().

The new hook is more flexible because it allows the target to provide
multiple preferred candidate registers for each virtual register, and it
is easier to use because targets are not required to return a reference
to a constant array like getRawAllocationOrder().

An optional VirtRegMap argument can be used to provide target-dependent
hints that depend on the provisional assignments of other virtual
registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169154 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDefine load instructions with base+immediate offset addressing mode
Jyotsna Verma [Mon, 3 Dec 2012 21:13:13 +0000 (21:13 +0000)]
Define load instructions with base+immediate offset addressing mode
using multiclass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169153 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd initial support for IF-conversion. This patch implements the first 1/3,
Nadav Rotem [Mon, 3 Dec 2012 21:06:35 +0000 (21:06 +0000)]
Add initial support for IF-conversion. This patch implements the first 1/3,
which is the legality of the if-conversion transformation. The next step is to
implement the cost-model for the if-converted code as well as the
vectorization itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169152 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDefine unsigned const-ext predicates.
Jyotsna Verma [Mon, 3 Dec 2012 20:39:45 +0000 (20:39 +0000)]
Define unsigned const-ext predicates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169149 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemoving unnecessary 'else' statement from the predicates defined in HexagonOperards.td.
Jyotsna Verma [Mon, 3 Dec 2012 20:14:38 +0000 (20:14 +0000)]
Removing unnecessary 'else' statement from the predicates defined in HexagonOperards.td.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169148 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEliminate redundant bitwise operations when using a llvm/ADT/PointerUnion.
Argyrios Kyrtzidis [Mon, 3 Dec 2012 19:59:23 +0000 (19:59 +0000)]
Eliminate redundant bitwise operations when using a llvm/ADT/PointerUnion.

For comparison, with this code sample:

PointerUnion<int *, char *> Data;
PointerUnion<int *, char *> foo1() {
Data = new int;
return new int;
}
PointerUnion<int *, char *> foo2() {
Data = new char;
return new char;
}

Before this patch we would get:

define i64 @_Z4foo1v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 4)
  %2 = ptrtoint i8* %1 to i64
  %3 = load i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %4 = and i64 %3, 1
  %.masked.i = and i64 %2, -3
  %5 = or i64 %4, %.masked.i
  store i64 %5, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %6 = tail call noalias i8* @_Znwm(i64 4)
  %7 = ptrtoint i8* %6 to i64
  %8 = and i64 %7, -3
  ret i64 %8
}

define i64 @_Z4foo2v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 1)
  %2 = ptrtoint i8* %1 to i64
  %3 = load i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %4 = and i64 %3, 1
  %5 = or i64 %2, %4
  %6 = or i64 %5, 2
  store i64 %6, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %7 = tail call noalias i8* @_Znwm(i64 1)
  %8 = ptrtoint i8* %7 to i64
  %9 = or i64 %8, 2
  ret i64 %9
}

After the patch:

define i64 @_Z4foo1v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 4)
  %2 = ptrtoint i8* %1 to i64
  store i64 %2, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %3 = tail call noalias i8* @_Znwm(i64 4)
  %4 = ptrtoint i8* %3 to i64
  ret i64 %4
}

declare noalias i8* @_Znwm(i64)

define i64 @_Z4foo2v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 1)
  %2 = ptrtoint i8* %1 to i64
  %3 = or i64 %2, 2
  store i64 %3, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %4 = tail call noalias i8* @_Znwm(i64 1)
  %5 = ptrtoint i8* %4 to i64
  %6 = or i64 %5, 2
  ret i64 %6
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169147 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify this test a bit because DWARF emission/dumping on some platforms
Eli Bendersky [Mon, 3 Dec 2012 19:58:12 +0000 (19:58 +0000)]
Simplify this test a bit because DWARF emission/dumping on some platforms
is not yet good enough for more sophistication. The important goal of this
test is to make sure llc doesn't crash on this IR like it used to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169146 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd 'getInt64Field()' method to get the signed integer instead of unsigned.
Bill Wendling [Mon, 3 Dec 2012 19:44:25 +0000 (19:44 +0000)]
Add 'getInt64Field()' method to get the signed integer instead of unsigned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169145 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoASan: add blacklist file to ASan pass options. Clang patch for this will follow.
Alexey Samsonov [Mon, 3 Dec 2012 19:09:26 +0000 (19:09 +0000)]
ASan: add blacklist file to ASan pass options. Clang patch for this will follow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169143 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix PR12942: Allow two CUs to be generated from the same source file.
Eli Bendersky [Mon, 3 Dec 2012 18:45:45 +0000 (18:45 +0000)]
Fix PR12942: Allow two CUs to be generated from the same source file.

Thanks Eric for the review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169142 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach the jump threading optimization to stop scanning the basic block when calculati...
Nadav Rotem [Mon, 3 Dec 2012 17:34:44 +0000 (17:34 +0000)]
Teach the jump threading optimization to stop scanning the basic block when calculating the cost after passing the threshold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169135 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r169039, "Aggregate pass execution time report by pass ID instead of pass...
Jakob Stoklund Olesen [Mon, 3 Dec 2012 17:31:11 +0000 (17:31 +0000)]
Revert r169039, "Aggregate pass execution time report by pass ID instead of pass instance."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169134 91177308-0d34-0410-b5e6-96231b3b80d8