Commit Graph

84992 Commits

Author SHA1 Message Date
Owen Anderson
045ca86bb3 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
2012-09-12 20:09:19 +00:00
Jakob Stoklund Olesen
01b50ca5b3 Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163735 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 20:04:17 +00:00
Eric Christopher
fd1cd57221 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
2012-09-12 18:42:31 +00:00
Chad Rosier
f58ae5dfc1 [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
2012-09-12 18:24:26 +00:00
Jim Grosbach
a562dc7228 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
2012-09-12 17:40:25 +00:00
Manman Ren
ee99c7f1bf 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
2012-09-12 17:04:11 +00:00
Dmitri Gribenko
67c8978617 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
2012-09-12 16:59:47 +00:00
Roman Divacky
ba9d069d79 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
2012-09-12 15:29:32 +00:00
Alexander Potapenko
db9ba339b1 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
2012-09-12 15:01:33 +00:00
Roman Divacky
9d760ae5c6 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
2012-09-12 14:47:47 +00:00
Roman Divacky
ee3392b1a9 Add support for AMD Geode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163710 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 14:36:02 +00:00
Kristof Beyls
789efbad2a 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
2012-09-12 11:25:02 +00:00
Nadav Rotem
d76f6eadc8 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
2012-09-12 11:06:26 +00:00
James Molloy
c4f70d437d 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
2012-09-12 10:18:23 +00:00
James Molloy
b17cf29784 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
2012-09-12 10:03:31 +00:00
Duncan Sands
79da6ef84f 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
2012-09-12 09:55:51 +00:00
Nadav Rotem
dba5de5246 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
2012-09-12 07:58:35 +00:00
Lang Hames
6d742cc61e 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
2012-09-12 06:56:16 +00:00
Craig Topper
7c02284774 Indentation fixes. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163682 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-12 06:20:41 +00:00
Manman Ren
286c4dc355 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
2012-09-12 05:06:18 +00:00
Nadav Rotem
0a16da4457 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
2012-09-12 04:57:37 +00:00
Eric Christopher
2c57a334d7 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
2012-09-12 00:26:55 +00:00
Owen Anderson
83c0eefa3b 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
2012-09-11 23:47:08 +00:00
Owen Anderson
d2c699706c 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
2012-09-11 23:32:17 +00:00
Chad Rosier
2a3fcb382e Add documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163658 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 23:20:20 +00:00
Chad Rosier
fde528fa2b 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
2012-09-11 23:03:44 +00:00
Chad Rosier
3d1f75a3d5 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
2012-09-11 23:02:35 +00:00
Manman Ren
b720be6a50 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
2012-09-11 22:23:19 +00:00
Chad Rosier
66b64bec60 StringSwitchify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163649 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 21:10:25 +00:00
Chad Rosier
aa645f78a2 Simplify logic. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163648 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 20:57:04 +00:00
Chad Rosier
a7b159ccdd [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
2012-09-11 19:09:56 +00:00
Manman Ren
020aba0c3b 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
2012-09-11 17:43:35 +00:00
Jakob Stoklund Olesen
a6035773d8 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
2012-09-11 16:34:08 +00:00
Jakob Stoklund Olesen
de0250728b 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
2012-09-11 16:34:05 +00:00
Jakob Stoklund Olesen
59f45e4610 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
2012-09-11 16:34:02 +00:00
Chad Rosier
ef68cfa8b8 Formatting. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163627 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 16:33:10 +00:00
Nadav Rotem
1eba4a7a28 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
2012-09-11 15:40:27 +00:00
Nadav Rotem
50bdea299c Enable stack coloring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163617 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 13:48:35 +00:00
Nadav Rotem
8754bbbe67 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
2012-09-11 12:34:27 +00:00
Evgeniy Stepanov
468a95fb04 CMake toolchain file for Android NDK.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163612 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 11:54:27 +00:00
Duncan Sands
25a4fcce67 Add IRC handle.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163601 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 07:50:40 +00:00
Craig Topper
55b2405484 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
2012-09-11 06:15:32 +00:00
Craig Topper
9e6dc8b9e7 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
2012-09-11 04:19:21 +00:00
NAKAMURA Takumi
0dd9b61f9f llvm/lib/Transforms/Utils/CMakeLists.txt: Update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163593 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 02:55:37 +00:00
Alex Rosenberg
95f1ef4ac7 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
2012-09-11 02:46:18 +00:00
Craig Topper
dd201ff1dc 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
2012-09-11 01:45:21 +00:00
Chandler Carruth
7b617158db 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
2012-09-11 01:17:24 +00:00
Andrew Trick
78e5efe1b2 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
2012-09-11 00:39:15 +00:00
Andrew Trick
88df977d4a Remove unused declaration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163579 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-11 00:39:12 +00:00
Eric Christopher
09e4750919 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
2012-09-10 23:34:06 +00:00