oota-llvm.git
12 years agoTableGen: Allow use of #NAME# outside of 'def' names.
Jim Grosbach [Thu, 2 Aug 2012 18:46:42 +0000 (18:46 +0000)]
TableGen: Allow use of #NAME# outside of 'def' names.

Previously, def NAME values were only populated, and references to NAME
resolved, when NAME was referenced in the 'def' entry of the multiclass
sub-entry. e.g.,
multiclass foo<...> {
  def prefix_#NAME : ...
}

It's useful, however, to be able to reference NAME even when the default
def name is used. For example, when a multiclass has 'def : Pat<...>'
or 'def : InstAlias<...>' entries which refer to earlier instruction
definitions in the same multiclass. e.g.,
multiclass myMulti<RegisterClass rc> {
  def _r : myI<(outs rc:$d), (ins rc:$r), "r $d, $r", []>;

  def : InstAlias<\"wilma $r\", (!cast<Instruction>(NAME#\"_r\") rc:$r, rc:$r)>;
}

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

12 years agoCompute the critical path length through a trace.
Jakob Stoklund Olesen [Thu, 2 Aug 2012 18:45:54 +0000 (18:45 +0000)]
Compute the critical path length through a trace.

Whenever both instruction depths and instruction heights are known in a
block, it is possible to compute the length of the critical path as
max(depth+height) over the instructions in the block.

The stored live-in lists make it possible to accurately compute the
length of a critical path that bypasses the current (small) block.

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

12 years agoMove the code that creates instances of MipsInstrInfo and MipsFrameLowering out
Akira Hatanaka [Thu, 2 Aug 2012 18:21:47 +0000 (18:21 +0000)]
Move the code that creates instances of MipsInstrInfo and MipsFrameLowering out
of MipsTargetMachine.cpp.

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

12 years agoSet transient stack alignment in constructor of MipsFrameLowering and re-enable
Akira Hatanaka [Thu, 2 Aug 2012 18:15:13 +0000 (18:15 +0000)]
Set transient stack alignment in constructor of MipsFrameLowering and re-enable
test o32_cc_vararg.ll.

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

12 years agoVerify regunit intervals along with virtreg intervals.
Jakob Stoklund Olesen [Thu, 2 Aug 2012 16:36:50 +0000 (16:36 +0000)]
Verify regunit intervals along with virtreg intervals.

Don't cause regunit intervals to be computed just to verify them. Only
check the already cached intervals.

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

12 years agoAvoid creating dangling physreg live ranges during DCE.
Jakob Stoklund Olesen [Thu, 2 Aug 2012 16:36:47 +0000 (16:36 +0000)]
Avoid creating dangling physreg live ranges during DCE.

LiveRangeEdit::eliminateDeadDefs() can delete a dead instruction that
reads unreserved physregs. This would leave the corresponding regunit
live interval dangling because we don't have shrinkToUses() for physical
registers.

Fix this problem by turning the instruction into a KILL instead of
deleting it. This happens in a landing pad in
test/CodeGen/X86/2012-05-19-CoalescerCrash.ll:

  %vreg27<def,dead> = COPY %EDX<kill>; GR32:%vreg27

becomes:

  KILL %EDX<kill>

An upcoming fix to the machine verifier will catch problems like this by
verifying regunit live intervals.

This fixes PR13498. I am not including the test case from the PR since
we already have one exposing the problem once the verifier is fixed.

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

12 years agoAdd TargetRegisterInfo::hasRegUnit().
Jakob Stoklund Olesen [Thu, 2 Aug 2012 14:45:53 +0000 (14:45 +0000)]
Add TargetRegisterInfo::hasRegUnit().

This trivial helper function tests if a register contains a register
unit. It is similar to regsOverlap(), but with asymmetric arguments.

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

12 years agoinclude/llvm/Analysis/RegionInfo.h: Appease msvc.
NAKAMURA Takumi [Thu, 2 Aug 2012 14:44:01 +0000 (14:44 +0000)]
include/llvm/Analysis/RegionInfo.h: Appease msvc.

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

12 years agoAdd report() functions that take a LiveInterval argument.
Jakob Stoklund Olesen [Thu, 2 Aug 2012 14:31:49 +0000 (14:31 +0000)]
Add report() functions that take a LiveInterval argument.

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

12 years agoImplement the block_iterator of Region based on df_iterator.
Hongbin Zheng [Thu, 2 Aug 2012 14:20:02 +0000 (14:20 +0000)]
Implement the block_iterator of Region based on df_iterator.

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

12 years agoJIT::runFunction(): add a fast path for functions with a single argument that is...
Nuno Lopes [Thu, 2 Aug 2012 12:09:32 +0000 (12:09 +0000)]
JIT::runFunction(): add a fast path for functions with a single argument that is a pointer.

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

12 years agoSphinxify the Code Generator document.
Bill Wendling [Thu, 2 Aug 2012 08:49:53 +0000 (08:49 +0000)]
Sphinxify the Code Generator document.

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

12 years agoSupport fpv4 for ARM Cortex-M4.
Jiangning Liu [Thu, 2 Aug 2012 08:35:55 +0000 (08:35 +0000)]
Support fpv4 for ARM Cortex-M4.

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

12 years agoFix #13035, a bug around Thumb instruction LDRD/STRD with negative #0 offset index...
Jiangning Liu [Thu, 2 Aug 2012 08:29:50 +0000 (08:29 +0000)]
Fix #13035, a bug around Thumb instruction LDRD/STRD with negative #0 offset index issue.

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

12 years agoFix #13138, a bug around ARM instruction DSB encoding and decoding issue.
Jiangning Liu [Thu, 2 Aug 2012 08:21:27 +0000 (08:21 +0000)]
Fix #13138, a bug around ARM instruction DSB encoding and decoding issue.

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

12 years agoFix #13241, a bug around shift immediate operand for ARM instruction ADR.
Jiangning Liu [Thu, 2 Aug 2012 08:13:13 +0000 (08:13 +0000)]
Fix #13241, a bug around shift immediate operand for ARM instruction ADR.

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

12 years agollvm/test/CodeGen/X86/fold-pcmpeqd-1.ll: Make sure this is testing without +avx.
NAKAMURA Takumi [Thu, 2 Aug 2012 06:36:56 +0000 (06:36 +0000)]
llvm/test/CodeGen/X86/fold-pcmpeqd-1.ll: Make sure this is testing without +avx.

FIXME: Could +avx be checked here too?

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

12 years agollvm/test/CodeGen/X86/fold-pcmpeqd-1.ll: Rewrite expressions to pass regardless of...
NAKAMURA Takumi [Thu, 2 Aug 2012 06:33:58 +0000 (06:33 +0000)]
llvm/test/CodeGen/X86/fold-pcmpeqd-1.ll: Rewrite expressions to pass regardless of PR11031.

  - Relax to match even if epilogue (pop %ebp) were emitted.
  - Assume the return value is stored to %xmm0.

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

12 years agoX86 Peephole: fold loads to the source register operand if possible.
Manman Ren [Thu, 2 Aug 2012 00:56:42 +0000 (00:56 +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.

This patch is a rework of r160919 and was tested on clang self-host on my local
machine.

rdar://10554090 and rdar://11873276

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

12 years agoExtract some methods from verifyLiveIntervals.
Jakob Stoklund Olesen [Thu, 2 Aug 2012 00:20:20 +0000 (00:20 +0000)]
Extract some methods from verifyLiveIntervals.

No functional change.

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

12 years agoAlso verify RegUnit intervals at uses.
Jakob Stoklund Olesen [Wed, 1 Aug 2012 23:52:40 +0000 (23:52 +0000)]
Also verify RegUnit intervals at uses.

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

12 years agoX86: mark GATHER instructios as mayLoad
Manman Ren [Wed, 1 Aug 2012 23:28:59 +0000 (23:28 +0000)]
X86: mark GATHER instructios as mayLoad

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

12 years agoCompute instruction heights through a trace.
Jakob Stoklund Olesen [Wed, 1 Aug 2012 22:36:00 +0000 (22:36 +0000)]
Compute instruction heights through a trace.

The height on an instruction is the minimum number of cycles from the
instruction is issued to the end of the trace. Heights are computed for
all instructions in and below the trace center block.

The method for computing heights is different from the depth
computation. As we visit instructions in the trace bottom-up, heights of
used instructions are pushed upwards. This way, we avoid scanning long
use lists, looking for uses in the current trace.

At each basic block boundary, a list of live-in registers and their
minimum heights is saved in the trace block info. These live-in lists
are used when restarting depth computations on a trace that
converges with an already computed trace. They will also be used to
accurately compute the critical path length.

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

12 years agoARM: Remove redundant instalias.
Jim Grosbach [Wed, 1 Aug 2012 20:33:05 +0000 (20:33 +0000)]
ARM: Remove redundant instalias.

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

12 years agoClean up formatting.
Jim Grosbach [Wed, 1 Aug 2012 20:33:02 +0000 (20:33 +0000)]
Clean up formatting.

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

12 years agoTidy up.
Jim Grosbach [Wed, 1 Aug 2012 20:33:00 +0000 (20:33 +0000)]
Tidy up.

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

12 years agoWhitespace.
Chad Rosier [Wed, 1 Aug 2012 18:39:17 +0000 (18:39 +0000)]
Whitespace.

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

12 years agoTemporarily revert c23b933d5f8be9b51a1d22e717c0311f65f87dcd. It's causing
Eric Christopher [Wed, 1 Aug 2012 18:19:01 +0000 (18:19 +0000)]
Temporarily revert c23b933d5f8be9b51a1d22e717c0311f65f87dcd. It's causing
failures in the debug testsuite and possibly PR13486.

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

12 years agoremove tabs from my previous commit.
Nuno Lopes [Wed, 1 Aug 2012 17:13:28 +0000 (17:13 +0000)]
remove tabs from my previous commit.
Sorry, not used to this editor anymore.. XCode please come back; you're forgiven :)

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

12 years ago(hopefuly) fix the remaining cases where null wasnt expected (PR13497).
Nuno Lopes [Wed, 1 Aug 2012 16:58:51 +0000 (16:58 +0000)]
(hopefuly) fix the remaining cases where null wasnt expected (PR13497).
I'll commit a test to the clang tree.

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

12 years agoLine endings.
Matt Beaumont-Gay [Wed, 1 Aug 2012 16:42:35 +0000 (16:42 +0000)]
Line endings.

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

12 years agoAdd DataDep constructors. Explicitly check SSA form.
Jakob Stoklund Olesen [Wed, 1 Aug 2012 16:02:59 +0000 (16:02 +0000)]
Add DataDep constructors. Explicitly check SSA form.

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

12 years agofix 'make check' when ocamlopt returns the compiler path with CFLAGS (and there's...
Nuno Lopes [Wed, 1 Aug 2012 15:50:34 +0000 (15:50 +0000)]
fix 'make check' when ocamlopt returns the compiler path with CFLAGS (and there's a cflag with a = char)

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

12 years agoReference IntrusiveRefCntPtr in doxygen doc of RefCountedBase to get a link to the...
Axel Naumann [Wed, 1 Aug 2012 14:53:13 +0000 (14:53 +0000)]
Reference IntrusiveRefCntPtr in doxygen doc of RefCountedBase to get a link to the pointer class documentation.

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

12 years agoAdded FMA functionality to X86 target.
Elena Demikhovsky [Wed, 1 Aug 2012 12:06:00 +0000 (12:06 +0000)]
Added FMA functionality to X86 target.

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

12 years agoStay rational; don't assert trying to take the square root of a negative value.
Nick Lewycky [Wed, 1 Aug 2012 09:14:36 +0000 (09:14 +0000)]
Stay rational; don't assert trying to take the square root of a negative value.
If it's negative, the loop is already proven to be infinite. Fixes PR13489!

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

12 years agoAdd range erase, element insert, and range insert methods to
Chandler Carruth [Wed, 1 Aug 2012 08:40:48 +0000 (08:40 +0000)]
Add range erase, element insert, and range insert methods to
TinyPtrVector. With these, it is sufficiently functional for my more
normal / pedestrian uses.

I've not included some r-value reference stuff here because the value
type for a TinyPtrVector is, necessarily, just a pointer.

I've added tests that cover the basic behavior of these routines, but
they aren't as comprehensive as I'd like. In particular, they don't
really test the iterator semantics as thoroughly as they should. Maybe
some brave soul will feel enterprising and flesh them out. ;]

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

12 years agoAdd basic in-bounds asserts to TinyPtrVector::erase.
Chandler Carruth [Wed, 1 Aug 2012 08:40:46 +0000 (08:40 +0000)]
Add basic in-bounds asserts to TinyPtrVector::erase.

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

12 years agoAdd more indirection to the disassembler tables to reduce amount of space used to...
Craig Topper [Wed, 1 Aug 2012 07:39:18 +0000 (07:39 +0000)]
Add more indirection to the disassembler tables to reduce amount of space used to store the operand types and encodings. Store only the unique combinations in a separate table and store indices in the instruction table. Saves about 32K of static data.

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

12 years agoInitial commit of new FileOutputBuffer support class.
Nick Kledzik [Wed, 1 Aug 2012 02:29:50 +0000 (02:29 +0000)]
Initial commit of new FileOutputBuffer support class.
Since the llvm::sys::fs::map_file_pages() support function it relies on
is not yet implemented on Windows, the unit tests for FileOutputBuffer
are currently conditionalized to run only on unix.

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

12 years agoImplement MipsJITInfo::replaceMachineCodeForFunction.
Akira Hatanaka [Wed, 1 Aug 2012 02:29:24 +0000 (02:29 +0000)]
Implement MipsJITInfo::replaceMachineCodeForFunction.

No new test case is added.
This patch makes test JITTest.FunctionIsRecompiledAndRelinked pass on mips
platform.

Patch by Petar Jovanovic.

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

12 years agoFix shadowed variable warning
Nick Kledzik [Wed, 1 Aug 2012 01:43:10 +0000 (01:43 +0000)]
Fix shadowed variable warning

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

12 years agoRemove unused variable.
Akira Hatanaka [Wed, 1 Aug 2012 00:37:53 +0000 (00:37 +0000)]
Remove unused variable.

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

12 years agoImplement MipsSERegisterInfo::eliminateCallFramePseudoInstr. The function emits
Akira Hatanaka [Tue, 31 Jul 2012 23:52:55 +0000 (23:52 +0000)]
Implement MipsSERegisterInfo::eliminateCallFramePseudoInstr. The function emits
instructions that decrement and increment the stack pointer before and after a
call when the function does not have a reserved call frame.

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

12 years agoAdd definitions of two subclasses of MipsRegisterInfo, Mips16RegisterInfo and
Akira Hatanaka [Tue, 31 Jul 2012 23:41:32 +0000 (23:41 +0000)]
Add definitions of two subclasses of MipsRegisterInfo, Mips16RegisterInfo and
MipsSERegisterInfo.

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

12 years agoAdd definitions of two subclasses of MipsFrameLowering, Mips16FrameLowering and
Akira Hatanaka [Tue, 31 Jul 2012 22:50:19 +0000 (22:50 +0000)]
Add definitions of two subclasses of MipsFrameLowering, Mips16FrameLowering and
MipsSEFrameLowering.

Implement MipsSEFrameLowering::hasReservedCallFrame. Call frames will not be
reserved if there is a call with a large call frame or there are variable sized
objects on the stack.

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

12 years agoSuppress stderr noise when test case runs.
Nick Kledzik [Tue, 31 Jul 2012 22:18:15 +0000 (22:18 +0000)]
Suppress stderr noise when test case runs.

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

12 years agoAdd Mips16InstrInfo.cpp and MipsSEInstrInfo.cpp to CMakeLists.txt.
Akira Hatanaka [Tue, 31 Jul 2012 22:11:05 +0000 (22:11 +0000)]
Add Mips16InstrInfo.cpp and MipsSEInstrInfo.cpp to CMakeLists.txt.

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

12 years ago[obj2yaml] Print the Relocations header.
Michael J. Spencer [Tue, 31 Jul 2012 22:04:08 +0000 (22:04 +0000)]
[obj2yaml] Print the Relocations header.

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

12 years agoAdd definitions of two subclasses of MipsInstrInfo, MipsInstrInfo (for mips16),
Akira Hatanaka [Tue, 31 Jul 2012 21:49:49 +0000 (21:49 +0000)]
Add definitions of two subclasses of MipsInstrInfo, MipsInstrInfo (for mips16),
and MipsSEInstrInfo (for mips32/64).

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

12 years agoDelete mips64 target machine classes. mips target machines can be used in place
Akira Hatanaka [Tue, 31 Jul 2012 21:39:17 +0000 (21:39 +0000)]
Delete mips64 target machine classes. mips target machines can be used in place
of them.

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

12 years agoLet PEI::calculateFrameObjectOffsets compute the final stack size rather than
Akira Hatanaka [Tue, 31 Jul 2012 21:28:49 +0000 (21:28 +0000)]
Let PEI::calculateFrameObjectOffsets compute the final stack size rather than
computing it in MipsFrameLowering::emitPrologue.

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

12 years agoExpand DYNAMIC_STACKALLOC nodes rather than doing custom-lowering.
Akira Hatanaka [Tue, 31 Jul 2012 20:54:48 +0000 (20:54 +0000)]
Expand DYNAMIC_STACKALLOC nodes rather than doing custom-lowering.

The frame object which points to the dynamically allocated area will not be
needed after changes are made to cease reserving call frames.

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

12 years agoMachineSink: Sort the successors before trying to find SuccToSinkTo.
Manman Ren [Tue, 31 Jul 2012 20:45:38 +0000 (20:45 +0000)]
MachineSink: Sort the successors before trying to find SuccToSinkTo.

Use stable_sort instead of sort. Follow-up to r161062.

rdar://11980766

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

12 years agoCompute instruction depths through the current trace.
Jakob Stoklund Olesen [Tue, 31 Jul 2012 20:44:38 +0000 (20:44 +0000)]
Compute instruction depths through the current trace.

Assuming infinite issue width, compute the earliest each instruction in
the trace can issue, when considering the latency of data dependencies.
The issue cycle is record as a 'depth' from the beginning of the trace.

This is half the computation required to find the length of the critical
path through the trace. Heights are next.

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

12 years agoRename CT -> MTM. MachineTraceMetrics is abbreviated MTM.
Jakob Stoklund Olesen [Tue, 31 Jul 2012 20:25:13 +0000 (20:25 +0000)]
Rename CT -> MTM. MachineTraceMetrics is abbreviated MTM.

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

12 years agoDefine ADJCALLSTACKDOWN/UP nodes. These nodes are emitted regardless of whether
Akira Hatanaka [Tue, 31 Jul 2012 19:13:07 +0000 (19:13 +0000)]
Define ADJCALLSTACKDOWN/UP nodes. These nodes are emitted regardless of whether
or not it is in mips16 mode. Define MipsPseudo (mode-independant pseudo) and
PseudoSE (mips32/64 pseudo) classes.

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

12 years agoChange name of class MipsInst to InstSE to distinguish it from mips16's
Akira Hatanaka [Tue, 31 Jul 2012 18:55:01 +0000 (18:55 +0000)]
Change name of class MipsInst to InstSE to distinguish it from mips16's
instruction class. SE stands for standard encoding.

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

12 years agoWhen store nodes or memcpy nodes are created to copy the function call
Akira Hatanaka [Tue, 31 Jul 2012 18:46:41 +0000 (18:46 +0000)]
When store nodes or memcpy nodes are created to copy the function call
arguments to the stack in MipsISelLowering::LowerCall, use stack pointer and
integer offset operands rather than frame object operands.

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

12 years ago[x86 frame lowering] In 32-bit mode, use ESI as the base pointer.
Chad Rosier [Tue, 31 Jul 2012 18:29:21 +0000 (18:29 +0000)]
[x86 frame lowering] In 32-bit mode, use ESI as the base pointer.

Previously, we were using EBX, but PIC requires the GOT to be in EBX before
function calls via PLT GOT pointer.

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

12 years agoUse regex instead of special casing clang and llvm libraries.
Ted Kremenek [Tue, 31 Jul 2012 18:23:44 +0000 (18:23 +0000)]
Use regex instead of special casing clang and llvm libraries.

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

12 years agoFix type of LUXC1 and SUXC1. These instructions were incorrectly defined as
Akira Hatanaka [Tue, 31 Jul 2012 18:16:49 +0000 (18:16 +0000)]
Fix type of LUXC1 and SUXC1. These instructions were incorrectly defined as
single-precision load and store.

Also avoid selecting LUXC1 and SUXC1 instructions during isel. It is incorrect
to map unaligned floating point load/store nodes to these instructions.

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

12 years agoMachineSink: Sort the successors before trying to find SuccToSinkTo.
Manman Ren [Tue, 31 Jul 2012 18:10:39 +0000 (18:10 +0000)]
MachineSink: Sort the successors before trying to find SuccToSinkTo.

One motivating example is to sink an instruction from a basic block which has
two successors: one outside the loop, the other inside the loop. We should try
to sink the instruction outside the loop.

rdar://11980766

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

12 years agoConform to LLVM coding style.
Micah Villmow [Tue, 31 Jul 2012 18:07:43 +0000 (18:07 +0000)]
Conform to LLVM coding style.

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

12 years agoDon't generate ordered or unordered comparison operations if it is not legal to do so.
Micah Villmow [Tue, 31 Jul 2012 16:48:03 +0000 (16:48 +0000)]
Don't generate ordered or unordered comparison operations if it is not legal to do so.

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

12 years agoImplement copy and move assignment for TinyPtrVector. These try to
Chandler Carruth [Tue, 31 Jul 2012 09:42:24 +0000 (09:42 +0000)]
Implement copy and move assignment for TinyPtrVector. These try to
re-use allocated vectors as much as possible.

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

12 years agoFix some minor typos
Sylvestre Ledru [Tue, 31 Jul 2012 07:05:57 +0000 (07:05 +0000)]
Fix some minor typos

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

12 years agoUse uint8_t to store the InstructionContext table. Saves 768 bytes of static data.
Craig Topper [Tue, 31 Jul 2012 06:15:39 +0000 (06:15 +0000)]
Use uint8_t to store the InstructionContext table. Saves 768 bytes of static data.

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

12 years agoTidy up. Move for loop index declarations into for statements. Use unsigned instead...
Craig Topper [Tue, 31 Jul 2012 06:02:05 +0000 (06:02 +0000)]
Tidy up. Move for loop index declarations into for statements. Use unsigned instead of uint16_t for loop indices. Use unsigned instead of uint32_t for arguments to raw_ostream.indent.

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

12 years agoTidy up function argument formatting.
Craig Topper [Tue, 31 Jul 2012 05:42:02 +0000 (05:42 +0000)]
Tidy up function argument formatting.

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

12 years agoRemove trailing whitespace
Craig Topper [Tue, 31 Jul 2012 05:28:41 +0000 (05:28 +0000)]
Remove trailing whitespace

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

12 years agoRemove trailing whitespace
Craig Topper [Tue, 31 Jul 2012 05:27:01 +0000 (05:27 +0000)]
Remove trailing whitespace

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

12 years agoMake INSTRUCTION_SPECIFIER_FIELDS match X86DisassemblerCommon.h. Also remove trailing...
Craig Topper [Tue, 31 Jul 2012 05:18:26 +0000 (05:18 +0000)]
Make INSTRUCTION_SPECIFIER_FIELDS match X86DisassemblerCommon.h. Also remove trailing whitespace.

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

12 years agoTidy up trailing whitespace
Craig Topper [Tue, 31 Jul 2012 04:58:05 +0000 (04:58 +0000)]
Tidy up trailing whitespace

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

12 years agoTidy up trailing whitespace
Craig Topper [Tue, 31 Jul 2012 04:38:27 +0000 (04:38 +0000)]
Tidy up trailing whitespace

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

12 years agoClean up trailing whitespace and unnecessary blank lines.
Chandler Carruth [Tue, 31 Jul 2012 04:13:57 +0000 (04:13 +0000)]
Clean up trailing whitespace and unnecessary blank lines.

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

12 years agoBring TinyPtrVector under test. Somehow we never picked up unit tests
Chandler Carruth [Tue, 31 Jul 2012 02:48:31 +0000 (02:48 +0000)]
Bring TinyPtrVector under test. Somehow we never picked up unit tests
for this class. These tests exercise most of the basic properties, but
the API for TinyPtrVector is very strange currently. My plan is to start
fleshing out the API to match that of SmallVector, but I wanted a test
for what is there first.

Sadly, it doesn't look reasonable to just re-use the SmallVector tests,
as this container can only ever store pointers, and much of the
SmallVector testing is to get construction and destruction right.

Just to get this basic test working, I had to add value_type to the
interface.

While here I found a subtle bug in the combination of 'erase', 'begin',
and 'end'. Both 'begin' and 'end' wanted to use a null pointer to
indicate the "end" iterator of an empty vector, regardless of whether
there is actually a vector allocated or the pointer union is null.
Everything else was fine with this except for erase. If you erase the
last element of a vector after it has held more than one element, we
return the end iterator of the underlying SmallVector which need not be
a null pointer. Instead, simply use the pointer, and poniter + size()
begin/end definitions in the tiny case, and delegate to the inner vector
whenever it is present.

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

12 years agoClear kill flags in removeCopyByCommutingDef().
Jakob Stoklund Olesen [Tue, 31 Jul 2012 02:47:24 +0000 (02:47 +0000)]
Clear kill flags in removeCopyByCommutingDef().

We are extending live ranges, so kill flags are not accurate. They
aren't needed until they are recomputed after RA anyway.

<rdar://problem/11950722>

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

12 years agoReverse order of the two branches at end of a basic block if it is profitable.
Manman Ren [Tue, 31 Jul 2012 01:11:07 +0000 (01:11 +0000)]
Reverse order of the two branches at end of a basic block if it is profitable.

We branch to the successor with higher edge weight first.
Convert from
     je    LBB4_8  --> to outer loop
     jmp   LBB4_14 --> to inner loop
to
     jne   LBB4_14
     jmp   LBB4_8

PR12750
rdar: 11393714

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

12 years agoUse the latest MachineRegisterInfo APIs. No functionality.
Andrew Trick [Mon, 30 Jul 2012 23:48:17 +0000 (23:48 +0000)]
Use the latest MachineRegisterInfo APIs. No functionality.

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

12 years agoAdded MachineRegisterInfo::hasOneDef()
Andrew Trick [Mon, 30 Jul 2012 23:48:14 +0000 (23:48 +0000)]
Added MachineRegisterInfo::hasOneDef()

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

12 years agoInline MachineRegisterInfo::hasOneUse
Andrew Trick [Mon, 30 Jul 2012 23:48:12 +0000 (23:48 +0000)]
Inline MachineRegisterInfo::hasOneUse

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

12 years agoExtend the InstVisitor to visit the specialized classes wrapping
Chandler Carruth [Mon, 30 Jul 2012 23:45:06 +0000 (23:45 +0000)]
Extend the InstVisitor to visit the specialized classes wrapping
CallInst for intrinsics. This allows users of the InstVisitor that would
like to special case certain very common intrinsics to do so naturally
in keeping with the type hierarchy's utility classes.

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

12 years agoAvoid looking at stale data in verifyAnalysis().
Jakob Stoklund Olesen [Mon, 30 Jul 2012 23:15:12 +0000 (23:15 +0000)]
Avoid looking at stale data in verifyAnalysis().

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

12 years agoAllow traces to enter nested loops.
Jakob Stoklund Olesen [Mon, 30 Jul 2012 23:15:10 +0000 (23:15 +0000)]
Allow traces to enter nested loops.

This lets traces include the final iteration of a nested loop above the
center block, and the first iteration of a nested loop below the center
block.

We still don't allow traces to contain backedges, and traces are
truncated where they would leave a loop, as seen from the center block.

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

12 years agoKeep empty assembly macro argument values in the middle of the list.
Jim Grosbach [Mon, 30 Jul 2012 22:44:17 +0000 (22:44 +0000)]
Keep empty assembly macro argument values in the middle of the list.

Empty macro arguments at the end of the list should be as-if not specified at
all, but those in the middle of the list need to be kept so as not to screw
up the positional numbering. E.g.:
.macro foo
foo_-bash___:
  nop
.endm

foo 1, 2, 3, 4
foo 1, , 3, 4

Should create two labels, "foo_1_2_3_4" and "foo_1__3_4".

rdar://11948769

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

12 years agoMove the SmallVector unit tests to be type-parameterized so that we can
Chandler Carruth [Mon, 30 Jul 2012 22:17:52 +0000 (22:17 +0000)]
Move the SmallVector unit tests to be type-parameterized so that we can
test more than a single instantiation of SmallVector.

Add testing for 0, 1, 2, and 4 element sized "small" buffers. These
appear to be essentially untested in the unit tests until now.

Fix several tests to be robust in the face of a '0' small buffer. As
a consequence of this size buffer, the growth patterns are actually
observable in the test -- yes this means that many tests never caused
a grow to occur before. For some tests I've merely added a reserve call
to normalize behavior. For others, the growth is actually interesting,
and so I captured the fact that growth would occur and adjusted the
assertions to not assume how rapidly growth occured.

Also update the specialization for a '0' small buffer length to have all
the same interface points as the normal small vector.

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

12 years agoClarify invalidation strategy in comment.
Jakob Stoklund Olesen [Mon, 30 Jul 2012 21:16:22 +0000 (21:16 +0000)]
Clarify invalidation strategy in comment.

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

12 years agoFix grammar-o. Fixes PR13482!
Nick Lewycky [Mon, 30 Jul 2012 21:10:51 +0000 (21:10 +0000)]
Fix grammar-o. Fixes PR13482!

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

12 years agoAssert that all trace candidate blocks have been visited by the PO.
Jakob Stoklund Olesen [Mon, 30 Jul 2012 21:10:27 +0000 (21:10 +0000)]
Assert that all trace candidate blocks have been visited by the PO.

When computing a trace, all the candidates for pred/succ must have been
visited. Filter out back-edges first, though. The PO traversal ignores
them.

Thanks to Andy for spotting this in review.

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

12 years agoHook into PassManager's analysis verification.
Jakob Stoklund Olesen [Mon, 30 Jul 2012 20:57:50 +0000 (20:57 +0000)]
Hook into PassManager's analysis verification.

By overriding Pass::verifyAnalysis(), the pass contents will be verified
by the pass manager.

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

12 years agoConsider address spaces for hashing and CSEing DAG nodes. Otherwise two loads from...
Pete Cooper [Mon, 30 Jul 2012 20:23:19 +0000 (20:23 +0000)]
Consider address spaces for hashing and CSEing DAG nodes.  Otherwise two loads from different x86 segments but the same address would get CSEd

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

12 years agoTypo.
Eric Christopher [Mon, 30 Jul 2012 20:09:37 +0000 (20:09 +0000)]
Typo.

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

12 years agoFix a bug in ARMMachObjectWriter::RecordRelocation() in ARMMachObjectWriter.cpp
Kevin Enderby [Mon, 30 Jul 2012 18:46:15 +0000 (18:46 +0000)]
Fix a bug in ARMMachObjectWriter::RecordRelocation() in ARMMachObjectWriter.cpp
where the other_half of the movt and movw relocation entries needs to get set
and only with the 16 bits of the other half.

rdar://10038370

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

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