oota-llvm.git
12 years agoFix documentation: parameter being documented was removed in r98220.
Dmitri Gribenko [Thu, 13 Sep 2012 20:28:31 +0000 (20:28 +0000)]
Fix documentation: parameter being documented was removed in r98220.

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

12 years agoAdd wider vector/integer support for PR12312
Michael Liao [Thu, 13 Sep 2012 20:24:54 +0000 (20:24 +0000)]
Add wider vector/integer support for PR12312

- Enhance the fix to PR12312 to support wider integer, such as 256-bit
  integer. If more than 1 fully evaluated vectors are found, POR them
  first followed by the final PTEST.

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

12 years agoEnhance type legalization on bitcast from vector to integer
Michael Liao [Thu, 13 Sep 2012 19:58:21 +0000 (19:58 +0000)]
Enhance type legalization on bitcast from vector to integer

- Find a legal vector type before casting and extracting element from it.
- As the new vector type may have more than 2 elements, build the final
  hi/lo pair by BFS pairing them from bottom to top.

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

12 years agoFix test case to avoid PIC magic.
Jakob Stoklund Olesen [Thu, 13 Sep 2012 19:47:45 +0000 (19:47 +0000)]
Fix test case to avoid PIC magic.

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

12 years agoFix the TCRETURNmi64 bug differently.
Jakob Stoklund Olesen [Thu, 13 Sep 2012 18:31:27 +0000 (18:31 +0000)]
Fix the TCRETURNmi64 bug differently.

Add a PatFrag to match X86tcret using 6 fixed registers or less. This
avoids folding loads into TCRETURNmi64 using 7 or more volatile
registers.

<rdar://problem/12282281>

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

12 years agoExtract code for reducing a type to a single value type into a helper function.
Dan Gohman [Thu, 13 Sep 2012 18:19:06 +0000 (18:19 +0000)]
Extract code for reducing a type to a single value type into a helper function.

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

12 years agoDefine an official slot for the new !tbaa.struct metadata tag.
Dan Gohman [Thu, 13 Sep 2012 17:56:17 +0000 (17:56 +0000)]
Define an official slot for the new !tbaa.struct metadata tag.

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

12 years agoAsmWriterEmitter: increase the number of bits for OpcodeInfo from 32-bit to
Manman Ren [Thu, 13 Sep 2012 17:43:46 +0000 (17:43 +0000)]
AsmWriterEmitter: increase the number of bits for OpcodeInfo from 32-bit to
48-bit if necessary, in order to reduce the generated code size.

We have 900 cases not covered by OpcodeInfo in ATT AsmWriter and more in Intel
AsmWriter and ARM AsmWriter.

This patch reduced the clang Release build size by 50k, running on a Mac Pro.

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

12 years agomips16: When copying operands in a conditional branch instruction, allow for
Akira Hatanaka [Thu, 13 Sep 2012 17:12:37 +0000 (17:12 +0000)]
mips16: When copying operands in a conditional branch instruction, allow for
immediate operands to be copied.

Patch by Reed Kotler.

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

12 years agoRevert r163761 "Don't fold indexed loads into TCRETURNmi64."
Jakob Stoklund Olesen [Thu, 13 Sep 2012 16:52:17 +0000 (16:52 +0000)]
Revert r163761 "Don't fold indexed loads into TCRETURNmi64."

The patch caused "Wrong topological sorting" assertions.

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

12 years agoMemCpyOpt: When forming a memset from stores also take GEP constexprs into account.
Benjamin Kramer [Thu, 13 Sep 2012 16:29:49 +0000 (16:29 +0000)]
MemCpyOpt: When forming a memset from stores also take GEP constexprs into account.

This is common when storing to global variables.

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

12 years agoFix an 80 char line limit.
Nadav Rotem [Thu, 13 Sep 2012 16:27:32 +0000 (16:27 +0000)]
Fix an 80 char line limit.

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

12 years agoRename the flag which protects from escaped allocas, which may come from bugs in...
Nadav Rotem [Thu, 13 Sep 2012 15:46:30 +0000 (15:46 +0000)]
Rename the flag which protects from escaped allocas, which may come from bugs in user code or in the compiler. Also, dont assert if the protection is not enabled.

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

12 years agoThe current implementation does not allow more than 32 types to be properly handled...
Micah Villmow [Thu, 13 Sep 2012 15:24:43 +0000 (15:24 +0000)]
The current implementation does not allow more than 32 types to be properly handled with target lowering. This doubles the size to 64bit types and easily allows extension to more types.

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

12 years agoUnify the emission of the calling conventions into a single function to reduce code...
Micah Villmow [Thu, 13 Sep 2012 15:11:12 +0000 (15:11 +0000)]
Unify the emission of the calling conventions into a single function to reduce code duplication.

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

12 years agoThis patch introduces A15 as a target in LLVM.
Silviu Baranga [Thu, 13 Sep 2012 15:05:10 +0000 (15:05 +0000)]
This patch introduces A15 as a target in LLVM.

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

12 years agoFix a dagcombine optimization. The optimization attempts to optimize a bitcast of...
Nadav Rotem [Thu, 13 Sep 2012 14:54:28 +0000 (14:54 +0000)]
Fix a dagcombine optimization. The optimization attempts to optimize a bitcast of fneg to integers
by xoring the high-bit. This fails if the source operand is a vector because we need to negate
each of the elements in the vector.

Fix rdar://12281066 PR13813.

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

12 years agoFix a typo.
Nadav Rotem [Thu, 13 Sep 2012 14:51:00 +0000 (14:51 +0000)]
Fix a typo.

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

12 years agoUse Nick's suggestion of storing a large NULL into the GV instead of memset, which...
Bill Wendling [Thu, 13 Sep 2012 14:32:30 +0000 (14:32 +0000)]
Use Nick's suggestion of storing a large NULL into the GV instead of memset, which requires TargetData.

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

12 years agoStack Coloring: We have code that checks that all of the uses of allocas
Nadav Rotem [Thu, 13 Sep 2012 12:38:37 +0000 (12:38 +0000)]
Stack Coloring: We have code that checks that all of the uses of allocas
are within the lifetime zone. Sometime legitimate usages of allocas are
hoisted outside of the lifetime zone. For example, GEPS may calculate the
address of a member of an allocated struct. This commit makes sure that
we only check (abort regions or assert) for instructions that read and write
memory using stack frames directly. Notice that by allowing legitimate
usages outside the lifetime zone we also stop checking for instructions
which use derivatives of allocas. We will catch less bugs in user code
and in the compiler itself.

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

12 years agoFix Doxygen issues:
Dmitri Gribenko [Thu, 13 Sep 2012 12:34:29 +0000 (12:34 +0000)]
Fix Doxygen issues:
* wrap code blocks in \code ... \endcode;
* refer to parameter names in paragraphs correctly (\arg is not what most
  people want -- it starts a new paragraph).

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

12 years agoFix a doxygen issue: these examples are supposed to be displayed preformatted.
Dmitri Gribenko [Thu, 13 Sep 2012 11:42:30 +0000 (11:42 +0000)]
Fix a doxygen issue: these examples are supposed to be displayed preformatted.

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

12 years agoFix function name in comment.
Craig Topper [Thu, 13 Sep 2012 07:26:59 +0000 (07:26 +0000)]
Fix function name in comment.

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

12 years agoFix typo in comment.
Nick Lewycky [Thu, 13 Sep 2012 07:01:25 +0000 (07:01 +0000)]
Fix typo in comment.

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

12 years agoAdd a new compression type to ModRM table that detects when the memory modRM byte...
Craig Topper [Thu, 13 Sep 2012 05:45:42 +0000 (05:45 +0000)]
Add a new compression type to ModRM table that detects when the memory modRM byte represent 8 instructions and the reg modRM byte represents up to 64 instructions. Reduces modRM table from 43k entreis to 25k entries. Based on a patch from Manman Ren.

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

12 years agoMCJIT: relocation addends encoded in the target aren't quite so easy.
Jim Grosbach [Thu, 13 Sep 2012 01:24:37 +0000 (01:24 +0000)]
MCJIT: relocation addends encoded in the target aren't quite so easy.

The assumption that the target address for the relocation will always be
sizeof(intptr_t) and will always contain an addend for the relocation
value is very wrong. Default to no addend for now.

rdar://12157052

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

12 years agoMCJIT: Make sure to mask off non-type-field bits.
Jim Grosbach [Thu, 13 Sep 2012 01:24:35 +0000 (01:24 +0000)]
MCJIT: Make sure to mask off non-type-field bits.

When comparing to the macho relocation type enum value, make sure we're only
comparing against the bits in the RelType that correspond.

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

12 years agoMCJIT: Pass the i386 MachO relocation type properly.
Jim Grosbach [Thu, 13 Sep 2012 01:24:32 +0000 (01:24 +0000)]
MCJIT: Pass the i386 MachO relocation type properly.

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

12 years agoDon't fold indexed loads into TCRETURNmi64.
Jakob Stoklund Olesen [Thu, 13 Sep 2012 00:25:00 +0000 (00:25 +0000)]
Don't fold indexed loads into TCRETURNmi64.

We don't have enough GR64_TC registers when calling a varargs function
with 6 arguments. Since %al holds the number of vector registers used,
only %r11 is available as a scratch register.

This means that addressing modes using both base and index registers
can't be folded into TCRETURNmi64.

<rdar://problem/12282281>

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

12 years agoIntroduce the __llvm_gcov_flush function.
Bill Wendling [Thu, 13 Sep 2012 00:09:55 +0000 (00:09 +0000)]
Introduce the __llvm_gcov_flush function.

This function writes out the current values of the counters and then resets
them. This can be used similarly to the __gcov_flush function to sync the
counters when need be. For instance, in a situation where the application
doesn't exit.
<rdar://problem/12185886>

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

12 years agoRecommit, with fixes:
Eric Christopher [Wed, 12 Sep 2012 23:36:19 +0000 (23:36 +0000)]
Recommit, with fixes:

    Add some support for dealing with an object pointer on arguments.

    Part of rdar://9797999

which now supports adding the object pointer attribute to the
subprogram as it should.

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

12 years agoMisc.
Akira Hatanaka [Wed, 12 Sep 2012 23:27:55 +0000 (23:27 +0000)]
Misc.
1. Remove RA from list of allocatable registers
2. Enable d,y,r constraint inline assembly instructions

Patch by Reed Kotler.

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

12 years agoFix PR11985
Michael Liao [Wed, 12 Sep 2012 21:43:09 +0000 (21:43 +0000)]
Fix PR11985

- BlockAddress has no support of BA + offset form and there is no way to
  propagate that offset into machine operand;
- Add BA + offset support and a new interface 'getTargetBlockAddress' to
  simplify target block address forming;
- All targets are modified to use new interface and X86 backend is enhanced to
  support BA + offset addressing.

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

12 years agoDetect overflow in the path count computation. rdar://12277446.
Dan Gohman [Wed, 12 Sep 2012 20:45:17 +0000 (20:45 +0000)]
Detect overflow in the path count computation. rdar://12277446.

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

12 years agoRemove an overly-aggressive assertion. The code following this assertion already...
Owen Anderson [Wed, 12 Sep 2012 20:09:19 +0000 (20:09 +0000)]
Remove an overly-aggressive assertion.  The code following this assertion already knows how to handle the case where DstRC was NULL, so it's not actually protecting us from anything, and this pattern can come up when using unknown_class operands in the SelectionDAG.

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

12 years agoDelete dead code.
Jakob Stoklund Olesen [Wed, 12 Sep 2012 20:04:17 +0000 (20:04 +0000)]
Delete dead code.

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

12 years agoRevert "Add some support for dealing with an object pointer on arguments."
Eric Christopher [Wed, 12 Sep 2012 18:42:31 +0000 (18:42 +0000)]
Revert "Add some support for dealing with an object pointer on arguments."
This should be done on the subprogram, not the variable itself.

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

12 years ago[ms-inline asm] Make the operand size directives case insensitive.
Chad Rosier [Wed, 12 Sep 2012 18:24:26 +0000 (18:24 +0000)]
[ms-inline asm] Make the operand size directives case insensitive.

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

12 years agoTableGen: Convert an assert() to a proper diagnostic.
Jim Grosbach [Wed, 12 Sep 2012 17:40:25 +0000 (17:40 +0000)]
TableGen: Convert an assert() to a proper diagnostic.

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

12 years agoPGO: preserve branch-weight metadata when removing a case which jumps
Manman Ren [Wed, 12 Sep 2012 17:04:11 +0000 (17:04 +0000)]
PGO: preserve branch-weight metadata when removing a case which jumps
to the default target.

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

12 years agoFix a couple of Doxygen comment issues pointed out by -Wdocumentation.
Dmitri Gribenko [Wed, 12 Sep 2012 16:59:47 +0000 (16:59 +0000)]
Fix a couple of Doxygen comment issues pointed out by -Wdocumentation.

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

12 years agoEnable exceptions handling on PPC64 now that cr misaligned spilling
Roman Divacky [Wed, 12 Sep 2012 15:29:32 +0000 (15:29 +0000)]
Enable exceptions handling on PPC64 now that cr misaligned spilling
was fixed in r163713.

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

12 years agoSuppress the warnings about unused parameters in changeColor()
Alexander Potapenko [Wed, 12 Sep 2012 15:01:33 +0000 (15:01 +0000)]
Suppress the warnings about unused parameters in changeColor()

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

12 years agoThis patch corrects logic in PPCFrameLowering for save and restore of
Roman Divacky [Wed, 12 Sep 2012 14:47:47 +0000 (14:47 +0000)]
This patch corrects logic in PPCFrameLowering for save and restore of
nonvolatile condition register fields across calls under the SVR4 ABIs.

 * With the 64-bit ABI, the save location is at a fixed offset of 8 from
the stack pointer.  The frame pointer cannot be used to access this
portion of the stack frame since the distance from the frame pointer may
change with alloca calls.

 * With the 32-bit ABI, the save location is just below the general
register save area, and is accessed via the frame pointer like the rest
of the save areas.  This is an optional slot, so it must only be created
if any of CR2, CR3, and CR4 were modified.

 * For both ABIs, save/restore logic is generated only if one of the
nonvolatile CR fields were modified.

I also took this opportunity to clean up an extra FIXME in
PPCFrameLowering.h.  Save area offsets for 32-bit GPRs are meaningless
for the 64-bit ABI, so I removed them for correctness and efficiency.

Fixes PR13708 and partially also PR13623. It lets us enable exception handling
on PPC64.

Patch by William J. Schmidt!

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

12 years agoAdd support for AMD Geode.
Roman Divacky [Wed, 12 Sep 2012 14:36:02 +0000 (14:36 +0000)]
Add support for AMD Geode.

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

12 years agoFix constant folding through bitcasts by no longer relying on undefined behaviour...
Kristof Beyls [Wed, 12 Sep 2012 11:25:02 +0000 (11:25 +0000)]
Fix constant folding through bitcasts by no longer relying on undefined behaviour (converting NaN values between float and double).

SelectionDAG::getConstantFP(double Val, EVT VT, bool isTarget);
should not be used when Val is not a simple constant (as the comment in
SelectionDAG.h indicates). This patch avoids using this function
when folding an unknown constant through a bitcast, where it cannot be
guaranteed that Val will be a simple constant.

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

12 years agoAdd a flag to disable the code that looks for allocas which escaped the lifetime...
Nadav Rotem [Wed, 12 Sep 2012 11:06:26 +0000 (11:06 +0000)]
Add a flag to disable the code that looks for allocas which escaped the lifetime regions. This is useful for debugging. No testcase because without this check we fail on assertions when finding escaped allocas.

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

12 years agoAdd a function computeRegisterLiveness() to MachineBasicBlock. This uses analyzePhysR...
James Molloy [Wed, 12 Sep 2012 10:18:23 +0000 (10:18 +0000)]
Add a function computeRegisterLiveness() to MachineBasicBlock. This uses analyzePhysReg() from r163694 to heuristically try and determine the liveness state of a physical register upon arrival at a particular instruction in a block.

The search for liveness is clipped to a specific number of instructions around the target MachineInstr, in order to avoid degenerating into an O(N^2) algorithm. It tries to use various clues about how instructions around (both before and after) a given MachineInstr use that register, to determine its state at the MachineInstr.

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

12 years agoAdd an analyzePhysReg() function to MachineOperandIteratorBase that analyses an instr...
James Molloy [Wed, 12 Sep 2012 10:03:31 +0000 (10:03 +0000)]
Add an analyzePhysReg() function to MachineOperandIteratorBase that analyses an instruction's use of a physical register, analogous to analyzeVirtReg.

Rename RegInfo to VirtRegInfo so as not to be confused with the new PhysRegInfo.

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

12 years agoWhen calling print directly on a global (eg from the debugger) it
Duncan Sands [Wed, 12 Sep 2012 09:55:51 +0000 (09:55 +0000)]
When calling print directly on a global (eg from the debugger) it
was printing a newline that doesn't occur when printing other kinds
of LLVM values.  Move the printing of that newline elsewhere, making
globals print the same as other values while leaving the output when
printing an entire module unchanged.  Patch by SaÅ¡a Tomić.

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

12 years agoEnable stack-coloring, in hope that the recent fixes will enable correct dragonegg...
Nadav Rotem [Wed, 12 Sep 2012 07:58:35 +0000 (07:58 +0000)]
Enable stack-coloring, in hope that the recent fixes will enable correct dragonegg self-hosting.

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

12 years agoMake findLastUseBefore handle reg-unit liveness.
Lang Hames [Wed, 12 Sep 2012 06:56:16 +0000 (06:56 +0000)]
Make findLastUseBefore handle reg-unit liveness.

findLastUseBefore was previous considering virtreg liveness only, leading to
incorrect live intervals for reg units when instrs with physreg operands were
moved up.

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

12 years agoIndentation fixes. No functional change.
Craig Topper [Wed, 12 Sep 2012 06:20:41 +0000 (06:20 +0000)]
Indentation fixes. No functional change.

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

12 years agoRelease build: guard dump functions with
Manman Ren [Wed, 12 Sep 2012 05:06:18 +0000 (05:06 +0000)]
Release build: guard dump functions with
"#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)"

No functional change. Update r163344.

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

12 years agoStack coloring: remove lifetime intervals which contain escaped allocas.
Nadav Rotem [Wed, 12 Sep 2012 04:57:37 +0000 (04:57 +0000)]
Stack coloring: remove lifetime intervals which contain escaped allocas.

The input program may contain intructions which are not inside lifetime
markers. This can happen due to a bug in the compiler or due to a bug in
user code (for example, returning a reference to a local variable).
This commit adds checks that all of the instructions in the function and
invalidates lifetime ranges which do not contain all of the instructions.

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

12 years agoAdd some support for dealing with an object pointer on arguments.
Eric Christopher [Wed, 12 Sep 2012 00:26:55 +0000 (00:26 +0000)]
Add some support for dealing with an object pointer on arguments.

Part of rdar://9797999

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

12 years agoImprove tblgen code cleanliness: create an unknown_class, from which the unknown...
Owen Anderson [Tue, 11 Sep 2012 23:47:08 +0000 (23:47 +0000)]
Improve tblgen code cleanliness: create an unknown_class, from which the unknown def inherits.  Make tblgen check for that class, rather than checking for the def itself.

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

12 years agoCompute a map from register names to registers, rather than scanning the list of...
Owen Anderson [Tue, 11 Sep 2012 23:32:17 +0000 (23:32 +0000)]
Compute a map from register names to registers, rather than scanning the list of registers every time we want to look up a register by name.

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

12 years agoAdd documentation.
Chad Rosier [Tue, 11 Sep 2012 23:20:20 +0000 (23:20 +0000)]
Add documentation.

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

12 years agoAdd a few virtual functions to the abstract MCParsedAsmOperand class.
Chad Rosier [Tue, 11 Sep 2012 23:03:44 +0000 (23:03 +0000)]
Add a few virtual functions to the abstract MCParsedAsmOperand class.

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

12 years agoRename the isMemory() function to isMem(). No functional change intended.
Chad Rosier [Tue, 11 Sep 2012 23:02:35 +0000 (23:02 +0000)]
Rename the isMemory() function to isMem().  No functional change intended.

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

12 years agoRelease build: guard dump functions with
Manman Ren [Tue, 11 Sep 2012 22:23:19 +0000 (22:23 +0000)]
Release build: guard dump functions with
"#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)"

No functional change. Update r163339.

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

12 years agoStringSwitchify.
Chad Rosier [Tue, 11 Sep 2012 21:10:25 +0000 (21:10 +0000)]
StringSwitchify.

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

12 years agoSimplify logic. No functional change intended.
Chad Rosier [Tue, 11 Sep 2012 20:57:04 +0000 (20:57 +0000)]
Simplify logic. No functional change intended.

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

12 years ago[ms-inline asm] Split the parsing of IR asm strings into GCC and MS variants.
Chad Rosier [Tue, 11 Sep 2012 19:09:56 +0000 (19:09 +0000)]
[ms-inline asm] Split the parsing of IR asm strings into GCC and MS variants.
Add support in the EmitMSInlineAsmStr() function for handling integer consts.

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

12 years agoSimplifyCFG: preserve branch-weight metadata when creating a new switch from
Manman Ren [Tue, 11 Sep 2012 17:43:35 +0000 (17:43 +0000)]
SimplifyCFG: preserve branch-weight metadata when creating a new switch from
a pair of switch/branch where both depend on the value of the same variable and
the default case of the first switch/branch goes to the second switch/branch.

Code clean up and fixed a few issues:
1> handling the case where some cases of the 2nd switch are invalidated
2> correctly calculate the weight for the 2nd switch when it is a conditional eq

Testing case is modified from Alastair's original patch.

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

12 years agoAdd TRI::getSubRegIndexLaneMask().
Jakob Stoklund Olesen [Tue, 11 Sep 2012 16:34:08 +0000 (16:34 +0000)]
Add TRI::getSubRegIndexLaneMask().

Sub-register lane masks are bitmasks that can be used to determine if
two sub-registers of a virtual register will overlap. For example, ARM's
ssub0 and ssub1 sub-register indices don't overlap each other, but both
overlap dsub0 and qsub0.

The lane masks will be accurate on most targets, but on targets that use
sub-register indexes in an irregular way, the masks may conservatively
report that two sub-register indices overlap when the eventually
allocated physregs don't.

Irregular register banks also mean that the bits in a lane mask can't be
mapped onto register units, but the concept is similar.

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

12 years agoClean the sub-reg index composition maps at emission.
Jakob Stoklund Olesen [Tue, 11 Sep 2012 16:34:05 +0000 (16:34 +0000)]
Clean the sub-reg index composition maps at emission.

Preserve the Composites map in the CodeGenSubRegIndex class so it can be
used to determine which sub-register indices can actually be composed.

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

12 years agoAdd MCRI::getNumSubRegIndices() and start checking SubRegIndex ranges.
Jakob Stoklund Olesen [Tue, 11 Sep 2012 16:34:02 +0000 (16:34 +0000)]
Add MCRI::getNumSubRegIndices() and start checking SubRegIndex ranges.

Apparently, NumSubRegIndices was completely unused before. Adjust it by
one to include the null subreg index, just like getNumRegs() includes
the null register.

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

12 years agoFormatting. No functional change intended.
Chad Rosier [Tue, 11 Sep 2012 16:33:10 +0000 (16:33 +0000)]
Formatting. No functional change intended.

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

12 years agoDragonegg selfhost exposed additional cases where alloca usage moved outside of lifet...
Nadav Rotem [Tue, 11 Sep 2012 15:40:27 +0000 (15:40 +0000)]
Dragonegg selfhost exposed additional cases where alloca usage moved outside of lifetime markers. Disabling the pass for now.

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

12 years agoEnable stack coloring.
Nadav Rotem [Tue, 11 Sep 2012 13:48:35 +0000 (13:48 +0000)]
Enable stack coloring.

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

12 years agoStack Coloring: Dont crash on dbg values which use stack frames.
Nadav Rotem [Tue, 11 Sep 2012 12:34:27 +0000 (12:34 +0000)]
Stack Coloring: Dont crash on dbg values which use stack frames.

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

12 years agoCMake toolchain file for Android NDK.
Evgeniy Stepanov [Tue, 11 Sep 2012 11:54:27 +0000 (11:54 +0000)]
CMake toolchain file for Android NDK.

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

12 years agoAdd IRC handle.
Duncan Sands [Tue, 11 Sep 2012 07:50:40 +0000 (07:50 +0000)]
Add IRC handle.

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

12 years agoMake a bunch of lowering helper functions static instead of member functions. No...
Craig Topper [Tue, 11 Sep 2012 06:15:32 +0000 (06:15 +0000)]
Make a bunch of lowering helper functions static instead of member functions. No functional change.

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

12 years agoChange unsigned to a uint16_t in static disassembler tables to reduce the table size.
Craig Topper [Tue, 11 Sep 2012 04:19:21 +0000 (04:19 +0000)]
Change unsigned to a uint16_t in static disassembler tables to reduce the table size.

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

12 years agollvm/lib/Transforms/Utils/CMakeLists.txt: Update.
NAKAMURA Takumi [Tue, 11 Sep 2012 02:55:37 +0000 (02:55 +0000)]
llvm/lib/Transforms/Utils/CMakeLists.txt: Update.

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

12 years agoAdd a pass that renames everything with metasyntatic names. This works well after...
Alex Rosenberg [Tue, 11 Sep 2012 02:46:18 +0000 (02:46 +0000)]
Add a pass that renames everything with metasyntatic names. This works well after using bugpoint to reduce the confusion presented by the original names, which no longer mean what they used to.

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

12 years agoTeach DAG combiner to constant fold FABS of a BUILD_VECTOR of ConstantFPs. Factor...
Craig Topper [Tue, 11 Sep 2012 01:45:21 +0000 (01:45 +0000)]
Teach DAG combiner to constant fold FABS of a BUILD_VECTOR of ConstantFPs. Factor similar code out of FNEG DAG combiner.

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

12 years agoAdd support for finding cacheflush on OpenBSD/mips64 platforms.
Chandler Carruth [Tue, 11 Sep 2012 01:17:24 +0000 (01:17 +0000)]
Add support for finding cacheflush on OpenBSD/mips64 platforms.

Patch by Brad Smith!

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

12 years agoReorganize MachineScheduler interfaces and publish them in the header.
Andrew Trick [Tue, 11 Sep 2012 00:39:15 +0000 (00:39 +0000)]
Reorganize MachineScheduler interfaces and publish them in the header.

The Hexagon target decided to use a lot of functionality from the
target-independent scheduler. That's fine, and other targets should be
able to do the same. This reorg and API update makes that easy.

For the record, ScheduleDAGMI was not meant to be subclassed. Instead,
new scheduling algorithms should be able to implement
MachineSchedStrategy and be done. But if need be, it's nice to be
able to extend ScheduleDAGMI, so I also made that easier. The target
scheduler is somewhat more apt to break that way though.

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

12 years agoRemove unused declaration
Andrew Trick [Tue, 11 Sep 2012 00:39:12 +0000 (00:39 +0000)]
Remove unused declaration

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

12 years agoRevert r160148 it seems to cause more problems than it should
Eric Christopher [Mon, 10 Sep 2012 23:34:06 +0000 (23:34 +0000)]
Revert r160148 it seems to cause more problems than it should
right now. We'll fix PR13303 a different way.

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

12 years ago80-col fixup.
Eric Christopher [Mon, 10 Sep 2012 23:34:03 +0000 (23:34 +0000)]
80-col fixup.

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

12 years ago80-col fixup.
Eric Christopher [Mon, 10 Sep 2012 23:34:00 +0000 (23:34 +0000)]
80-col fixup.

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

12 years agoNo reason to construct this twice.
Eric Christopher [Mon, 10 Sep 2012 23:33:57 +0000 (23:33 +0000)]
No reason to construct this twice.

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

12 years agoAdd newline.
Chad Rosier [Mon, 10 Sep 2012 23:09:27 +0000 (23:09 +0000)]
Add newline.

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

12 years agoUpdate function names to conform to guidelines. No functional change intended.
Chad Rosier [Mon, 10 Sep 2012 22:50:57 +0000 (22:50 +0000)]
Update function names to conform to guidelines.  No functional change intended.

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

12 years agoRevert r163556. Missed updates to tablegen files.
Chad Rosier [Mon, 10 Sep 2012 22:30:35 +0000 (22:30 +0000)]
Revert r163556. Missed updates to tablegen files.

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

12 years agoUpdate function names to conform to guidelines. No functional change intended.
Chad Rosier [Mon, 10 Sep 2012 22:23:45 +0000 (22:23 +0000)]
Update function names to conform to guidelines.  No functional change intended.

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

12 years agotest/CodeGen/X86/ms-inline-asm.ll: Relax for non-darwin x86 targets. '##InlineAsm...
NAKAMURA Takumi [Mon, 10 Sep 2012 22:04:54 +0000 (22:04 +0000)]
test/CodeGen/X86/ms-inline-asm.ll: Relax for non-darwin x86 targets. '##InlineAsm' could not be seen in other hosts.

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

12 years ago[ms-inline asm] Properly emit the asm directives when the AsmPrinterVariant
Chad Rosier [Mon, 10 Sep 2012 21:36:05 +0000 (21:36 +0000)]
[ms-inline asm] Properly emit the asm directives when the AsmPrinterVariant
and InlineAsmVariant don't match.

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

12 years agoUpdate test case for Release builds.
Chad Rosier [Mon, 10 Sep 2012 21:31:43 +0000 (21:31 +0000)]
Update test case for Release builds.

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

12 years agoRemove redundant semicolons which are null statements.
Dmitri Gribenko [Mon, 10 Sep 2012 21:26:47 +0000 (21:26 +0000)]
Remove redundant semicolons which are null statements.

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

12 years agoDisable stack coloring because it makes dragonegg fail bootstrapping.
Nadav Rotem [Mon, 10 Sep 2012 21:17:58 +0000 (21:17 +0000)]
Disable stack coloring because it makes dragonegg fail bootstrapping.

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

12 years ago[ms-inline asm] Pass the correct AsmVariant to the PrintAsmOperand() function
Chad Rosier [Mon, 10 Sep 2012 21:10:49 +0000 (21:10 +0000)]
[ms-inline asm] Pass the correct AsmVariant to the PrintAsmOperand() function
and update the printOperand() function accordingly.

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

12 years ago[ms-inline asm] Add support for .att_syntax directive.
Chad Rosier [Mon, 10 Sep 2012 20:54:39 +0000 (20:54 +0000)]
[ms-inline asm] Add support for .att_syntax directive.

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

12 years agoEnable stack coloring.
Nadav Rotem [Mon, 10 Sep 2012 20:15:49 +0000 (20:15 +0000)]
Enable stack coloring.

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

12 years agoDon't attempt to use flags from predicated instructions.
Jakob Stoklund Olesen [Mon, 10 Sep 2012 19:17:25 +0000 (19:17 +0000)]
Don't attempt to use flags from predicated instructions.

The ARM backend can eliminate cmp instructions by reusing flags from a
nearby sub instruction with similar arguments.

Don't do that if the sub is predicated - the flags are not written
unconditionally.

<rdar://problem/12263428>

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