oota-llvm.git
12 years agoAdd test/MC/Mips/dg.exp.
Akira Hatanaka [Tue, 13 Dec 2011 04:12:49 +0000 (04:12 +0000)]
Add test/MC/Mips/dg.exp.

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

12 years agoMove direct object emitter test to directory test/MC/Mips. Rename it to
Akira Hatanaka [Tue, 13 Dec 2011 03:50:34 +0000 (03:50 +0000)]
Move direct object emitter test to directory test/MC/Mips. Rename it to
elf-relsym.ll.

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

12 years agoExpand .cprestore directive to multiple instructions if the offset does not fit
Akira Hatanaka [Tue, 13 Dec 2011 03:09:05 +0000 (03:09 +0000)]
Expand .cprestore directive to multiple instructions if the offset does not fit
in a 16-bit field.

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

12 years agoRelocation against a symbol, instead of against section. We had some extreme
Akira Hatanaka [Tue, 13 Dec 2011 02:27:40 +0000 (02:27 +0000)]
Relocation against a symbol, instead of against section. We had some extreme
test cases where there were a lot of relocations applied relative to a large
rodata section. Gas would create a symbol for each of these whereas we would
be relative to the beginning of the rodata section. This change mimics what
gas does.

Patch by Jack Carter.

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

12 years agoDon't default the *cached* list of targets to build to an explicit list
Chandler Carruth [Tue, 13 Dec 2011 02:19:11 +0000 (02:19 +0000)]
Don't default the *cached* list of targets to build to an explicit list
of the targets we know about. Because this is cached, rebuilds won't
detect when new targets show up. It's also a bit simpler to just say
"all". If users want to restrict the target set, they can still do so,
and then the cache will preserve what they have explicitly set this
field to.

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

12 years agoInitial CodeGen support for CTTZ/CTLZ where a zero input produces an
Chandler Carruth [Tue, 13 Dec 2011 01:56:10 +0000 (01:56 +0000)]
Initial CodeGen support for CTTZ/CTLZ where a zero input produces an
undefined result. This adds new ISD nodes for the new semantics,
selecting them when the LLVM intrinsic indicates that the undef behavior
is desired. The new nodes expand trivially to the old nodes, so targets
don't actually need to do anything to support these new nodes besides
indicating that they should be expanded. I've done this for all the
operand types that I could figure out for all the targets. Owners of
various targets, please review and let me know if any of these are
incorrect.

Note that the expand behavior is *conservatively correct*, and exactly
matches LLVM's current behavior with these operations. Ideally this
patch will not change behavior in any way. For example the regtest suite
finds the exact same instruction sequences coming out of the code
generator. That's why there are no new tests here -- all of this is
being exercised by the existing test suite.

Thanks to Duncan Sands for reviewing the various bits of this patch and
helping me get the wrinkles ironed out with expanding for each target.
Also thanks to Chris for clarifying through all the discussions that
this is indeed the approach he was looking for. That said, there are
likely still rough spots. Further review much appreciated.

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

12 years agoUse the example from clang, not the GCC frontend, which doesn't exist anymore.
Bill Wendling [Tue, 13 Dec 2011 01:07:07 +0000 (01:07 +0000)]
Use the example from clang, not the GCC frontend, which doesn't exist anymore.

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

12 years agoCleanup. Clarify LSRInstance public methods.
Andrew Trick [Tue, 13 Dec 2011 00:55:33 +0000 (00:55 +0000)]
Cleanup. Clarify LSRInstance public methods.

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

12 years agoAccount for CPE alignment when searching for new water.
Jakob Stoklund Olesen [Tue, 13 Dec 2011 00:44:30 +0000 (00:44 +0000)]
Account for CPE alignment when searching for new water.

Constant pool entries with different alignment may cause more alignment
padding to be inserted. Compute the amount of padding needed, and try to
pick the location that requires the least amount of padding.

Also take the extra padding into account when the water is above the
use.

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

12 years agoTarget/Hexagon: Fix CMake build. We don't use add_llvm_library_dependencies().
NAKAMURA Takumi [Tue, 13 Dec 2011 00:36:04 +0000 (00:36 +0000)]
Target/Hexagon: Fix CMake build. We don't use add_llvm_library_dependencies().

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

12 years agoDon't rely on a particular version string for llvm.
Nick Lewycky [Tue, 13 Dec 2011 00:34:14 +0000 (00:34 +0000)]
Don't rely on a particular version string for llvm.

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

12 years agoTemporarily disable Hexagon tests. They are failing on OS X
Tony Linthicum [Tue, 13 Dec 2011 00:33:45 +0000 (00:33 +0000)]
Temporarily disable Hexagon tests.  They are failing on OS X

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

12 years ago[fast-isel] Guard "exhastive" fast-isel output with -fast-isel-verbose2.
Chad Rosier [Tue, 13 Dec 2011 00:05:11 +0000 (00:05 +0000)]
[fast-isel] Guard "exhastive" fast-isel output with -fast-isel-verbose2.

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

12 years agoAdd BitcodeVerifier.cpp to CMakeList.
Chad Rosier [Mon, 12 Dec 2011 23:11:26 +0000 (23:11 +0000)]
Add BitcodeVerifier.cpp to CMakeList.

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

12 years agoFix unused value warning for value used only in assert.
Nick Lewycky [Mon, 12 Dec 2011 22:59:34 +0000 (22:59 +0000)]
Fix unused value warning for value used only in assert.

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

12 years agoBegin sketching out a bitcode verifier pass. Idea is to emit a .bc file and
Chad Rosier [Mon, 12 Dec 2011 22:57:31 +0000 (22:57 +0000)]
Begin sketching out a bitcode verifier pass.  Idea is to emit a .bc file and
then read the file back in to verify use-list serialization/deserialization.

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

12 years agoIndvars: guard against exponential behavior in isHighCostExpansion.
Andrew Trick [Mon, 12 Dec 2011 22:46:16 +0000 (22:46 +0000)]
Indvars: guard against exponential behavior in isHighCostExpansion.

This should always be done as a matter of principal. I don't have a
case that exposes the problem. I just noticed this recently while
scanning the code and realized I meant to fix it long ago.

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

12 years agollvm-build: Switch to using the common subdirectory list instead of
Daniel Dunbar [Mon, 12 Dec 2011 22:45:59 +0000 (22:45 +0000)]
llvm-build: Switch to using the common subdirectory list instead of
autodiscovery.

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

12 years agoLLVMBuild: Introduce a common section which currently has a list of the
Daniel Dunbar [Mon, 12 Dec 2011 22:45:54 +0000 (22:45 +0000)]
LLVMBuild: Introduce a common section which currently has a list of the
subdirectories to traverse into.
 - Originally I wanted to avoid this and just autoscan, but this has one key
   flaw in that new subdirectories can not automatically trigger a rerun of the
   llvm-build tool. This is particularly a pain when switching back and forth
   between trees where one has added a subdirectory, as the dependencies will
   tend to be wrong. This will also eliminates FIXME implicitly.

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

12 years agollvm-build: Don't write out the required_libraries list for "special" components...
Daniel Dunbar [Mon, 12 Dec 2011 22:45:41 +0000 (22:45 +0000)]
llvm-build: Don't write out the required_libraries list for "special" components, it is generated.

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

12 years agollvm-build: Add sketchy support for preserving comments when using
Daniel Dunbar [Mon, 12 Dec 2011 22:45:35 +0000 (22:45 +0000)]
llvm-build: Add sketchy support for preserving comments when using
--write-llvmbuild.

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

12 years agoTest case for r146432 by Jack Carter.
Akira Hatanaka [Mon, 12 Dec 2011 22:41:39 +0000 (22:41 +0000)]
Test case for r146432 by Jack Carter.

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

12 years agoEmit B (unconditional branch) when -relocation-model=pic and J (jump) when
Akira Hatanaka [Mon, 12 Dec 2011 22:39:35 +0000 (22:39 +0000)]
Emit B (unconditional branch) when -relocation-model=pic and J (jump) when
-relocation-model=static.

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

12 years agoFix indentation.
Akira Hatanaka [Mon, 12 Dec 2011 22:38:19 +0000 (22:38 +0000)]
Fix indentation.

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

12 years agoFixed register allocator splitting a live range on a spilling variable.
Pete Cooper [Mon, 12 Dec 2011 22:16:27 +0000 (22:16 +0000)]
Fixed register allocator splitting a live range on a spilling variable.

If we create new intervals for a variable that is being spilled, then those new intervals are not guaranteed to also spill.  This means that anything reading from the original spilling value might not get the correct value if spills were missed.

Fixes <rdar://problem/10546864>

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

12 years agofix warning
Tony Linthicum [Mon, 12 Dec 2011 21:52:59 +0000 (21:52 +0000)]
fix warning

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

12 years agoImplement 'e' and 'f' modifiers for Neon inline asm. <rdar://problem/10551006>
Bob Wilson [Mon, 12 Dec 2011 21:45:15 +0000 (21:45 +0000)]
Implement 'e' and 'f' modifiers for Neon inline asm.  <rdar://problem/10551006>

These modifiers simply select either the low or high D subregister of a Neon
Q register.  I've also removed the unimplemented 'p' modifier, which turns out
to be a bit different than the comment here suggests and as far as I can tell
was only intended for internal use in Apple's version of gcc.

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

12 years agoHexagon backend support
Tony Linthicum [Mon, 12 Dec 2011 21:14:40 +0000 (21:14 +0000)]
Hexagon backend support

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

12 years agoOnly replace fwrite with fputc, if the return value is unused.
Joerg Sonnenberger [Mon, 12 Dec 2011 20:18:31 +0000 (20:18 +0000)]
Only replace fwrite with fputc, if the return value is unused.

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

12 years agoLLVMBuild: Remove trailing newline, which irked me.
Daniel Dunbar [Mon, 12 Dec 2011 19:48:00 +0000 (19:48 +0000)]
LLVMBuild: Remove trailing newline, which irked me.

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

12 years agoWhen computing reverse-CFG reverse-post-order, skip backedges, as
Dan Gohman [Mon, 12 Dec 2011 19:42:25 +0000 (19:42 +0000)]
When computing reverse-CFG reverse-post-order, skip backedges, as
detected in the forward-CFG DFS. This prevents the reverse-CFG from
visiting blocks inside loops after blocks that dominate them in the
case where loops have multiple exits.

No testcase, because this fixes a bug which in practice only shows
up in a full optimizer run, due to the use-list order.

This fixes rdar://10422791 and others.

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

12 years agoXOP instructions and encoding tests.
Jan Sjödin [Mon, 12 Dec 2011 19:37:49 +0000 (19:37 +0000)]
XOP instructions and encoding tests.

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

12 years agoAdd a postOffset() alignment argument.
Jakob Stoklund Olesen [Mon, 12 Dec 2011 19:25:54 +0000 (19:25 +0000)]
Add a postOffset() alignment argument.

This computes the offset of the layout sucessor block, considering its
alignment as well.

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

12 years agoFix typo.
Jakob Stoklund Olesen [Mon, 12 Dec 2011 19:25:51 +0000 (19:25 +0000)]
Fix typo.

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

12 years agoXOP encoding bits and logic.
Jan Sjödin [Mon, 12 Dec 2011 19:12:26 +0000 (19:12 +0000)]
XOP encoding bits and logic.

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

12 years agoAlso set the proper alignment on inner islands and the function itself.
Jakob Stoklund Olesen [Mon, 12 Dec 2011 18:45:45 +0000 (18:45 +0000)]
Also set the proper alignment on inner islands and the function itself.

Downgrade the alignment of the initial constant island when constant
pool entries are moved elsewhere.

This is all gated by -arm-align-constant-islands.

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

12 years agoAdd a TODO comment.
Dan Gohman [Mon, 12 Dec 2011 18:30:26 +0000 (18:30 +0000)]
Add a TODO comment.

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

12 years agollvm-config: Default to "all" if no components are specified.
Daniel Dunbar [Mon, 12 Dec 2011 18:22:04 +0000 (18:22 +0000)]
llvm-config: Default to "all" if no components are specified.
 - Fixes PR11530.

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

12 years agoFix a copy+pasto in a comment.
Dan Gohman [Mon, 12 Dec 2011 18:20:00 +0000 (18:20 +0000)]
Fix a copy+pasto in a comment.

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

12 years agoUse getArgOperand instead of getOperand on a call.
Dan Gohman [Mon, 12 Dec 2011 18:19:12 +0000 (18:19 +0000)]
Use getArgOperand instead of getOperand on a call.

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

12 years agoInline SetSeqToRelease into its only caller, since it's more clear that way.
Dan Gohman [Mon, 12 Dec 2011 18:16:56 +0000 (18:16 +0000)]
Inline SetSeqToRelease into its only caller, since it's more clear that way.

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

12 years agoMake MF a class member instead of passing it around everywhere.
Jakob Stoklund Olesen [Mon, 12 Dec 2011 18:16:53 +0000 (18:16 +0000)]
Make MF a class member instead of passing it around everywhere.

Also add an MCP member pointing to the machine constant pool.

No functional change intended.

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

12 years agoFix omitted break statements in a switch.
Dan Gohman [Mon, 12 Dec 2011 18:13:53 +0000 (18:13 +0000)]
Fix omitted break statements in a switch.

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

12 years ago[asan] use .preinit_array only on linux
Kostya Serebryany [Mon, 12 Dec 2011 18:01:46 +0000 (18:01 +0000)]
[asan] use .preinit_array only on linux

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

12 years agoRevert r146363 to allow buildbots to make forward progress.
Chad Rosier [Mon, 12 Dec 2011 17:58:31 +0000 (17:58 +0000)]
Revert r146363 to allow buildbots to make forward progress.

Original commit message:
Support/FileSystem: Implement canonicalize.

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

12 years agoAdd support for gnu_indirect_function.
Roman Divacky [Mon, 12 Dec 2011 17:34:04 +0000 (17:34 +0000)]
Add support for gnu_indirect_function.

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

12 years agoAdd a -arm-align-constant-islands flag, default off.
Jakob Stoklund Olesen [Mon, 12 Dec 2011 16:49:37 +0000 (16:49 +0000)]
Add a -arm-align-constant-islands flag, default off.

Order constant pool entries by descending alignment in the initial
island to ensure packing and correct alignment.  When the command line
flag is set, also align the basic block containing the constant pool
entries.

This is only a partial implementation of constant island alignment. More
to come.

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

12 years agoExtract a method.
Jakob Stoklund Olesen [Mon, 12 Dec 2011 16:16:24 +0000 (16:16 +0000)]
Extract a method.

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

12 years agocmake: work with CMake < 2.8.5
Dylan Noblesmith [Mon, 12 Dec 2011 13:06:25 +0000 (13:06 +0000)]
cmake: work with CMake < 2.8.5

CMake versions 2.8.4 and earlier were giving this error since r146323:
"string end index: -1 is out of range 0 - 6"

Passing -1 as the length of the desired substring was a new feature
added in CMake 2.8.5:
http://www.cmake.org/Bug/view.php?id=10740

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

12 years agoManually upgrade the test suite to specify the flag to cttz and ctlz.
Chandler Carruth [Mon, 12 Dec 2011 11:59:10 +0000 (11:59 +0000)]
Manually upgrade the test suite to specify the flag to cttz and ctlz.
I followed three heuristics for deciding whether to set 'true' or
'false':

- Everything target independent got 'true' as that is the expected
  common output of the GCC builtins.
- If the target arch only has one way of implementing this operation,
  set the flag in the way that exercises the most of codegen. For most
  architectures this is also the likely path from a GCC builtin, with
  'true' being set. It will (eventually) require lowering away that
  difference, and then lowering to the architecture's operation.
- Otherwise, set the flag differently dependending on which target
  operation should be tested.

Let me know if anyone has any issue with this pattern or would like
specific tests of another form. This should allow the x86 codegen to
just iteratively improve as I teach the backend how to differentiate
between the two forms, and everything else should remain exactly the
same.

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

12 years agoAdd an explicit test of the auto-upgrade functionality for the new
Chandler Carruth [Mon, 12 Dec 2011 11:23:11 +0000 (11:23 +0000)]
Add an explicit test of the auto-upgrade functionality for the new
intrinsic syntax.

Now that this is explicitly covered, I plan to upgrade the existing test
suite to use an explicit immediate. Note that I plan to specify 'true'
in most places rather than the auto-upgraded value as that is the far
more common value to end up here as that is the value coming from GCC's
builtins. The only place I'm likely to put a 'false' in is when testing
x86 which actually has different instructions for the two variants.

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

12 years agoDon't rely in there being one argument before we've actually identified
Chandler Carruth [Mon, 12 Dec 2011 10:57:20 +0000 (10:57 +0000)]
Don't rely in there being one argument before we've actually identified
a function to upgrade. Also, simplify the code a bit at the expense of
one line.

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

12 years agoSupport/FileSystem: Implement bool equivalent(file_status A, file_status B);
Michael J. Spencer [Mon, 12 Dec 2011 06:04:28 +0000 (06:04 +0000)]
Support/FileSystem: Implement bool equivalent(file_status A, file_status B);

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

12 years agoSupport/FileSystem: Implement canonicalize.
Michael J. Spencer [Mon, 12 Dec 2011 06:04:01 +0000 (06:04 +0000)]
Support/FileSystem: Implement canonicalize.

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

12 years agoSupport/Windows: Cleanup scoped handles.
Michael J. Spencer [Mon, 12 Dec 2011 06:03:33 +0000 (06:03 +0000)]
Support/Windows: Cleanup scoped handles.

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

12 years agoUpdate the LangRef documentation for llvm.ctlz and llvm.cttz to specify
Chandler Carruth [Mon, 12 Dec 2011 04:36:04 +0000 (04:36 +0000)]
Update the LangRef documentation for llvm.ctlz and llvm.cttz to specify
the behavior with the newly added flag for undefined results on a zero
input.

I'm terrible at documentation, so comments and suggestions welcome here.

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

12 years agoTeach the verifier to reject all non-constant arguments to the second
Chandler Carruth [Mon, 12 Dec 2011 04:36:02 +0000 (04:36 +0000)]
Teach the verifier to reject all non-constant arguments to the second
argument of the cttz and ctlz intrinsics.

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

12 years agoSwitch llvm.cttz and llvm.ctlz to accept a second i1 parameter which
Chandler Carruth [Mon, 12 Dec 2011 04:26:04 +0000 (04:26 +0000)]
Switch llvm.cttz and llvm.ctlz to accept a second i1 parameter which
indicates whether the intrinsic has a defined result for a first
argument equal to zero. This will eventually allow these intrinsics to
accurately model the semantics of GCC's __builtin_ctz and __builtin_clz
and the X86 instructions (prior to AVX) which implement them.

This patch merely sets the stage by extending the signature of these
intrinsics and establishing auto-upgrade logic so that the old spelling
still works both in IR and in bitcode. The upgrade logic preserves the
existing (inefficient) semantics. This patch should not change any
behavior. CodeGen isn't updated because it can use the existing
semantics regardless of the flag's value.

Note that this will be followed by API updates to Clang and DragonEgg.

Reviewed by Nick Lewycky!

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

12 years agore-enable unittest
Dylan Noblesmith [Mon, 12 Dec 2011 04:20:41 +0000 (04:20 +0000)]
re-enable unittest

Accidentally left out since r145214/r145217.

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

12 years agoExecutionEngine: refactor interface
Dylan Noblesmith [Mon, 12 Dec 2011 04:20:36 +0000 (04:20 +0000)]
ExecutionEngine: refactor interface

The OptLevel is now redundant with the TargetMachine*.
And selectTarget() isn't really JIT-specific and could probably
get refactored into one of the lower level libraries.

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

12 years agoRemove some remants of the old palign pattern fragment that were still hanging around...
Craig Topper [Sun, 11 Dec 2011 19:12:35 +0000 (19:12 +0000)]
Remove some remants of the old palign pattern fragment that were still hanging around. Also remove a cast from inside getShuffleVPERM2X128Immediate and getShuffleVPERMILPImmediate since the only caller already had done the cast.

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

12 years agoFixed bug 9905: Failure in code selection for llvm intrinsics sqrt/exp (fix for FSQRT...
Stepan Dyatkovskiy [Sun, 11 Dec 2011 14:35:48 +0000 (14:35 +0000)]
Fixed bug 9905: Failure in code selection for llvm intrinsics sqrt/exp (fix for FSQRT, FSIN, FCOS, FPOWI, FPOW, FLOG, FLOG2, FLOG10, FEXP, FEXP2). Third attempt: simplified checks in test for armv7-apple-darwin11.

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

12 years agoMips: Don't create a dangling IR function just to get the address of a symbol.
Benjamin Kramer [Sun, 11 Dec 2011 12:21:34 +0000 (12:21 +0000)]
Mips: Don't create a dangling IR function just to get the address of a symbol.

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

12 years agollvm/CMakeLists.txt: Fix LLVM_LIT_TOOLS_DIR since r143728. Cygwin does not need optio...
NAKAMURA Takumi [Sun, 11 Dec 2011 03:07:53 +0000 (03:07 +0000)]
llvm/CMakeLists.txt: Fix LLVM_LIT_TOOLS_DIR since r143728. Cygwin does not need optional tools dir. MSVC and mingw may need one.

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

12 years agoAlso remove unnecessary includes from this file, which was supposed to be part
Nick Lewycky [Sun, 11 Dec 2011 00:45:13 +0000 (00:45 +0000)]
Also remove unnecessary includes from this file, which was supposed to be part
of r146334!

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

12 years agoMinimize #include's and forward-declares in Target.
Nick Lewycky [Sat, 10 Dec 2011 22:35:47 +0000 (22:35 +0000)]
Minimize #include's and forward-declares in Target.

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

12 years agoRefactor the implementation of the TargetOptions out of TargetMachine, taking
Nick Lewycky [Sat, 10 Dec 2011 22:34:41 +0000 (22:34 +0000)]
Refactor the implementation of the TargetOptions out of TargetMachine, taking
the only parts of TM that depends on CodeGen headers with it.

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

12 years agoDon't assume things about the exact details of the LLVM version number,
Chandler Carruth [Sat, 10 Dec 2011 21:40:31 +0000 (21:40 +0000)]
Don't assume things about the exact details of the LLVM version number,
such as what VCS information is attached.

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

12 years agoRevert associate SelectInsertValue test as well.
Chad Rosier [Sat, 10 Dec 2011 21:34:28 +0000 (21:34 +0000)]
Revert associate SelectInsertValue test as well.

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

12 years ago[fast-isel] SelectInsertValue seems to be causing miscompiles for ARM. Disable while...
Chad Rosier [Sat, 10 Dec 2011 21:27:40 +0000 (21:27 +0000)]
[fast-isel] SelectInsertValue seems to be causing miscompiles for ARM.  Disable while I investigate.

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

12 years agoRevert r146322 to appease buildbots. Original commit message:
Chad Rosier [Sat, 10 Dec 2011 19:55:03 +0000 (19:55 +0000)]
Revert r146322 to appease buildbots.  Original commit message:

Fixed bug 9905: Failure in code selection for llvm intrinsics sqrt/exp (fix for
FSQRT, FSIN, FCOS, FPOWI, FPOW, FLOG, FLOG2, FLOG10, FEXP, FEXP2). Second
attempt.

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

12 years agoTypo.
Chad Rosier [Sat, 10 Dec 2011 19:48:51 +0000 (19:48 +0000)]
Typo.

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

12 years agoUse a simpler and more reliable command for converting from HEAD to
Chandler Carruth [Sat, 10 Dec 2011 10:18:47 +0000 (10:18 +0000)]
Use a simpler and more reliable command for converting from HEAD to
commit-ish. Funny thing, they have a command designed for this. ;]

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

12 years agoTeach the VCS detection to set some root-level variables with the raw
Chandler Carruth [Sat, 10 Dec 2011 10:04:38 +0000 (10:04 +0000)]
Teach the VCS detection to set some root-level variables with the raw
revision and git commit data extracted. This will be used in the Clang
CMake build to avoid trying to re-detect the information.

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

12 years agoAt the request of Michael Spencer, make the VCS version detection logic
Chandler Carruth [Sat, 10 Dec 2011 09:41:13 +0000 (09:41 +0000)]
At the request of Michael Spencer, make the VCS version detection logic
in CMake a bit more handy. Previously we would get such charming
versions as the following for revision NNNN and commit-ish XXXXX:
  3.1svnsvn-rNNNN
  3.1svngit-svn-rNNNN
  3.1svngit-svn-XXXXX

The mechanism selecting betwene the latter two was particularly odd, and
didn't work with all of the ways git-svn repos are set up apparently. It
also misses an important point -- both the revision *and* the git commit
might be relevant when working on a local branch some distance from
mainline. The new logic does several things:

1) It strips the redundant initial 'svn'.
2) It always looks for a git-svn revision number base, and when found
   includes it in the version.
3) If the git commit-ish for the current HEAD is not exactly that
   revision number, it is also included.

The resulting strings should roughly be:
  3.1svn-rNNNN
  3.1git-svn-rNNNN
  3.1git-svn-rNNNN-XXXXX

Suggestions on formatting etc always welcome. =] I've only looked at the
LLVM version string here, not Clang's (yet).

Note that the commit-ish reported is *not* terribly accurate. It updates
when 'cmake' is run, not when the binary is built. Still, it may be
better than nothing, especially if people have fairly long-lived git
repos and branches. This is not a new limitation, just didn't want
anyone to be surprised.

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

12 years agoFixed bug 9905: Failure in code selection for llvm intrinsics sqrt/exp (fix for FSQRT...
Stepan Dyatkovskiy [Sat, 10 Dec 2011 08:42:24 +0000 (08:42 +0000)]
Fixed bug 9905: Failure in code selection for llvm intrinsics sqrt/exp (fix for FSQRT, FSIN, FCOS, FPOWI, FPOW, FLOG, FLOG2, FLOG10, FEXP, FEXP2). Second attempt.

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

12 years agoMake CR spill and restore use a reserved register. These operations cannot use the...
Hal Finkel [Sat, 10 Dec 2011 04:50:53 +0000 (04:50 +0000)]
Make CR spill and restore use a reserved register. These operations cannot use the register scavenger because the scavenger can only scavenge one register and frame-index elimination may have already grabbed it.

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

12 years agoFix typo, reported by Eitan Adler!
Nick Lewycky [Sat, 10 Dec 2011 03:16:20 +0000 (03:16 +0000)]
Fix typo, reported by Eitan Adler!

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

12 years agoTry to align the point where a large basic block is split.
Jakob Stoklund Olesen [Sat, 10 Dec 2011 02:55:10 +0000 (02:55 +0000)]
Try to align the point where a large basic block is split.

The split point is picked such that the newly created water has the same
alignment as the function. This makes the island suitable for constant
pool entries with potentially higher alignment.

This also fixes an issue where the basic block was split one instruction
too late, causing nonconvergence of the algorithm.

<rdar://problem/10550705>

There is still an issue with correctly packing differently aligned
entries in the island.

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

12 years agoMore debug output formatting.
Jakob Stoklund Olesen [Sat, 10 Dec 2011 02:55:06 +0000 (02:55 +0000)]
More debug output formatting.

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

12 years agoHandle expressions of the form _GLOBAL_OFFSET_TABLE_-symbol the same way gas
Rafael Espindola [Sat, 10 Dec 2011 02:28:43 +0000 (02:28 +0000)]
Handle expressions of the form _GLOBAL_OFFSET_TABLE_-symbol the same way gas
does. The _GLOBAL_OFFSET_TABLE_ is still magical in that we get a R_386_GOTPC,
but it doesn't change the immediate in the same way as when the expression
has no right hand side symbol.

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

12 years agoLSR: ignore strides in outer loops.
Andrew Trick [Sat, 10 Dec 2011 00:25:00 +0000 (00:25 +0000)]
LSR: ignore strides in outer loops.

Since we're not rewriting IVs in other loops, there's not much reason
to consider their stride when generating formulae.
This should reduce the number of useless formulas considered by LSR.

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

12 years agoARM add some more pre-UAL VFP mnemonics for convenience when porting old code.
Jim Grosbach [Sat, 10 Dec 2011 00:01:02 +0000 (00:01 +0000)]
ARM add some more pre-UAL VFP mnemonics for convenience when porting old code.

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

12 years agoSplats can contain undef's; make sure to handle them correctly. PR11526.
Eli Friedman [Fri, 9 Dec 2011 23:54:42 +0000 (23:54 +0000)]
Splats can contain undef's; make sure to handle them correctly.  PR11526.

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

12 years agoARM add some pre-UAL VFP mnemonics for convenience when porting old code.
Jim Grosbach [Fri, 9 Dec 2011 23:34:09 +0000 (23:34 +0000)]
ARM add some pre-UAL VFP mnemonics for convenience when porting old code.

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

12 years agounittests/Support/Path.cpp: [recursive_directory_iterator] Work around for end iterator.
NAKAMURA Takumi [Fri, 9 Dec 2011 23:20:03 +0000 (23:20 +0000)]
unittests/Support/Path.cpp: [recursive_directory_iterator] Work around for end iterator.

FIXME: It should be more robust.

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

12 years agoAdd dump method for debugging.
Bill Wendling [Fri, 9 Dec 2011 23:18:34 +0000 (23:18 +0000)]
Add dump method for debugging.

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

12 years agoRandom cleanups. No description changes.
Bill Wendling [Fri, 9 Dec 2011 22:41:40 +0000 (22:41 +0000)]
Random cleanups. No description changes.

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

12 years agoARM allows '' syntax, not just '#imm' for assembly.
Jim Grosbach [Fri, 9 Dec 2011 22:25:03 +0000 (22:25 +0000)]
ARM allows '' syntax, not just '#imm' for assembly.

Backwards compatibility with 'gas'. #imm is the preferered and documented
syntax, but lots of existing code uses the '$' prefix, so we should
support it if we can.

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

12 years ago[asan] call __asan_init from .preinit_array. This simplifies __asan_init vs malloc...
Kostya Serebryany [Fri, 9 Dec 2011 22:09:32 +0000 (22:09 +0000)]
[asan] call __asan_init from .preinit_array. This simplifies __asan_init vs malloc chicken-and-egg situation on Android and probably on other flavours of Linux. Patch by eugenis@google.com.

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

12 years agoARM assembly aliases for BIC<-->AND (immediate).
Jim Grosbach [Fri, 9 Dec 2011 22:02:17 +0000 (22:02 +0000)]
ARM assembly aliases for BIC<-->AND (immediate).

When the immediate operand of an AND or BIC instruction isn't representable
in the immediate field of the instruction, but the bitwise negation of the
immediate is, assemble the instruction as the inverse operation instead
with the inverted immediate as the operand.

rdar://10550057

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

12 years agoUpdate test to something more sensible.
Evan Cheng [Fri, 9 Dec 2011 21:54:10 +0000 (21:54 +0000)]
Update test to something more sensible.

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

12 years agoARM NEON data type aliases for VBIC(register).
Jim Grosbach [Fri, 9 Dec 2011 21:46:04 +0000 (21:46 +0000)]
ARM NEON data type aliases for VBIC(register).

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

12 years agoARM assembly parsing and encoding for VLD2 with writeback.
Jim Grosbach [Fri, 9 Dec 2011 21:28:25 +0000 (21:28 +0000)]
ARM assembly parsing and encoding for VLD2 with writeback.

Refactor the instructions into fixed writeback and register-stride
writeback variants to simplify the offset operand (no more optional
register operand using reg0). This is a simpler representation and allows
the assembly parser to more easily handle these instructions.

Add tests for the instruction variants now supported.

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

12 years agoSplitBlockPredecessors uses ArrayRef instead of Data and Size.
Jakub Staszak [Fri, 9 Dec 2011 21:19:53 +0000 (21:19 +0000)]
SplitBlockPredecessors uses ArrayRef instead of Data and Size.

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

12 years ago[fast-isel] Add support for selecting insertvalue.
Chad Rosier [Fri, 9 Dec 2011 20:09:54 +0000 (20:09 +0000)]
[fast-isel] Add support for selecting insertvalue.
rdar://10530851

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

12 years agoHandle reloc_signed_4byte in here. Not doing so was a regression from my
Rafael Espindola [Fri, 9 Dec 2011 19:57:29 +0000 (19:57 +0000)]
Handle reloc_signed_4byte in here. Not doing so was a regression from my
previous commit. It is strange that we see it in 32 bits. We already
have a fixme about it.

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

12 years agoUser a helper overload for a common pattern.
Jakob Stoklund Olesen [Fri, 9 Dec 2011 19:44:39 +0000 (19:44 +0000)]
User a helper overload for a common pattern.

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

12 years agoRevert r146041 et al. The FunctionPass doesn't take an address but the ID.
Bill Wendling [Fri, 9 Dec 2011 19:11:02 +0000 (19:11 +0000)]
Revert r146041 et al. The FunctionPass doesn't take an address but the ID.

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

12 years agoTidy up. Better base class factoring.
Jim Grosbach [Fri, 9 Dec 2011 19:07:20 +0000 (19:07 +0000)]
Tidy up. Better base class factoring.

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