1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

84772 Commits

Author SHA1 Message Date
Jim Grosbach
adfdb46f2c TableGen: Convert an assert() to a proper diagnostic.
llvm-svn: 163726
2012-09-12 17:40:25 +00:00
Manman Ren
9949a09bfb PGO: preserve branch-weight metadata when removing a case which jumps
to the default target.

llvm-svn: 163724
2012-09-12 17:04:11 +00:00
Dmitri Gribenko
8982c8a34d Fix a couple of Doxygen comment issues pointed out by -Wdocumentation.
llvm-svn: 163721
2012-09-12 16:59:47 +00:00
Roman Divacky
5ad9880cb1 Enable exceptions handling on PPC64 now that cr misaligned spilling
was fixed in r163713.

llvm-svn: 163715
2012-09-12 15:29:32 +00:00
Alexander Potapenko
33d40fe071 Suppress the warnings about unused parameters in changeColor()
llvm-svn: 163714
2012-09-12 15:01:33 +00:00
Roman Divacky
3d302860e6 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!

llvm-svn: 163713
2012-09-12 14:47:47 +00:00
Roman Divacky
a811b158e5 Add support for AMD Geode.
llvm-svn: 163710
2012-09-12 14:36:02 +00:00
Kristof Beyls
76d939497b 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.

llvm-svn: 163703
2012-09-12 11:25:02 +00:00
Nadav Rotem
71183ed37c 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.
llvm-svn: 163702
2012-09-12 11:06:26 +00:00
James Molloy
df778b78ea 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.

llvm-svn: 163695
2012-09-12 10:18:23 +00:00
James Molloy
5fc1ae1f6a 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.

llvm-svn: 163694
2012-09-12 10:03:31 +00:00
Duncan Sands
495145097c 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ć.

llvm-svn: 163693
2012-09-12 09:55:51 +00:00
Nadav Rotem
da5869fc42 Enable stack-coloring, in hope that the recent fixes will enable correct dragonegg self-hosting.
llvm-svn: 163687
2012-09-12 07:58:35 +00:00
Lang Hames
ec4a366e08 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.
 

llvm-svn: 163685
2012-09-12 06:56:16 +00:00
Craig Topper
24d6cafc79 Indentation fixes. No functional change.
llvm-svn: 163682
2012-09-12 06:20:41 +00:00
Manman Ren
fdeb41a212 Release build: guard dump functions with
"#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)"

No functional change. Update r163344.

llvm-svn: 163679
2012-09-12 05:06:18 +00:00
Nadav Rotem
64c3cf5b29 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.

llvm-svn: 163678
2012-09-12 04:57:37 +00:00
Eric Christopher
9a8f37667b Add some support for dealing with an object pointer on arguments.
Part of rdar://9797999

llvm-svn: 163667
2012-09-12 00:26:55 +00:00
Owen Anderson
e42d2ba20d 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.
llvm-svn: 163664
2012-09-11 23:47:08 +00:00
Owen Anderson
8aa2a6cbb7 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.
llvm-svn: 163659
2012-09-11 23:32:17 +00:00
Chad Rosier
446698775e Add documentation.
llvm-svn: 163658
2012-09-11 23:20:20 +00:00
Chad Rosier
4658136842 Add a few virtual functions to the abstract MCParsedAsmOperand class.
llvm-svn: 163655
2012-09-11 23:03:44 +00:00
Chad Rosier
786e0643c5 Rename the isMemory() function to isMem(). No functional change intended.
llvm-svn: 163654
2012-09-11 23:02:35 +00:00
Manman Ren
1a047422a0 Release build: guard dump functions with
"#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)"

No functional change. Update r163339.

llvm-svn: 163653
2012-09-11 22:23:19 +00:00
Chad Rosier
c778c0a3f4 StringSwitchify.
llvm-svn: 163649
2012-09-11 21:10:25 +00:00
Chad Rosier
e7a6502bbe Simplify logic. No functional change intended.
llvm-svn: 163648
2012-09-11 20:57:04 +00:00
Chad Rosier
2853061544 [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.

llvm-svn: 163645
2012-09-11 19:09:56 +00:00
Manman Ren
d492bca8a6 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.

llvm-svn: 163635
2012-09-11 17:43:35 +00:00
Jakob Stoklund Olesen
8a149baa44 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.

llvm-svn: 163630
2012-09-11 16:34:08 +00:00
Jakob Stoklund Olesen
d2bb5cf28e 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.

llvm-svn: 163629
2012-09-11 16:34:05 +00:00
Jakob Stoklund Olesen
1e7f74aaa8 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.

llvm-svn: 163628
2012-09-11 16:34:02 +00:00
Chad Rosier
9d8aeab807 Formatting. No functional change intended.
llvm-svn: 163627
2012-09-11 16:33:10 +00:00
Nadav Rotem
d399d17563 Dragonegg selfhost exposed additional cases where alloca usage moved outside of lifetime markers. Disabling the pass for now.
llvm-svn: 163623
2012-09-11 15:40:27 +00:00
Nadav Rotem
27e7d654e0 Enable stack coloring.
llvm-svn: 163617
2012-09-11 13:48:35 +00:00
Nadav Rotem
54b95cb654 Stack Coloring: Dont crash on dbg values which use stack frames.
llvm-svn: 163616
2012-09-11 12:34:27 +00:00
Evgeniy Stepanov
f27d93c5ff CMake toolchain file for Android NDK.
llvm-svn: 163612
2012-09-11 11:54:27 +00:00
Duncan Sands
872e5469d6 Add IRC handle.
llvm-svn: 163601
2012-09-11 07:50:40 +00:00
Craig Topper
557b8a5a81 Make a bunch of lowering helper functions static instead of member functions. No functional change.
llvm-svn: 163596
2012-09-11 06:15:32 +00:00
Craig Topper
c9fd7a1602 Change unsigned to a uint16_t in static disassembler tables to reduce the table size.
llvm-svn: 163594
2012-09-11 04:19:21 +00:00
NAKAMURA Takumi
e65bf0a123 llvm/lib/Transforms/Utils/CMakeLists.txt: Update.
llvm-svn: 163593
2012-09-11 02:55:37 +00:00
Alex Rosenberg
ab6a7af449 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.
llvm-svn: 163592
2012-09-11 02:46:18 +00:00
Craig Topper
a00400675a Teach DAG combiner to constant fold FABS of a BUILD_VECTOR of ConstantFPs. Factor similar code out of FNEG DAG combiner.
llvm-svn: 163587
2012-09-11 01:45:21 +00:00
Chandler Carruth
876a0bce73 Add support for finding cacheflush on OpenBSD/mips64 platforms.
Patch by Brad Smith!

llvm-svn: 163584
2012-09-11 01:17:24 +00:00
Andrew Trick
ffec33601b 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.

llvm-svn: 163580
2012-09-11 00:39:15 +00:00
Andrew Trick
e06bae49d1 Remove unused declaration
llvm-svn: 163579
2012-09-11 00:39:12 +00:00
Eric Christopher
5fe521ef3a Revert r160148 it seems to cause more problems than it should
right now. We'll fix PR13303 a different way.

llvm-svn: 163570
2012-09-10 23:34:06 +00:00
Eric Christopher
a327d985db 80-col fixup.
llvm-svn: 163569
2012-09-10 23:34:03 +00:00
Eric Christopher
91aebc4188 80-col fixup.
llvm-svn: 163568
2012-09-10 23:34:00 +00:00
Eric Christopher
c774770535 No reason to construct this twice.
llvm-svn: 163567
2012-09-10 23:33:57 +00:00
Chad Rosier
f7b609f0fb Add newline.
llvm-svn: 163565
2012-09-10 23:09:27 +00:00