oota-llvm.git
12 years agoRecognize vst1.64 / vld1.64 with 3 and 4 regs as load from / store to stack stuff
Anton Korobeynikov [Sat, 4 Aug 2012 13:22:14 +0000 (13:22 +0000)]
Recognize vst1.64 / vld1.64 with 3 and 4 regs as load from / store to stack stuff
(this corresponds by spilling/reloading regs in DTriple / DQuad reg classes).
No testcase, found by inspection.

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

12 years agoAdd stack spill / reload instructions for DTriple and DQuad register classes, which
Anton Korobeynikov [Sat, 4 Aug 2012 13:16:12 +0000 (13:16 +0000)]
Add stack spill / reload instructions for DTriple and DQuad register classes, which
were missed for no reason. This fixes PR13377

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

12 years agoRemove extraneous ';'.
Bill Wendling [Sat, 4 Aug 2012 10:31:40 +0000 (10:31 +0000)]
Remove extraneous ';'.

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

12 years agoUpdate cmake build.
Benjamin Kramer [Sat, 4 Aug 2012 09:52:39 +0000 (09:52 +0000)]
Update cmake build.

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

12 years agoPostpone the deletion of the old name in StructType::setName to allow using a slice...
Benjamin Kramer [Sat, 4 Aug 2012 09:47:02 +0000 (09:47 +0000)]
Postpone the deletion of the old name in StructType::setName to allow using a slice of the old name.

Fixes PR13522. Add a rudimentary unit test to exercise the behavior.

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

12 years ago[CMake] add_lit_target: Remove comments about add_dependencies. It is not a bug in...
NAKAMURA Takumi [Sat, 4 Aug 2012 02:14:44 +0000 (02:14 +0000)]
[CMake] add_lit_target: Remove comments about add_dependencies. It is not a bug in cmake that add_custom_target(DEPENDS) would not accept targets but file-level dependencies.

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

12 years agollc: Try to suppress failures since r161262 .
NAKAMURA Takumi [Sat, 4 Aug 2012 01:29:37 +0000 (01:29 +0000)]
llc: Try to suppress failures since r161262 .

FIXME: Fix several tests on i686-win32 due to lacking of many libraries.

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

12 years agoDelete a dead variable.
Jakob Stoklund Olesen [Sat, 4 Aug 2012 00:04:03 +0000 (00:04 +0000)]
Delete a dead variable.

TwoAddressInstructionPass doesn't remat any more.

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

12 years agoTwoAddressInstructionPass refactoring: Extract another method.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 23:57:58 +0000 (23:57 +0000)]
TwoAddressInstructionPass refactoring: Extract another method.

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

12 years agoRefactor and check "onlyReadsMemory" before optimizing builtins.
Bob Wilson [Fri, 3 Aug 2012 23:29:17 +0000 (23:29 +0000)]
Refactor and check "onlyReadsMemory" before optimizing builtins.

This patch is mostly just refactoring a bunch of copy-and-pasted code, but
it also adds a check that the call instructions are readnone or readonly.
That check was already present for sin, cos, sqrt, log2, and exp2 calls, but
it was missing for the rest of the builtins being handled in this code.

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

12 years agoTwoAddressInstructionPass refactoring: Extract a method.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 23:25:45 +0000 (23:25 +0000)]
TwoAddressInstructionPass refactoring: Extract a method.

No functional change intended, except replacing a DenseMap with a
SmallDenseMap which should behave identically.

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

12 years agoBegin adding support for updating LiveIntervals in TwoAddressInstructionPass.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 22:58:34 +0000 (22:58 +0000)]
Begin adding support for updating LiveIntervals in TwoAddressInstructionPass.

This is far from complete, and only changes behavior when the
-early-live-intervals flag is passed to llc.

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

12 years ago1. Redo mips16 instructions to avoid multiple opcodes for same instruction.
Akira Hatanaka [Fri, 3 Aug 2012 22:57:02 +0000 (22:57 +0000)]
1. Redo mips16 instructions to avoid multiple opcodes for same instruction.
Change these to patterns.
2. Add another 16 instructions.

Patch by Reed Kotler.

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

12 years agoAdd an experimental -early-live-intervals option.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 22:12:54 +0000 (22:12 +0000)]
Add an experimental -early-live-intervals option.

This option runs LiveIntervals before TwoAddressInstructionPass which
will eventually learn to exploit and update the analysis.

Eventually, LiveIntervals will run before PHIElimination, and we can get
rid of LiveVariables.

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

12 years agoDelete merged physreg copies in joinReservedPhysReg().
Jakob Stoklund Olesen [Fri, 3 Aug 2012 22:12:51 +0000 (22:12 +0000)]
Delete merged physreg copies in joinReservedPhysReg().

Previously, the identity copy would survive through register allocation
before it was removed by the rewriter.

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

12 years agoTry to reduce the compile time impact of r161232.
Bob Wilson [Fri, 3 Aug 2012 21:26:24 +0000 (21:26 +0000)]
Try to reduce the compile time impact of r161232.

The previous change caused fast isel to not attempt handling any calls to
builtin functions.  That included things like "printf" and caused some
noticable regressions in compile time.  I wanted to avoid having fast isel
keep a separate list of functions that had to be kept in sync with what the
code in SelectionDAGBuilder.cpp was handling.  I've resolved that here by
moving the list into TargetLibraryInfo.  This is somewhat redundant in
SelectionDAGBuilder but it will ensure that we keep things consistent.

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

12 years agoFix memcmp code-gen to honor -fno-builtin.
Bob Wilson [Fri, 3 Aug 2012 21:26:18 +0000 (21:26 +0000)]
Fix memcmp code-gen to honor -fno-builtin.

I noticed that SelectionDAGBuilder::visitCall was missing a check for memcmp
in TargetLibraryInfo, so that it would use custom code for memcmp calls even
with -fno-builtin.  I also had to add a new -disable-simplify-libcalls option
to llc so that I could write a test for this.

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

12 years agoCompletely eliminate VNInfo flags.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 20:59:32 +0000 (20:59 +0000)]
Completely eliminate VNInfo flags.

The 'unused' state of a value number can be represented as an invalid
def SlotIndex. This also exposed code that shouldn't have been looking
at unused value VNInfos.

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

12 years agoFix a couple of loops that were processing unused value numbers.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 20:59:29 +0000 (20:59 +0000)]
Fix a couple of loops that were processing unused value numbers.

Unused VNInfos should be left alone. Their def SlotIndex doesn't point
to anything.

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

12 years agoSilence unused variable warning in -asserts build
Matt Beaumont-Gay [Fri, 3 Aug 2012 20:54:11 +0000 (20:54 +0000)]
Silence unused variable warning in -asserts build

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

12 years agoEliminate the VNInfo::hasPHIKill() flag.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 20:19:44 +0000 (20:19 +0000)]
Eliminate the VNInfo::hasPHIKill() flag.

The only real user of the flag was removeCopyByCommutingDef(), and it
has been switched to LiveIntervals::hasPHIKill().

All the code changed by this patch was only concerned with computing and
propagating the flag.

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

12 years agoMake the hasPHIKills flag a computed property.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 20:10:24 +0000 (20:10 +0000)]
Make the hasPHIKills flag a computed property.

The VNInfo::HAS_PHI_KILL is only half supported. We precompute it in
LiveIntervalAnalysis, but it isn't properly updated by live range
splitting and functions like shrinkToUses().

It is only used in one place: RegisterCoalescer::removeCopyByCommutingDef().

This patch changes that function to use a new LiveIntervals::hasPHIKill()
function that computes the flag for a given value number.

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

12 years agoAdd a configure flag for enabling -Werror on the command line
Eric Christopher [Fri, 3 Aug 2012 19:58:20 +0000 (19:58 +0000)]
Add a configure flag for enabling -Werror on the command line
while building as requested by Lang.

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

12 years agoAdd support for detecting libxml for Dmitri's work. He'll
Eric Christopher [Fri, 3 Aug 2012 19:47:19 +0000 (19:47 +0000)]
Add support for detecting libxml for Dmitri's work. He'll
commit code in clang that uses this shortly.

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

12 years agoAdd a configure option to pass -std=c++11 on the command line.
Eric Christopher [Fri, 3 Aug 2012 19:47:14 +0000 (19:47 +0000)]
Add a configure option to pass -std=c++11 on the command line.

rdar://11366674

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

12 years agoRemove a dead prototype.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 18:34:32 +0000 (18:34 +0000)]
Remove a dead prototype.

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

12 years agoRevert previous patch here, we should instead configure in specific
Eric Christopher [Fri, 3 Aug 2012 17:45:31 +0000 (17:45 +0000)]
Revert previous patch here, we should instead configure in specific
packages for particular uses.

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

12 years agoDelete dead function.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 15:21:21 +0000 (15:21 +0000)]
Delete dead function.

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

12 years agoDon't delete dead code in TwoAddressInstructionPass.
Jakob Stoklund Olesen [Fri, 3 Aug 2012 15:11:57 +0000 (15:11 +0000)]
Don't delete dead code in TwoAddressInstructionPass.

This functionality was added before we started running
DeadMachineInstructionElim on all targets. It serves no purpose now.

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

12 years agoallow 'make CPPFLAGS=<something>' work again
Gabor Greif [Fri, 3 Aug 2012 13:31:24 +0000 (13:31 +0000)]
allow 'make CPPFLAGS=<something>' work again

this makes this hack a bit more bearable
for poor souls who need to pass custom
preprocessor flags to the build process

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

12 years agoAdd a BUILD_FLAGS variable so that autoconf checks have a place
Eric Christopher [Fri, 3 Aug 2012 05:18:00 +0000 (05:18 +0000)]
Add a BUILD_FLAGS variable so that autoconf checks have a place
to store additional flag options since too many things can
and do override CPPFLAGS. Also, this is exported, unlike CPPFLAGS
so it can be actually used elsewhere. This should enable us
to remove the AC_SUBSTs in the intel checks, but I have no way
of testing it.

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

12 years agoFall back to selection DAG isel for calls to builtin functions.
Bob Wilson [Fri, 3 Aug 2012 04:06:28 +0000 (04:06 +0000)]
Fall back to selection DAG isel for calls to builtin functions.

Fast isel doesn't currently have support for translating builtin function
calls to target instructions.  For embedded environments where the library
functions are not available, this is a matter of correctness and not
just optimization.  Most of this patch is just arranging to make the
TargetLibraryInfo available in fast isel.  <rdar://problem/12008746>

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

12 years agoAdd new getLibFunc method to TargetLibraryInfo.
Bob Wilson [Fri, 3 Aug 2012 04:06:22 +0000 (04:06 +0000)]
Add new getLibFunc method to TargetLibraryInfo.

This just provides a way to look up a LibFunc::Func enum value for a
function name.  Alphabetize the enums and function names so we can use a
binary search.

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

12 years ago[arm-fast-isel] Add support for shl, lshr, and ashr.
Jush Lu [Fri, 3 Aug 2012 02:37:48 +0000 (02:37 +0000)]
[arm-fast-isel] Add support for shl, lshr, and ashr.

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

12 years ago[CMake] Add yaml2obj to check-llvm.
NAKAMURA Takumi [Fri, 3 Aug 2012 00:45:32 +0000 (00:45 +0000)]
[CMake] Add yaml2obj to check-llvm.

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

12 years agoMove the "findUsedStructTypes" functionality outside of the Module class.
Bill Wendling [Fri, 3 Aug 2012 00:30:35 +0000 (00:30 +0000)]
Move the "findUsedStructTypes" functionality outside of the Module class.

The "findUsedStructTypes" method is very expensive to run. It needs to be
optimized so that LTO can run faster. Splitting this method out of the Module
class will help this occur. For instance, it can keep a list of seen objects so
that it doesn't process them over and over again.

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

12 years agoAdd support for the ARM GHC calling convention, this patch was in 3.0,
Eric Christopher [Fri, 3 Aug 2012 00:05:53 +0000 (00:05 +0000)]
Add support for the ARM GHC calling convention, this patch was in 3.0,
but somehow managed to be dropped later.

Patch by Karel Gardas.

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

12 years agoRemove redundant '== true' after a comparison.
Richard Trieu [Thu, 2 Aug 2012 23:22:39 +0000 (23:22 +0000)]
Remove redundant '== true' after a comparison.

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

12 years agoARM: Tidy up. Remove unused template parameters.
Jim Grosbach [Thu, 2 Aug 2012 22:08:27 +0000 (22:08 +0000)]
ARM: Tidy up. Remove unused template parameters.

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

12 years agoARM: More InstAlias refactors to use #NAME#.
Jim Grosbach [Thu, 2 Aug 2012 21:59:52 +0000 (21:59 +0000)]
ARM: More InstAlias refactors to use #NAME#.

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

12 years agoMove test yaml files under Inputs until they are converted to be the actual
Matt Beaumont-Gay [Thu, 2 Aug 2012 21:52:49 +0000 (21:52 +0000)]
Move test yaml files under Inputs until they are converted to be the actual
test files.

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

12 years agoARM: Refactor instaliases using TableGen support for #NAME#.
Jim Grosbach [Thu, 2 Aug 2012 21:50:41 +0000 (21:50 +0000)]
ARM: Refactor instaliases using TableGen support for #NAME#.

Now that TableGen supports references to NAME w/o it being explicitly
referenced in the definition's own name, use that to simplify
assembly InstAlias definitions in multiclasses.

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

12 years agoX86 Peephole: fold loads to the source register operand if possible.
Manman Ren [Thu, 2 Aug 2012 19:37:32 +0000 (19:37 +0000)]
X86 Peephole: fold loads to the source register operand if possible.

Add more comments and use early returns to reduce nesting in isLoadFoldable.
Also disable folding for V_SET0 to avoid introducing a const pool entry and
a const pool load.

rdar://10554090 and rdar://11873276

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

12 years ago[yaml2obj] Fix build. Apparently I've gotten too familiar with C++11.
Michael J. Spencer [Thu, 2 Aug 2012 19:36:30 +0000 (19:36 +0000)]
[yaml2obj] Fix build. Apparently I've gotten too familiar with C++11.

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

12 years agoAdd yaml2obj. A utility to convert YAML to binaries.
Michael J. Spencer [Thu, 2 Aug 2012 19:16:56 +0000 (19:16 +0000)]
Add yaml2obj. A utility to convert YAML to binaries.

yaml2obj takes a textual description of an object file in YAML format
and outputs the binary equivalent. This greatly simplifies writing
tests that take binary object files as input.

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

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