oota-llvm.git
12 years agoAdd MachineInstr::isTransient().
Jakob Stoklund Olesen [Mon, 30 Jul 2012 18:34:14 +0000 (18:34 +0000)]
Add MachineInstr::isTransient().

This is a cleaned up version of the isFree() function in
MachineTraceMetrics.cpp.

Transient instructions are very unlikely to produce any code in the
final output. Either because they get eliminated by RegisterCoalescing,
or because they are pseudo-instructions like labels and debug values.

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

12 years agoAdd MachineTraceMetrics::verify().
Jakob Stoklund Olesen [Mon, 30 Jul 2012 18:34:11 +0000 (18:34 +0000)]
Add MachineTraceMetrics::verify().

This function verifies the consistency of cached data in the
MachineTraceMetrics analysis.

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

12 years agoVerify that the CFG hasn't changed during invalidate().
Jakob Stoklund Olesen [Mon, 30 Jul 2012 17:36:49 +0000 (17:36 +0000)]
Verify that the CFG hasn't changed during invalidate().

The MachineTraceMetrics analysis must be invalidated before modifying
the CFG. This will catch some of the violations of that rule.

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

12 years agoAdd MachineBasicBlock::isPredecessor().
Jakob Stoklund Olesen [Mon, 30 Jul 2012 17:36:47 +0000 (17:36 +0000)]
Add MachineBasicBlock::isPredecessor().

A->isPredecessor(B) is the same as B->isSuccessor(A), but it can
tolerate a B that is null or dangling. This shouldn't happen normally,
but it it useful for verification code.

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

12 years agoWhen constant folding GEP expressions, keep the address space information of pointers.
Nadav Rotem [Mon, 30 Jul 2012 07:25:20 +0000 (07:25 +0000)]
When constant folding GEP expressions, keep the address space information of pointers.

Together with Ran Chachick <ran.chachick@intel.com>

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

12 years agoMark MOVZX16/MOVSX16 as neverHasSideEffects/mayLoad
Craig Topper [Mon, 30 Jul 2012 07:14:07 +0000 (07:14 +0000)]
Mark MOVZX16/MOVSX16 as neverHasSideEffects/mayLoad

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

12 years agoMark MOVZX32_NOREX as isCodeGenOnly and neverHasSideEffects. The isCodeGenOnly change...
Craig Topper [Mon, 30 Jul 2012 06:48:11 +0000 (06:48 +0000)]
Mark MOVZX32_NOREX as isCodeGenOnly and neverHasSideEffects. The isCodeGenOnly change allows special detection of _NOREX instructions to be removed from tablegen disassembler code.

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

12 years agoRemove some unnecessary filter checks. They were already covered by IsCodeGenOnly
Craig Topper [Mon, 30 Jul 2012 06:27:19 +0000 (06:27 +0000)]
Remove some unnecessary filter checks. They were already covered by IsCodeGenOnly

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

12 years agoRemove check for sub class of X86Inst from filter function since caller guaranteed...
Craig Topper [Mon, 30 Jul 2012 05:39:34 +0000 (05:39 +0000)]
Remove check for sub class of X86Inst from filter function since caller guaranteed it. Replace another sub class check with ShouldBeEmitted flag since it was factored in there already.

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

12 years agoSimplify code that filtered certain instructions in two different ways. No functional...
Craig Topper [Mon, 30 Jul 2012 05:10:05 +0000 (05:10 +0000)]
Simplify code that filtered certain instructions in two different ways. No functional change.

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

12 years agoRemove check for f256mem from has256BitOperands as nothing depended on it and it...
Craig Topper [Mon, 30 Jul 2012 04:53:00 +0000 (04:53 +0000)]
Remove check for f256mem from has256BitOperands as nothing depended on it and it isn't the only 256-bit memory type anyway.

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

12 years agoRemove trailing whitespace.
Craig Topper [Mon, 30 Jul 2012 04:48:12 +0000 (04:48 +0000)]
Remove trailing whitespace.

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

12 years agoGive VCVTTPD2DQ priority over CVTTPD2DQ.
Craig Topper [Mon, 30 Jul 2012 02:20:32 +0000 (02:20 +0000)]
Give VCVTTPD2DQ priority over CVTTPD2DQ.

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

12 years agoFix patterns for CVTTPS2DQ to specify SSE2 instead of SSE1.
Craig Topper [Mon, 30 Jul 2012 02:14:02 +0000 (02:14 +0000)]
Fix patterns for CVTTPS2DQ to specify SSE2 instead of SSE1.

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

12 years agoFix up patterns for VCVTSS2SD. Specifically give it priority over SSE form. Add an...
Craig Topper [Mon, 30 Jul 2012 01:38:57 +0000 (01:38 +0000)]
Fix up patterns for VCVTSS2SD. Specifically give it priority over SSE form. Add an OptForSpeed to explicitly pair up with an OptForSize that was already on another pattern.

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

12 years agoFix load types on intrinsic forms of SS2SD and SD2SS AVX/SSE convert instruction...
Craig Topper [Sun, 29 Jul 2012 23:26:34 +0000 (23:26 +0000)]
Fix load types on intrinsic forms of SS2SD and SD2SS AVX/SSE convert instruction patterns.

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

12 years agoMove more SSE/AVX convert instruction patterns into their definitions.
Craig Topper [Sun, 29 Jul 2012 22:30:06 +0000 (22:30 +0000)]
Move more SSE/AVX convert instruction patterns into their definitions.

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

12 years agoAPInt: Simplify code.
Benjamin Kramer [Sun, 29 Jul 2012 12:33:29 +0000 (12:33 +0000)]
APInt: Simplify code.

No functionality change.

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

12 years agoRevert r160920 and r160919 due to dragonegg and clang selfhost failure
Manman Ren [Sun, 29 Jul 2012 02:44:09 +0000 (02:44 +0000)]
Revert r160920 and r160919 due to dragonegg and clang selfhost failure

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

12 years agoAdd testcases for GlobalOpt changes in r160693 and r160757.
Nick Lewycky [Sun, 29 Jul 2012 01:15:37 +0000 (01:15 +0000)]
Add testcases for GlobalOpt changes in r160693 and r160757.

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

12 years agoFold patterns for some of the SSE/AVX convert instructions into their instruction...
Craig Topper [Sat, 28 Jul 2012 18:59:19 +0000 (18:59 +0000)]
Fold patterns for some of the SSE/AVX convert instructions into their instruction definitions.

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

12 years agoMark some of the SSE/AVX convert instructions as mayLoad/neverHasSideEffects.
Craig Topper [Sat, 28 Jul 2012 18:36:39 +0000 (18:36 +0000)]
Mark some of the SSE/AVX convert instructions as mayLoad/neverHasSideEffects.

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

12 years agoX86 Peephole: fold loads to the source register operand if possible.
Manman Ren [Sat, 28 Jul 2012 17:51:24 +0000 (17:51 +0000)]
X86 Peephole: fold loads to the source register operand if possible.

Trying to fix the bot by specifying a triple in the failing testing cases.

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

12 years agoX86 Peephole: fold loads to the source register operand if possible.
Manman Ren [Sat, 28 Jul 2012 16:48:01 +0000 (16:48 +0000)]
X86 Peephole: fold loads to the source register operand if possible.

Machine CSE and other optimizations can remove instructions so folding
is possible at peephole while not possible at ISel.

rdar://10554090 and rdar://11873276

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

12 years agoMake CVTSS2SI instruction definition consistent with CVTSD2SI.
Craig Topper [Sat, 28 Jul 2012 08:28:23 +0000 (08:28 +0000)]
Make CVTSS2SI instruction definition consistent with CVTSD2SI.

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

12 years agoFix up memory load types for SSE scalar convert intrinsic patterns.
Craig Topper [Sat, 28 Jul 2012 07:59:59 +0000 (07:59 +0000)]
Fix up memory load types for SSE scalar convert intrinsic patterns.

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

12 years agoX86 Peephole: fix PR13475 in optimizeCompare.
Manman Ren [Sat, 28 Jul 2012 03:15:46 +0000 (03:15 +0000)]
X86 Peephole: fix PR13475 in optimizeCompare.

It is possible that an instruction can use and update EFLAGS.
When checking the safety, we should check the usage of EFLAGS first before
declaring it is safe to optimize due to the update.

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

12 years agoReenable a basic SSA DAG builder optimization.
Andrew Trick [Sat, 28 Jul 2012 01:48:15 +0000 (01:48 +0000)]
Reenable a basic SSA DAG builder optimization.

Jakob fixed ProcessImplicifDefs in r159149.

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

12 years agoAdd more debug output to MachineTraceMetrics.
Jakob Stoklund Olesen [Fri, 27 Jul 2012 23:58:38 +0000 (23:58 +0000)]
Add more debug output to MachineTraceMetrics.

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

12 years agoKeep track of the head and tail of the trace through each block.
Jakob Stoklund Olesen [Fri, 27 Jul 2012 23:58:36 +0000 (23:58 +0000)]
Keep track of the head and tail of the trace through each block.

This makes it possible to quickly detect blocks that are outside the
trace.

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

12 years agoAdd a DW_AT_high_pc for CUs that are a single address range. Update
Eric Christopher [Fri, 27 Jul 2012 22:00:05 +0000 (22:00 +0000)]
Add a DW_AT_high_pc for CUs that are a single address range. Update
all tests accordingly.

Fixes PR13351.

Patch by shinichiro hamaji!

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

12 years agoAlso compute register mask lists under -new-live-intervals.
Jakob Stoklund Olesen [Fri, 27 Jul 2012 21:56:39 +0000 (21:56 +0000)]
Also compute register mask lists under -new-live-intervals.

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

12 years agoTypos.
Chad Rosier [Fri, 27 Jul 2012 21:41:59 +0000 (21:41 +0000)]
Typos.

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

12 years agoTeach CodeGenPrep to look past bitcast when it's duplicating return instruction
Evan Cheng [Fri, 27 Jul 2012 21:21:26 +0000 (21:21 +0000)]
Teach CodeGenPrep to look past bitcast when it's duplicating return instruction
into predecessor blocks to enable tail call optimization.

rdar://11958338

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

12 years agoEliminate the IS_PHI_DEF flag and VNInfo::setIsPHIDef().
Jakob Stoklund Olesen [Fri, 27 Jul 2012 21:11:14 +0000 (21:11 +0000)]
Eliminate the IS_PHI_DEF flag and VNInfo::setIsPHIDef().

A value number is a PHI def if and only if it begins at a block
boundary. This can be derived from the def slot, a separate flag is not
necessary.

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

12 years agoAdd a -new-live-intervals experimental option.
Jakob Stoklund Olesen [Fri, 27 Jul 2012 20:58:46 +0000 (20:58 +0000)]
Add a -new-live-intervals experimental option.

This option replaces the existing live interval computation with one
based on LiveRangeCalc.cpp. The new algorithm does not depend on
LiveVariables, and it can be run at any time, before or after leaving
SSA form.

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

12 years agoFixing problems with X86_64_32 relocations and making the assertions more readable.
Andrew Kaylor [Fri, 27 Jul 2012 20:30:12 +0000 (20:30 +0000)]
Fixing problems with X86_64_32 relocations and making the assertions more readable.

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

12 years agoAdd <imp-def> of super-register when lowering SUBREG_TO_REG.
Jakob Stoklund Olesen [Fri, 27 Jul 2012 20:19:49 +0000 (20:19 +0000)]
Add <imp-def> of super-register when lowering SUBREG_TO_REG.

Patch by Tyler Nowicki!

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

12 years agoSmallVector: Crank up verbosity of asserts per Chandler's request.
Benjamin Kramer [Fri, 27 Jul 2012 19:05:58 +0000 (19:05 +0000)]
SmallVector: Crank up verbosity of asserts per Chandler's request.

Also add assertions to validate the iterator in the insert method overloads.

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

12 years agoThe TimePassesIsEnabled has since moved to PassManager.cpp.
Chad Rosier [Fri, 27 Jul 2012 19:03:02 +0000 (19:03 +0000)]
The TimePassesIsEnabled has since moved to PassManager.cpp.

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

12 years agoTest commit, clean up comment
Andrew Kaylor [Fri, 27 Jul 2012 18:39:47 +0000 (18:39 +0000)]
Test commit, clean up comment

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

12 years agofix PR13390: do not loop forever with self-referencing self instructions
Nuno Lopes [Fri, 27 Jul 2012 18:21:15 +0000 (18:21 +0000)]
fix PR13390: do not loop forever with self-referencing self instructions

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

12 years agofix infinite loop in instcombine in the presence of a (malformed) self-referencing...
Nuno Lopes [Fri, 27 Jul 2012 18:03:57 +0000 (18:03 +0000)]
fix infinite loop in instcombine in the presence of a (malformed) self-referencing select inst.
This can happen as long as the instruction is not reachable. Instcombine does generate these unreachable malformed selects when doing RAUW

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

12 years agoTest commit, clean up comment
Andrew Kaylor [Fri, 27 Jul 2012 17:52:42 +0000 (17:52 +0000)]
Test commit, clean up comment

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

12 years agoGive MCRegisterInfo an implementation file.
Jakob Stoklund Olesen [Fri, 27 Jul 2012 16:25:20 +0000 (16:25 +0000)]
Give MCRegisterInfo an implementation file.

Move some functions from MCRegisterInfo.h that don't need to be inline.

This shrinks llc by 8K.

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

12 years agoSmallVector::erase: Assert that iterators are actually inside the vector.
Benjamin Kramer [Fri, 27 Jul 2012 09:10:25 +0000 (09:10 +0000)]
SmallVector::erase: Assert that iterators are actually inside the vector.

The rationale here is that it's hard to write loops containing vector erases and
it only shows up if the vector contains non-trivial objects leading to crashes
when forming them out of garbage memory.

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

12 years agoClean up includes.
Craig Topper [Fri, 27 Jul 2012 06:44:02 +0000 (06:44 +0000)]
Clean up includes.

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

12 years agoEliminate the large XXXSubRegTable constant arrays.
Jakob Stoklund Olesen [Fri, 27 Jul 2012 00:10:51 +0000 (00:10 +0000)]
Eliminate the large XXXSubRegTable constant arrays.

These tables were indexed by [register][subreg index] which made them,
very large and sparse.

Replace them with lists of sub-register indexes that match the existing
lists of sub-registers. MCRI::getSubReg() becomes a very short linear
search, like getSubRegIndex() already was.

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

12 years agoRemove support for 'CompositeIndices' and sub-register cycles.
Jakob Stoklund Olesen [Thu, 26 Jul 2012 23:39:50 +0000 (23:39 +0000)]
Remove support for 'CompositeIndices' and sub-register cycles.

Now that the weird X86 sub_ss and sub_sd sub-register indexes are gone,
there is no longer a need for the CompositeIndices construct in .td
files. Sub-register index composition can be specified on the
SubRegIndex itself using the ComposedOf field.

Also enforce unique names for sub-registers in TableGen. The same
sub-register cannot be available with multiple sub-register indexes.

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

12 years agoPass the correct call frame size to callseq_start node. This is needed to
Akira Hatanaka [Thu, 26 Jul 2012 23:27:01 +0000 (23:27 +0000)]
Pass the correct call frame size to callseq_start node. This is needed to
replace uses of function getMaxCallFrameSize defined in MipsFunctionInfo with
the one MachineFrameInfo has.

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

12 years agoSimplify demanded bits of select sources where the condition is a constant vector
Pete Cooper [Thu, 26 Jul 2012 23:10:24 +0000 (23:10 +0000)]
Simplify demanded bits of select sources where the condition is a constant vector

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

12 years agoRemove the X86 sub_ss and sub_sd sub-register indexes completely.
Jakob Stoklund Olesen [Thu, 26 Jul 2012 23:07:20 +0000 (23:07 +0000)]
Remove the X86 sub_ss and sub_sd sub-register indexes completely.

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

12 years agoRemove the last mentions of sub_ss and sub_sd from patterns.
Jakob Stoklund Olesen [Thu, 26 Jul 2012 23:03:08 +0000 (23:03 +0000)]
Remove the last mentions of sub_ss and sub_sd from patterns.

I'll remove these two sub-register indexes shortly.

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

12 years agoEliminate sub_ss, sub_sd from broadcast patterns.
Jakob Stoklund Olesen [Thu, 26 Jul 2012 22:59:06 +0000 (22:59 +0000)]
Eliminate sub_ss, sub_sd from broadcast patterns.

The (COPY_TO_REGCLASS GR32:$src, VR128) pattern looks odd, but
copyPhysReg does the right thing with it. (The old pattern would
eventually produce the same cross-class copy).

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

12 years agoTeach SimplifyDemandedBits how to look through fpext and fptrunc to simplify their...
Pete Cooper [Thu, 26 Jul 2012 22:37:04 +0000 (22:37 +0000)]
Teach SimplifyDemandedBits how to look through fpext and fptrunc to simplify their operand

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

12 years agoEliminate more sub_ss / sub_sd patterns.
Jakob Stoklund Olesen [Thu, 26 Jul 2012 22:30:18 +0000 (22:30 +0000)]
Eliminate more sub_ss / sub_sd patterns.

This gets rid of some more INSERT_SUBREG - IMPLICIT_DEF patterns,
simplifying the emitted code a bit.

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

12 years agoEliminate some SUBREG_TO_REG patterns with sub_ss and sub_sd.
Jakob Stoklund Olesen [Thu, 26 Jul 2012 22:03:21 +0000 (22:03 +0000)]
Eliminate some SUBREG_TO_REG patterns with sub_ss and sub_sd.

The SUBREG_TO_REG instruction has magic semantics asserting that the
source value was defined by an instruction that cleared the high half of
the register. Those semantics are never actually exploited for xmm
registers.

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

12 years agoEliminate a batch of uses of sub_ss and sub_sd in the X86 target.
Jakob Stoklund Olesen [Thu, 26 Jul 2012 21:40:42 +0000 (21:40 +0000)]
Eliminate a batch of uses of sub_ss and sub_sd in the X86 target.

These idempotent sub-register indices don't do anything --- They simply
map XMM registers to themselves.  They no longer affect register classes
either since the SubRegClasses field has been removed from Target.td.

This patch replaces XMM->XMM EXTRACT_SUBREG and INSERT_SUBREG patterns
with COPY_TO_REGCLASS patterns which simply become COPY instructions.

The number of IMPLICIT_DEF instructions before register allocation is
reduced, and that is the cause of the test case changes.

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

12 years agoAdd support for v16i32/v16i64 into the code generator. This is required for backends...
Micah Villmow [Thu, 26 Jul 2012 21:22:00 +0000 (21:22 +0000)]
Add support for v16i32/v16i64 into the code generator. This is required for backends that use i32/i64 vectors for the getSetCCResultType function.

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

12 years agoMake comments in Debug.cpp and Debug.h consistent. Rename SetCurrentDebugType;
Chad Rosier [Thu, 26 Jul 2012 20:38:52 +0000 (20:38 +0000)]
Make comments in Debug.cpp and Debug.h consistent.  Rename SetCurrentDebugType;
Function names should be camel case, and start with a lower case letter.  No
functional change intended.

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

12 years agoUse an otherwise unused variable.
Jakob Stoklund Olesen [Thu, 26 Jul 2012 19:42:56 +0000 (19:42 +0000)]
Use an otherwise unused variable.

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

12 years agoStart scaffolding for a MachineTraceMetrics analysis pass.
Jakob Stoklund Olesen [Thu, 26 Jul 2012 18:38:11 +0000 (18:38 +0000)]
Start scaffolding for a MachineTraceMetrics analysis pass.

This is still a work in progress.

Out-of-order CPUs usually execute instructions from multiple basic
blocks simultaneously, so it is necessary to look at longer traces when
estimating the performance effects of code transformations.

The MachineTraceMetrics analysis will pick a typical trace through a
given basic block and provide performance metrics for the trace. Metrics
will include:

- Instruction count through the trace.
- Issue count per functional unit.
- Critical path length, and per-instruction 'slack'.

These metrics can be used to determine the performance limiting factor
when executing the trace, and how it will be affected by a code
transformation.

Initially, this will be used by the early if-conversion pass.

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

12 years agoAdd a floor intrinsic.
Dan Gohman [Thu, 26 Jul 2012 17:43:27 +0000 (17:43 +0000)]
Add a floor intrinsic.

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

12 years agodo null checks for a few more Emit*() functions.
Nuno Lopes [Thu, 26 Jul 2012 17:10:46 +0000 (17:10 +0000)]
do null checks for a few more Emit*() functions.
Thanks Eli for noticing.

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

12 years agoStop reassociate from looking through expressions of arbitrary complexity. This
Duncan Sands [Thu, 26 Jul 2012 09:26:40 +0000 (09:26 +0000)]
Stop reassociate from looking through expressions of arbitrary complexity.  This
is a temporary measure until my fix for PR13021 is ready.

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

12 years agoTake people straight to the contents of the file.
Duncan Sands [Thu, 26 Jul 2012 08:08:31 +0000 (08:08 +0000)]
Take people straight to the contents of the file.

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

12 years agoAdd the list of code owners to the top level of the LLVM source tree to
Duncan Sands [Thu, 26 Jul 2012 08:04:09 +0000 (08:04 +0000)]
Add the list of code owners to the top level of the LLVM source tree to
hopefully make it more visible.  Adjust the web-docs to have a link to
this file rather than the list itself.  I described code owners as also
being gatekeepers for their part of the code, which I think is true but
isn't in the code owner explanation on the web page.

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

12 years agoMake l/q suffixes on AVX forms of scalar convert instructions consistent with their...
Craig Topper [Thu, 26 Jul 2012 07:48:28 +0000 (07:48 +0000)]
Make l/q suffixes on AVX forms of scalar convert instructions consistent with their non-AVX forms.

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

12 years agoFix call setup for PIC.
Akira Hatanaka [Thu, 26 Jul 2012 02:24:43 +0000 (02:24 +0000)]
Fix call setup for PIC.

Patch by Reed Kotler.

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

12 years agoFix two typos in the doc
Sylvestre Ledru [Wed, 25 Jul 2012 22:01:31 +0000 (22:01 +0000)]
Fix two typos in the doc

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

12 years agoDifferentially encode all MC register lists.
Jakob Stoklund Olesen [Wed, 25 Jul 2012 21:41:37 +0000 (21:41 +0000)]
Differentially encode all MC register lists.

This simplifies MCRegisterInfo and shrinks the target descriptions a bit
more.

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

12 years agoIt's not safe to blindly remove invoke instructions. This happens when we
Nick Lewycky [Wed, 25 Jul 2012 21:19:40 +0000 (21:19 +0000)]
It's not safe to blindly remove invoke instructions. This happens when we
encounter an invoke of an allocation function. This should fix the dragonegg
bootstrap. Testcase to follow, later.

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

12 years agoUpdate testing case for Atom when disabling rematerialization in
Manman Ren [Wed, 25 Jul 2012 20:17:14 +0000 (20:17 +0000)]
Update testing case for Atom when disabling rematerialization in
TwoAddressInstructionPass.

The generated code for Atom has a different code sequence. This is realted
to commit r160749.

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

12 years agoYou cannot call removeModule on a JIT with no modules. Patch by Verena
Chad Rosier [Wed, 25 Jul 2012 19:06:29 +0000 (19:06 +0000)]
You cannot call removeModule on a JIT with no modules.  Patch by Verena
Beckham <verena@codeplay.com>.  Reviewed by Jim Grosbach.

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

12 years agorevert r160742: it's breaking CMake build
Nuno Lopes [Wed, 25 Jul 2012 18:49:28 +0000 (18:49 +0000)]
revert r160742: it's breaking CMake build

original commit msg:
MemoryBuiltins: add support to determine the size of strdup'ed non-constant strings

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

12 years agoDisable rematerialization in TwoAddressInstructionPass.
Manman Ren [Wed, 25 Jul 2012 18:28:13 +0000 (18:28 +0000)]
Disable rematerialization in TwoAddressInstructionPass.

It is redundant; RegisterCoalescer will do the remat if it can't eliminate
the copy. Collected instruction counts before and after this. A few extra
instructions are generated due to spilling but it is normal to see these kinds
of changes with almost any small codegen change, according to Jakob.

This also fixed rdar://11830760 where xor is expected instead of movi0.

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

12 years agoDon't add null characters to the end of the APFloat string buffer.
David Blaikie [Wed, 25 Jul 2012 18:04:24 +0000 (18:04 +0000)]
Don't add null characters to the end of the APFloat string buffer.

Report/patch inspiration by Olaf Krzikalla.

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

12 years agoMemoryBuiltins: add support to determine the size of strdup'ed non-constant strings
Nuno Lopes [Wed, 25 Jul 2012 17:29:22 +0000 (17:29 +0000)]
MemoryBuiltins: add support to determine the size of strdup'ed non-constant strings

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

12 years agoadd EmitStrNLen()
Nuno Lopes [Wed, 25 Jul 2012 17:18:59 +0000 (17:18 +0000)]
add EmitStrNLen()

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

12 years agoPreserve 2-addr constraints in ConnectedVNInfoEqClasses.
Jakob Stoklund Olesen [Wed, 25 Jul 2012 17:15:15 +0000 (17:15 +0000)]
Preserve 2-addr constraints in ConnectedVNInfoEqClasses.

When a live range splits into multiple connected components, we would
arbitrarily assign <undef> uses to component 0. This is wrong when the
use is tied to a def that gets assigned to a different component:

  %vreg69<def> = ADD8ri %vreg68<undef>, 1

The use and def must get the same virtual register.

Fix this by assigning <undef> uses to the same component as the value
defined by the instruction, if any:

  %vreg69<def> = ADD8ri %vreg69<undef>, 1

This fixes PR13402. The PR has a test case which I am not including
because it is unlikely to keep exposing this behavior in the future.

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

12 years agoARM: Don't assume an SDNode is a constant.
Jim Grosbach [Wed, 25 Jul 2012 17:02:47 +0000 (17:02 +0000)]
ARM: Don't assume an SDNode is a constant.

Before accessing a node as a ConstandSDNode, make sure it actually is one.
No testcase of non-trivial size.

rdar://11948669

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

12 years agoVerify two-address constraints more carefully.
Jakob Stoklund Olesen [Wed, 25 Jul 2012 16:49:11 +0000 (16:49 +0000)]
Verify two-address constraints more carefully.

Include <undef> operands and virtual registers after leaving SSA form.

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

12 years agomake all Emit*() functions consult the TargetLibraryInfo information before creating...
Nuno Lopes [Wed, 25 Jul 2012 16:46:31 +0000 (16:46 +0000)]
make all Emit*() functions consult the TargetLibraryInfo information before creating a call to a library function.
Update all clients to pass the TLI information around.
Previous draft reviewed by Eli.

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

12 years agoFix typos. Thanks to Matt Beaumont-Gay for noticing it.
Rafael Espindola [Wed, 25 Jul 2012 15:42:45 +0000 (15:42 +0000)]
Fix typos. Thanks to Matt Beaumont-Gay for noticing it.

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

12 years agoTwine: fix link to source, add link to class doc and container section.
Axel Naumann [Wed, 25 Jul 2012 13:46:11 +0000 (13:46 +0000)]
Twine: fix link to source, add link to class doc and container section.
80 char lines.

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

12 years agoWhen a return struct pointer is passed in registers, the called has nothing
Rafael Espindola [Wed, 25 Jul 2012 13:41:10 +0000 (13:41 +0000)]
When a return struct pointer is passed in registers, the called has nothing
to pop.

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

12 years agoFactor a long list of conditions into a predicate function. No functionality
Rafael Espindola [Wed, 25 Jul 2012 13:35:45 +0000 (13:35 +0000)]
Factor a long list of conditions into a predicate function. No functionality
change.

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

12 years agoDon't perform an overaligned load in this test, since that's undefined
Duncan Sands [Wed, 25 Jul 2012 09:45:37 +0000 (09:45 +0000)]
Don't perform an overaligned load in this test, since that's undefined
behaviour that might be exploited one day.

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

12 years agoWhen folding a load from a global constant, if the load started in the middle
Duncan Sands [Wed, 25 Jul 2012 09:14:54 +0000 (09:14 +0000)]
When folding a load from a global constant, if the load started in the middle
of an array element (rather than at the beginning of the element) and extended
into the next element, then the load from the second element was being handled
wrong due to incorrect updating of the notion of which byte to load next.  This
fixes PR13442.  Thanks to Chris Smowton for reporting the problem, analyzing it
and providing a fix.

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

12 years agoEliminate the stack slot used to save the global base register.
Akira Hatanaka [Wed, 25 Jul 2012 03:16:47 +0000 (03:16 +0000)]
Eliminate the stack slot used to save the global base register.

The long branch pass (fixed in r160601) no longer uses the global base register
to compute addresses of branch destinations, so it is not necessary to reserve
a slot on the stack.

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

12 years agoAdd a cpu to the test. Should fix the atom bot.
Rafael Espindola [Tue, 24 Jul 2012 22:56:06 +0000 (22:56 +0000)]
Add a cpu to the test. Should fix the atom bot.

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

12 years agoAdd a triple to the test.
Rafael Espindola [Tue, 24 Jul 2012 21:55:04 +0000 (21:55 +0000)]
Add a triple to the test.

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

12 years agoIn order to correctly compile
Rafael Espindola [Tue, 24 Jul 2012 21:40:17 +0000 (21:40 +0000)]
In order to correctly compile

struct s {
  double x1;
  float x2;
};
__attribute__((regparm(3))) struct s f(int a, int b, int c);
void g(void) {
  f(41, 42, 43);
}

We need to be able to represent passing the address of s to f (sret) in a
register (inreg). Turns out that all that is needed is to not mark them as
mutually incompatible.

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

12 years agoFix a bug in the x86 disassembler's symbolic disassembly support for Jcc-Jump
Kevin Enderby [Tue, 24 Jul 2012 21:40:01 +0000 (21:40 +0000)]
Fix a bug in the x86 disassembler's symbolic disassembly support for Jcc-Jump
if Condition Is Met instuctions that was not correctly determining the target
instruction.

So for a jne rel32 instruction:

% cat x.s
.byte 0x0f, 0x85, 0x09, 0x00, 0x00, 0x00
% as x.s

it was incorrectly deterining the target:

% otool -q -tv a.out
a.out:
(__TEXT,__text) section
0000000000000000 jne 0xd

and with the fix it gets this correct as:

% otool -q -tv a.out
a.out:
(__TEXT,__text) section
0000000000000000 jne 0xf

rdar://11505997

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

12 years agoDon't delete one more instruction than we're allowed to. This should fix the
Nick Lewycky [Tue, 24 Jul 2012 21:33:00 +0000 (21:33 +0000)]
Don't delete one more instruction than we're allowed to. This should fix the
Darwin bootstrap. Testcase exists but isn't fully reduced, I expect to commit
the testcase this evening.

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

12 years ago[Object] Remove unneeded const_cast.
Michael J. Spencer [Tue, 24 Jul 2012 21:07:56 +0000 (21:07 +0000)]
[Object] Remove unneeded const_cast.

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

12 years agoadd a few more functions to TargetLibraryInfo:
Nuno Lopes [Tue, 24 Jul 2012 21:00:36 +0000 (21:00 +0000)]
add a few more functions to TargetLibraryInfo:
fputc, memchr, memcmp, putchar, puts, strchr, strncmp

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

12 years agoELF does not imply GNU/Linux. Do not assume GNU conventions just because we
David Chisnall [Tue, 24 Jul 2012 20:04:16 +0000 (20:04 +0000)]
ELF does not imply GNU/Linux.  Do not assume GNU conventions just because we
are targeting an ELF platform.  Only fold gs-relative (and fs-relative) loads
if it is actually sensible to do so for the target platform.

This fixes PR13438.

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

12 years agoAdd new interfaces to support ldd's ReaderElf.cpp.
Anshuman Dasgupta [Tue, 24 Jul 2012 19:48:24 +0000 (19:48 +0000)]
Add new interfaces to support ldd's ReaderElf.cpp.

Patch by Sid Manning!

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

12 years agoTargetLibraryInfo: add strn?cat, strn?cpy, and strn?len
Nuno Lopes [Tue, 24 Jul 2012 17:25:06 +0000 (17:25 +0000)]
TargetLibraryInfo: add strn?cat, strn?cpy, and strn?len

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