oota-llvm.git
11 years agoRemove some introspection functions.
Bill Wendling [Fri, 25 Jan 2013 23:09:36 +0000 (23:09 +0000)]
Remove some introspection functions.

The 'getSlot' function and its ilk allow introspection into the AttributeSet
class. However, that class should be opaque. Allow access through accessor
methods instead.

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

11 years agoInitial implementation of PPCTargetTransformInfo
Hal Finkel [Fri, 25 Jan 2013 23:05:59 +0000 (23:05 +0000)]
Initial implementation of PPCTargetTransformInfo

This provides a place to add customized operation cost information and
control some other target-specific IR-level transformations.

The only non-trivial logic in this checkin assigns a higher cost to
unaligned loads and stores (covered by the included test case).

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

11 years agoFix a warning in the new DWARFheader. Add a new line at the end of the file.
Nadav Rotem [Fri, 25 Jan 2013 22:57:05 +0000 (22:57 +0000)]
Fix a warning in the new DWARFheader. Add a new line at the end of the file.

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

11 years agoAdd support for applying in-memory relocations to the .debug_line section and, in...
Andrew Kaylor [Fri, 25 Jan 2013 22:50:58 +0000 (22:50 +0000)]
Add support for applying in-memory relocations to the .debug_line section and, in the case of ELF files, using symbol addresses when available for relocations to the .debug_info section.  Also extending the llvm-rtdyld tool to add the ability to dump line number information for testing purposes.

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

11 years agoAdd file to CMakeLists (file added in r173505)
Dmitri Gribenko [Fri, 25 Jan 2013 22:29:23 +0000 (22:29 +0000)]
Add file to CMakeLists (file added in r173505)

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

11 years agoXFAIL close-stderr on win32
Reid Kleckner [Fri, 25 Jan 2013 22:12:54 +0000 (22:12 +0000)]
XFAIL close-stderr on win32

The test runner does not rewrite instances of /dev/null inside the
quoted sh command.  /dev/null does not exist, so opt will fail to open
it, and return a non-zero exit code.

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

11 years agoSet the +x bit on two batch scripts
Reid Kleckner [Fri, 25 Jan 2013 22:12:50 +0000 (22:12 +0000)]
Set the +x bit on two batch scripts

Cygwin git-svn will faithfully forward the svn properties all the way
down to the NTFS executable permission.  Without the +x bit, tests using
these scripts fail with "Access Denied".

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

11 years agoAdd parens to suppress an MSVC 2012 << precedence warning
Reid Kleckner [Fri, 25 Jan 2013 22:12:45 +0000 (22:12 +0000)]
Add parens to suppress an MSVC 2012 << precedence warning

It doesn't seem to like instantiating the isUInt<unsigned N> template
with 6+3, and then doing <<N.

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

11 years agoFileCheck-ify some grep tests
Reid Kleckner [Fri, 25 Jan 2013 22:11:46 +0000 (22:11 +0000)]
FileCheck-ify some grep tests

These tests in particular try to use escaped square brackets as an
argument to grep, which is failing for me with native win32 python.  It
appears the backslash is being lost near the CreateProcess*() call.

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

11 years agoAdd an insert() method to MapVector. Adds the first MapVector unit test.
Nick Lewycky [Fri, 25 Jan 2013 22:11:02 +0000 (22:11 +0000)]
Add an insert() method to MapVector. Adds the first MapVector unit test.

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

11 years agoIn this patch, we teach X86_64TargetMachine that it has a ILP32
Eli Bendersky [Fri, 25 Jan 2013 22:07:43 +0000 (22:07 +0000)]
In this patch, we teach X86_64TargetMachine that it has a ILP32
(defined by the x32 ABI) mode, in which case its pointers are 32-bits
in size. This knowledge is also added to X86RegisterInfo that now
returns the appropriate registers in getPointerRegClass.

There are many outcomes to this change. In order to keep the patches
separate and manageable, we start by focusing on some simple testable
cases. The patch adds a test with passing a pointer to a function -
focusing on the difference between the two data models for x86-64.
Another test is added for handling of 'sret' arguments (and
functionality is added in X86ISelLowering to make it work).

A note on naming: the "x32 ABI" document refers to the AMD64
architecture (in LLVM it's distinguished by being is64Bits() in the
x86 subtarget) with two variations: the LP64 (default) data model, and
the ILP32 data model. This patch adds predicates to the subtarget
which are consistent with this naming scheme.

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

11 years agoAdd back a RUN line removed by mistake by a previous commit
Eli Bendersky [Fri, 25 Jan 2013 21:58:09 +0000 (21:58 +0000)]
Add back a RUN line removed by mistake by a previous commit

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

11 years agoAdd instruction encodings / disassembly support for l4r instructions.
Richard Osborne [Fri, 25 Jan 2013 21:55:32 +0000 (21:55 +0000)]
Add instruction encodings / disassembly support for l4r instructions.

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

11 years agoLoopVectorize: Refactor the code that vectorizes loads/stores to remove duplication.
Nadav Rotem [Fri, 25 Jan 2013 21:47:42 +0000 (21:47 +0000)]
LoopVectorize: Refactor the code that vectorizes loads/stores to remove duplication.

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

11 years agoUse the new 'getSlotIndex' method to retrieve the attribute's slot index.
Bill Wendling [Fri, 25 Jan 2013 21:46:52 +0000 (21:46 +0000)]
Use the new 'getSlotIndex' method to retrieve the attribute's slot index.

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

11 years agoNow that llvm-dwarfdump supports flags to specify which DWARF section to dump,
Eli Bendersky [Fri, 25 Jan 2013 21:44:53 +0000 (21:44 +0000)]
Now that llvm-dwarfdump supports flags to specify which DWARF section to dump,
use them in tests that run llvm-dwarfdump. This is in order to make tests as
specific as possible.

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

11 years agoUse const reference instead of vector copying.
Jakub Staszak [Fri, 25 Jan 2013 21:44:27 +0000 (21:44 +0000)]
Use const reference instead of vector copying.

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

11 years agoAdd an accessor method to get the slot's index. This will limit the use of AttributeW...
Bill Wendling [Fri, 25 Jan 2013 21:30:53 +0000 (21:30 +0000)]
Add an accessor method to get the slot's index. This will limit the use of AttributeWithIndex.

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

11 years agoUse the correct format in the STW / SETPSC instruction names.
Richard Osborne [Fri, 25 Jan 2013 21:25:12 +0000 (21:25 +0000)]
Use the correct format in the STW / SETPSC instruction names.

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

11 years agoFix order of operands for crc8_l4r
Richard Osborne [Fri, 25 Jan 2013 21:20:28 +0000 (21:20 +0000)]
Fix order of operands for crc8_l4r

The order in which operands appear in the encoded instruction is different
to order in which they appear in assembly. This changes the XCore backend to
use the instruction encoding order.

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

11 years agoWhen encountering an unknown file format, ObjectFile::createObjectFile should
Eli Bendersky [Fri, 25 Jan 2013 20:53:41 +0000 (20:53 +0000)]
When encountering an unknown file format, ObjectFile::createObjectFile should
politely report it instead of running into llvm_unreachable.

Also patch llvm-dwarfdump to actually check whether the file it's attempting to
dump is a valid object file.

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

11 years agoThis is no trule.
David Blaikie [Fri, 25 Jan 2013 20:47:58 +0000 (20:47 +0000)]
This is no trule.

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

11 years agoImprove the !add TableGen test case.
Hal Finkel [Fri, 25 Jan 2013 20:29:25 +0000 (20:29 +0000)]
Improve the !add TableGen test case.

Suggested by Sean Silva.

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

11 years agoAdd command-line flags for DWARF dumping.
Eli Bendersky [Fri, 25 Jan 2013 20:26:43 +0000 (20:26 +0000)]
Add command-line flags for DWARF dumping.

Flags for dumping specific DWARF sections added in lib/DebugInfo and
llvm-dwarfdump.

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

11 years agoAdd instruction encodings / disassembly support for l5r instructions.
Richard Osborne [Fri, 25 Jan 2013 20:20:07 +0000 (20:20 +0000)]
Add instruction encodings / disassembly support for l5r instructions.

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

11 years agoFixed typo.
Michael Gottesman [Fri, 25 Jan 2013 20:20:00 +0000 (20:20 +0000)]
Fixed typo.

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

11 years agoFix order of operands for l5r instructions.
Richard Osborne [Fri, 25 Jan 2013 20:16:00 +0000 (20:16 +0000)]
Fix order of operands for l5r instructions.

With this change the operands order matches the order in which the operands
are encoded in the instruction.

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

11 years agoUse correct mnemonic / instruction name for ldivu.
Richard Osborne [Fri, 25 Jan 2013 20:11:26 +0000 (20:11 +0000)]
Use correct mnemonic / instruction name for ldivu.

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

11 years agoLoopVectorize: Simplify code. No functionality change.
Benjamin Kramer [Fri, 25 Jan 2013 19:43:15 +0000 (19:43 +0000)]
LoopVectorize: Simplify code. No functionality change.

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

11 years agoadded ability to dynamically change the ExportList of an already
Pedro Artigas [Fri, 25 Jan 2013 19:41:03 +0000 (19:41 +0000)]
added ability to dynamically change the ExportList of an already
created InternalizePass (useful for pass reuse)

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

11 years agoAdded new section to the git-svn getting started section that provides a
Michael Gottesman [Fri, 25 Jan 2013 19:31:09 +0000 (19:31 +0000)]
Added new section to the git-svn getting started section that provides a
custom git script called git-svnup which handles all of the work of
using the git-mirrors/keeping the git-svn numbers in sync.

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

11 years agoLoopVectorizer: Refactor more code to use the IRBuilder.
Nadav Rotem [Fri, 25 Jan 2013 19:26:23 +0000 (19:26 +0000)]
LoopVectorizer: Refactor more code to use the IRBuilder.

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

11 years agoUse xcrun to find the right compiler when building llvmCore. <rdar://12801151>
Bob Wilson [Fri, 25 Jan 2013 18:40:25 +0000 (18:40 +0000)]
Use xcrun to find the right compiler when building llvmCore. <rdar://12801151>

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

11 years agoRefactor some code to use the IRBuilder.
Nadav Rotem [Fri, 25 Jan 2013 18:34:09 +0000 (18:34 +0000)]
Refactor some code to use the IRBuilder.

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

11 years agoRename variable to be more comprehensible and follow naming convention
Eli Bendersky [Fri, 25 Jan 2013 17:06:42 +0000 (17:06 +0000)]
Rename variable to be more comprehensible and follow naming convention

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

11 years agoAPFloat: Make sure that we get a well-formed x87 NaN when converting from a smaller...
Benjamin Kramer [Fri, 25 Jan 2013 17:01:00 +0000 (17:01 +0000)]
APFloat: Make sure that we get a well-formed x87 NaN when converting from a smaller type.

Fixes PR15054.

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

11 years agoDisable MSVC's warning about noreturn destructors
Reid Kleckner [Fri, 25 Jan 2013 15:36:13 +0000 (15:36 +0000)]
Disable MSVC's warning about noreturn destructors

This warning fires on:
  Operator::~Operator() {
    llvm_unreachable("should never destroy an Operator");
  }

That seems like a false positive.  I don't see any good way to silence
the warning here, so I'm disabling it.

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

11 years agoFix MSVC 2012 warning about a 32-bit shift that should be 64-bit
Reid Kleckner [Fri, 25 Jan 2013 15:35:56 +0000 (15:35 +0000)]
Fix MSVC 2012 warning about a 32-bit shift that should be 64-bit

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

11 years ago[msan] A comment on ICmp handling logic.
Evgeniy Stepanov [Fri, 25 Jan 2013 15:35:29 +0000 (15:35 +0000)]
[msan] A comment on ICmp handling logic.

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

11 years ago[msan] Implement exact shadow propagation for relational ICmp.
Evgeniy Stepanov [Fri, 25 Jan 2013 15:31:10 +0000 (15:31 +0000)]
[msan] Implement exact shadow propagation for relational ICmp.

Only for integers, pointers, and vectors of those. No floats.
Instrumentation seems very heavy, and may need to be replaced
with some approximation in the future.

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

11 years agoThis patch aims to reduce compile time in LegalizeTypes by using SmallDenseMap,
Preston Gurd [Fri, 25 Jan 2013 15:18:54 +0000 (15:18 +0000)]
This patch aims to reduce compile time in LegalizeTypes by using SmallDenseMap,
with an initial number of elements,  instead of DenseMap, which has
zero initial elements, in order to avoid the copying of elements
when the size changes and to avoid allocating space every time
LegalizeTypes is run. This patch will not affect the memory footprint,
because DenseMap will increase the element size to 64
when the first element is added.

Patch by Wan Xiaofei.

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

11 years agoMore cleanup of PPC register definitions.
Hal Finkel [Fri, 25 Jan 2013 14:49:10 +0000 (14:49 +0000)]
More cleanup of PPC register definitions.

Uses the new !add TableGen operator to do more cleanup of the
PPC register definitions.

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

11 years agoAdd an addition operator to TableGen
Hal Finkel [Fri, 25 Jan 2013 14:49:08 +0000 (14:49 +0000)]
Add an addition operator to TableGen

This adds an !add(a, b) operator to tablegen; this will be used
to cleanup the PPC register definitions.

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

11 years agoFixed the condition codes for the atomic64 min/umin code generation on ARM. If the...
Silviu Baranga [Fri, 25 Jan 2013 10:39:49 +0000 (10:39 +0000)]
Fixed the condition codes for the atomic64 min/umin code generation on ARM. If the sutraction of the higher 32 bit parts gives a 0 result, we need to do the store operation.

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

11 years agoUse the AttributeSet query instead of the Attribute query.
Bill Wendling [Fri, 25 Jan 2013 08:08:54 +0000 (08:08 +0000)]
Use the AttributeSet query instead of the Attribute query.

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

11 years agoMIsched: Print block name. No functionality.
Andrew Trick [Fri, 25 Jan 2013 07:45:31 +0000 (07:45 +0000)]
MIsched: Print block name. No functionality.

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

11 years agoMachineScheduler support for viewGraph.
Andrew Trick [Fri, 25 Jan 2013 07:45:29 +0000 (07:45 +0000)]
MachineScheduler support for viewGraph.

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

11 years agoScheduleDAG: colorize the DOT graph and improve formatting.
Andrew Trick [Fri, 25 Jan 2013 07:45:25 +0000 (07:45 +0000)]
ScheduleDAG: colorize the DOT graph and improve formatting.

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

11 years agoScheduleDAG: Added isBoundaryNode to conveniently detect a common corner case.
Andrew Trick [Fri, 25 Jan 2013 06:52:30 +0000 (06:52 +0000)]
ScheduleDAG: Added isBoundaryNode to conveniently detect a common corner case.

This fixes DAG subtree analysis at the boundary.

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

11 years agoSchedDFS: Complete support for nested subtrees.
Andrew Trick [Fri, 25 Jan 2013 06:52:27 +0000 (06:52 +0000)]
SchedDFS: Complete support for nested subtrees.

Maintain separate per-node and per-tree book-keeping.
Track all instructions above a DAG node including nested subtrees.
Seperately track instructions within a subtree.
Record subtree parents.

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

11 years agoMIsched: Improve the interface to SchedDFS analysis (subtrees).
Andrew Trick [Fri, 25 Jan 2013 06:33:57 +0000 (06:33 +0000)]
MIsched: Improve the interface to SchedDFS analysis (subtrees).

Allow the strategy to select SchedDFS. Allow the results of SchedDFS
to affect initialization of the scheduler state.

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

11 years agoArrayRef reverse iterators.
Andrew Trick [Fri, 25 Jan 2013 06:33:52 +0000 (06:33 +0000)]
ArrayRef reverse iterators.

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

11 years agowhitespace
Andrew Trick [Fri, 25 Jan 2013 06:33:50 +0000 (06:33 +0000)]
whitespace

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

11 years agolit/ShUtil.py: Deprecate '!' in shell expression. It is not sh-compatible.
NAKAMURA Takumi [Fri, 25 Jan 2013 06:30:36 +0000 (06:30 +0000)]
lit/ShUtil.py: Deprecate '!' in shell expression. It is not sh-compatible.

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

11 years agoSchedDFS: Initial support for nested subtrees.
Andrew Trick [Fri, 25 Jan 2013 06:02:44 +0000 (06:02 +0000)]
SchedDFS: Initial support for nested subtrees.

This is mostly refactoring, along with adding an instruction count
within the subtrees and ensuring we only look at data edges.

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

11 years agoSwitch this code away from Value::isUsedInBasicBlock. That code either
Chandler Carruth [Fri, 25 Jan 2013 05:40:09 +0000 (05:40 +0000)]
Switch this code away from Value::isUsedInBasicBlock. That code either
loops over instructions in the basic block or the use-def list of the
value, neither of which are really efficient when repeatedly querying
about values in the same basic block.

What's more, we already know that the CondBB is small, and so we can do
a much more efficient test by counting the uses in CondBB, and seeing if
those account for all of the uses.

Finally, we shouldn't blanket fail on any such instruction, instead we
should conservatively assume that those instructions are part of the
cost.

Note that this actually fixes a bug in the pass because
isUsedInBasicBlock has a really terrible bug in it. I'll fix that in my
next commit, but the fix for it would make this code suddenly take the
compile time hit I thought it already was taking, so I wanted to go
ahead and migrate this code to a faster & better pattern.

The bug in isUsedInBasicBlock was also causing other tests to test the
wrong thing entirely: for example we weren't actually disabling
speculation for floating point operations as intended (and tested), but
the test passed because we failed to speculate them due to the
isUsedInBasicBlock failure.

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

11 years agoMISched: Add SchedDFSResult to ScheduleDAGMI to formalize the
Andrew Trick [Fri, 25 Jan 2013 04:01:04 +0000 (04:01 +0000)]
MISched: Add SchedDFSResult to ScheduleDAGMI to formalize the
interface and allow other strategies to select it.

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

11 years agoThis patch implements parsing the .word
Jack Carter [Fri, 25 Jan 2013 01:31:34 +0000 (01:31 +0000)]
This patch implements parsing the .word
directive for the Mips assembler.

Contributer: Vladimir Medic

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

11 years ago[mips] Set flag neverHasSideEffects flag on some of the floating point instructions.
Akira Hatanaka [Fri, 25 Jan 2013 00:20:39 +0000 (00:20 +0000)]
[mips] Set flag neverHasSideEffects flag on some of the floating point instructions.

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

11 years agoSchedDFS: Refactor and tweak the subtree selection criteria.
Andrew Trick [Fri, 25 Jan 2013 00:12:57 +0000 (00:12 +0000)]
SchedDFS: Refactor and tweak the subtree selection criteria.

For sanity, create a root when NumDataSuccs >= 4. Splitting large
subtrees will no longer be detrimental after my next checkin to handle
nested tree. A magic number of 4 is fine because single subtrees
seldom rejoin more than this. It makes subtrees easier to visualize
and heuristics more sane.

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

11 years agoSchedDFS: Constify interface.
Andrew Trick [Fri, 25 Jan 2013 00:12:55 +0000 (00:12 +0000)]
SchedDFS: Constify interface.

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

11 years agoAvoid creating duplicate CFG edges in the IfConversion pass.
Jakob Stoklund Olesen [Thu, 24 Jan 2013 23:59:08 +0000 (23:59 +0000)]
Avoid creating duplicate CFG edges in the IfConversion pass.

Patch by Stefan Hepp.

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

11 years agoMoving Cost Tables up to share with other targets
Renato Golin [Thu, 24 Jan 2013 23:01:00 +0000 (23:01 +0000)]
Moving Cost Tables up to share with other targets

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

11 years agoAdded comment to ObjCARC elaborating what is meant by the term 'Provenance' in 'Prove...
Michael Gottesman [Thu, 24 Jan 2013 21:35:00 +0000 (21:35 +0000)]
Added comment to ObjCARC elaborating what is meant by the term 'Provenance' in 'Provenance Analysis'.

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

11 years agoStart cleanup of PPC register definitions using foreach loops.
Hal Finkel [Thu, 24 Jan 2013 20:43:18 +0000 (20:43 +0000)]
Start cleanup of PPC register definitions using foreach loops.

No functionality change intended.

This captures the first two cases GPR32/64. For the others, we need
an addition operator (if we have one, I've not yet found it).

Based on a suggestion made by Tom Stellard in the AArch64 review!

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

11 years ago[bugpoint] make tool selection messages unique
Saleem Abdulrasool [Thu, 24 Jan 2013 16:49:14 +0000 (16:49 +0000)]
[bugpoint] make tool selection messages unique

Change messages to help identify which interpreter was actually selected (safe
vs testing).

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Reviewed-by: Chandler Carruth <chandlerc@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173360 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[bugpoint] set Message after tool configuration
Saleem Abdulrasool [Thu, 24 Jan 2013 16:49:12 +0000 (16:49 +0000)]
[bugpoint] set Message after tool configuration

Set the message returned after the GCC runner has been constructed as otherwise
the message will be overwritten by the construction of the runner, resulting in
misleading messages.

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
Reviewed-by: Chandler Carruth <chandlerc@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173359 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReapply chandlerc's r173342 now that the miscompile it was triggering is fixed.
Benjamin Kramer [Thu, 24 Jan 2013 16:44:25 +0000 (16:44 +0000)]
Reapply chandlerc's r173342 now that the miscompile it was triggering is fixed.

Original commit message:
Plug TTI into the speculation logic, giving it a real cost interface
that can be specialized by targets.

The goal here is not to be more aggressive, but to just be more accurate
with very obvious cases. There are instructions which are known to be
truly free and which were not being modeled as such in this code -- see
the regression test which is distilled from an inner loop of zlib.

Everywhere the TTI cost model is insufficiently conservative I've added
explicit checks with FIXME comments to go add proper modelling of these
cost factors.

If this causes regressions, the likely solution is to make TTI even more
conservative in its cost estimates, but test cases will help here.

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

11 years agoConstantFolding: Add a missing folding that leads to a miscompile.
Benjamin Kramer [Thu, 24 Jan 2013 16:28:28 +0000 (16:28 +0000)]
ConstantFolding: Add a missing folding that leads to a miscompile.

We use constant folding to see if an intrinsic evaluates to the same value as a
constant that we know. If we don't take the undefinedness into account we get a
value that doesn't match the actual implementation, and miscompiled code.

This was uncovered by Chandler's simplifycfg changes.

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

11 years agounittests/SupportTests/Initialize.MultipleThreads: Enable pthread_attr_setstack(3...
NAKAMURA Takumi [Thu, 24 Jan 2013 15:29:27 +0000 (15:29 +0000)]
unittests/SupportTests/Initialize.MultipleThreads: Enable pthread_attr_setstack(3) only on Linux.

I got blamed on darwin11;
unittests/Support/ManagedStatic.cpp:35: error: 'pthread_attr_setstack' was not declared in this scope

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

11 years agounittests/SupportTests/Initialize.MultipleThreads: Appease --vg-leak to allocate...
NAKAMURA Takumi [Thu, 24 Jan 2013 14:44:02 +0000 (14:44 +0000)]
unittests/SupportTests/Initialize.MultipleThreads: Appease --vg-leak to allocate stack explicitly for glibc.

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

11 years agolli/RecordingMemoryManager: Free allocated sections in the destructor to satisfy...
NAKAMURA Takumi [Thu, 24 Jan 2013 14:12:12 +0000 (14:12 +0000)]
lli/RecordingMemoryManager: Free allocated sections in the destructor to satisfy --vg-leak!

FIXME: It could be generalized in MemoryManager.

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

11 years agoRevert r173342 temporarily. It appears to cause a very late miscompile
Chandler Carruth [Thu, 24 Jan 2013 13:24:24 +0000 (13:24 +0000)]
Revert r173342 temporarily. It appears to cause a very late miscompile
of stage2 in a bootstrap. Still investigating....

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

11 years agoPlug TTI into the speculation logic, giving it a real cost interface
Chandler Carruth [Thu, 24 Jan 2013 12:39:29 +0000 (12:39 +0000)]
Plug TTI into the speculation logic, giving it a real cost interface
that can be specialized by targets.

The goal here is not to be more aggressive, but to just be more accurate
with very obvious cases. There are instructions which are known to be
truly free and which were not being modeled as such in this code -- see
the regression test which is distilled from an inner loop of zlib.

Everywhere the TTI cost model is insufficiently conservative I've added
explicit checks with FIXME comments to go add proper modelling of these
cost factors.

If this causes regressions, the likely solution is to make TTI even more
conservative in its cost estimates, but test cases will help here.

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

11 years agoAddress a large chunk of this FIXME by accumulating the cost for
Chandler Carruth [Thu, 24 Jan 2013 12:05:17 +0000 (12:05 +0000)]
Address a large chunk of this FIXME by accumulating the cost for
unfolded constant expressions rather than checking each one
independently.

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

11 years agoSwitch the constant expression speculation cost evaluation away from
Chandler Carruth [Thu, 24 Jan 2013 11:53:01 +0000 (11:53 +0000)]
Switch the constant expression speculation cost evaluation away from
a cost fuction that seems both a bit ad-hoc and also poorly suited to
evaluating constant expressions.

Notably, it is missing any support for trivial expressions such as
'inttoptr'. I could fix this routine, but it isn't clear to me all of
the constraints its other users are operating under.

The core protection that seems relevant here is avoiding the formation
of a select instruction wich a further chain of select operations in
a constant expression operand. Just explicitly encode that constraint.

Also, update the comments and organization here to make it clear where
this needs to go -- this should be driven off of real cost measurements
which take into account the number of constants expressions and the
depth of the constant expression tree.

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

11 years agoRephrase the speculating scan of the conditional BB to be phrased in
Chandler Carruth [Thu, 24 Jan 2013 11:52:58 +0000 (11:52 +0000)]
Rephrase the speculating scan of the conditional BB to be phrased in
terms of cost rather than hoisting a single instruction.

This does *not* change the cost model! We still set the cost threshold
at 1 here, it's just that we track it by accumulating cost rather than
by storing an instruction.

The primary advantage is that we no longer leave no-op intrinsics in the
basic block. For example, this will now move both debug info intrinsics
and a single instruction, instead of only moving the instruction and
leaving a basic block with nothing bug debug info intrinsics in it, and
those intrinsics now no longer ordered correctly with the hoisted value.

Instead, we now splice the entire conditional basic block's instruction
sequence.

This also places the code for checking the safety of hoisting next to
the code computing the cost.

Currently, the only observable side-effect of this change is that debug
info intrinsics are no longer abandoned. I'm not sure how to craft
a test case for this, and my real goal was the refactoring, but I'll
talk to Dave or Eric about how to add a test case for this.

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

11 years ago[asan] fix 32-bit builds
Kostya Serebryany [Thu, 24 Jan 2013 10:43:50 +0000 (10:43 +0000)]
[asan] fix 32-bit builds

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

11 years agoSimplify the PHI node operand rewriting.
Chandler Carruth [Thu, 24 Jan 2013 10:40:51 +0000 (10:40 +0000)]
Simplify the PHI node operand rewriting.

Previously, the code would scan the PHI nodes and build up a small
setvector of candidate value pairs in phi nodes to go and rewrite. Once
certain the rewrite could be performed, the code walks the set, and for
each one re-scans the entire PHI node list looking for nodes to rewrite
operands.

Instead, scan the PHI nodes once to check for hazards, and then scan it
a second time to rewrite the operands to selects. No set vector, and
a max of two scans.

The only downside is that we might form identical selects, but
instcombine or anything else should fold those easily, and it seems
unlikely to happen often.

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

11 years ago[asan] adaptive redzones for globals (the larger the global the larger is the redzone)
Kostya Serebryany [Thu, 24 Jan 2013 10:35:40 +0000 (10:35 +0000)]
[asan] adaptive redzones for globals (the larger the global the larger is the redzone)

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

11 years agoGive the basic block variables here names based on the if-then-end
Chandler Carruth [Thu, 24 Jan 2013 09:59:39 +0000 (09:59 +0000)]
Give the basic block variables here names based on the if-then-end
structure being analyzed. No functionality changed.

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

11 years agoLift a cheap early exit test above loops and other complex early exit
Chandler Carruth [Thu, 24 Jan 2013 08:22:40 +0000 (08:22 +0000)]
Lift a cheap early exit test above loops and other complex early exit
tests. No need to pay the high cost when we're never going to do
anything.

No functionality changed.

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

11 years agoSpiff up the comment on this method, making the example a bit more
Chandler Carruth [Thu, 24 Jan 2013 08:05:06 +0000 (08:05 +0000)]
Spiff up the comment on this method, making the example a bit more
pretty in doxygen, adding some of the details actually present in
a classic example where this matters (a loop from gzip and many other
compression algorithms), and a cautionary note about the risks inherent
in the transform. This has come up on the mailing lists recently, and
I suspect folks reading this code could benefit from going and looking
at the MI pass that can really deal with these issues.

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

11 years agoMipsISelLowering.cpp: Fill unreachable paths to fix warnings. [-Wsometimes-uninitialized]
NAKAMURA Takumi [Thu, 24 Jan 2013 06:08:06 +0000 (06:08 +0000)]
MipsISelLowering.cpp: Fill unreachable paths to fix warnings. [-Wsometimes-uninitialized]

FIXME: Could they, unreachable(s), be removed?
FIXME: I could prefer the coding standards...

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

11 years agoMipsISelLowering.cpp: Fix a warning, take two. [-Wunused-variable]
NAKAMURA Takumi [Thu, 24 Jan 2013 05:54:23 +0000 (05:54 +0000)]
MipsISelLowering.cpp: Fix a warning, take two. [-Wunused-variable]

...and fix a typo, s/#ifdef/#ifndef/

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

11 years agoMipsISelLowering.cpp: Fix a warning. [-Wunused-variable]
NAKAMURA Takumi [Thu, 24 Jan 2013 05:47:29 +0000 (05:47 +0000)]
MipsISelLowering.cpp: Fix a warning. [-Wunused-variable]

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

11 years agoRemove trailing whitespace.
Craig Topper [Thu, 24 Jan 2013 05:22:40 +0000 (05:22 +0000)]
Remove trailing whitespace.

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

11 years agoAdd asserts to SmallVector so that calls to front() and back() only succeed
Richard Trieu [Thu, 24 Jan 2013 04:29:24 +0000 (04:29 +0000)]
Add asserts to SmallVector so that calls to front() and back() only succeed
if the vector is not empty.  This will ensure that calls to these functions
will reference elements in the vector.

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

11 years agoThe next phase of Mips16 hard float implementation.
Reed Kotler [Thu, 24 Jan 2013 04:24:02 +0000 (04:24 +0000)]
The next phase of Mips16 hard float implementation.

Allow Mips16 routines to call Mips32 routines that have abi requirements
that either arguments or return values are passed in floating point
registers. This handles only the pic case. We have not done non pic
for Mips16 yet in any form.

The libm functions are Mips32, so with this addition we have a complete
Mips16 hard float implementation.

We still are not able to complete mix Mip16 and Mips32 with hard float.
That will be the next phase which will have several steps. For Mips32
to freely call Mips16 some stub functions must be created.

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

11 years agoMachineScheduler: enable biasCriticalPath for all DAGs.
Andrew Trick [Thu, 24 Jan 2013 02:09:57 +0000 (02:09 +0000)]
MachineScheduler: enable biasCriticalPath for all DAGs.

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

11 years agoMIsched: Added biasCriticalPath.
Andrew Trick [Thu, 24 Jan 2013 02:09:55 +0000 (02:09 +0000)]
MIsched: Added biasCriticalPath.

Allow schedulers to order DAG edges by critical path. This makes
DFS-based heuristics more stable and effective.

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

11 years ago[ELF] Add R_X86_64_IRELATIVE.
Michael J. Spencer [Thu, 24 Jan 2013 02:08:25 +0000 (02:08 +0000)]
[ELF] Add R_X86_64_IRELATIVE.

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

11 years agoAdd a profile for uniquifying the AttributeSet with the AttributeSetNodes.
Bill Wendling [Thu, 24 Jan 2013 01:01:34 +0000 (01:01 +0000)]
Add a profile for uniquifying the AttributeSet with the AttributeSetNodes.

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

11 years agoCleanup the AttributeSetNodes that we create.
Bill Wendling [Thu, 24 Jan 2013 00:14:46 +0000 (00:14 +0000)]
Cleanup the AttributeSetNodes that we create.

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

11 years agoCreate a new class: AttributeSetNode.
Bill Wendling [Thu, 24 Jan 2013 00:06:56 +0000 (00:06 +0000)]
Create a new class: AttributeSetNode.

This is a helper class for the AttributeSetImpl class. It holds a set of
attributes that apply to a single element: function, return type, or
parameter.

These are uniqued.

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

11 years agoPush down the conversion of the alignment from the bit mask to a real number into...
Bill Wendling [Wed, 23 Jan 2013 23:00:05 +0000 (23:00 +0000)]
Push down the conversion of the alignment from the bit mask to a real number into the attribute implementation class.

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

11 years agoRemove dead methods.
Bill Wendling [Wed, 23 Jan 2013 22:38:33 +0000 (22:38 +0000)]
Remove dead methods.

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

11 years agoFix small typo
Eli Bendersky [Wed, 23 Jan 2013 22:05:19 +0000 (22:05 +0000)]
Fix small typo

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

11 years agoR600: Add a llvm.R600.store.swizzle intrinsics
Tom Stellard [Wed, 23 Jan 2013 21:39:49 +0000 (21:39 +0000)]
R600: Add a llvm.R600.store.swizzle intrinsics

This intrinsic is translated to ALLOC_EXPORT_WORD1_SWIZ, hence its
name. It is used to store vs/fs outputs

Patch by: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173297 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Simplify stream outputs intrinsic
Tom Stellard [Wed, 23 Jan 2013 21:39:47 +0000 (21:39 +0000)]
R600: Simplify stream outputs intrinsic

Patch by: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173296 91177308-0d34-0410-b5e6-96231b3b80d8