oota-llvm.git
13 years agotest/CodeGen/X86/vec_cast.ll: [PR8311] Add explicit -mtriple=x86_64-linux and -mtripl...
NAKAMURA Takumi [Sat, 5 Mar 2011 02:38:02 +0000 (02:38 +0000)]
test/CodeGen/X86/vec_cast.ll: [PR8311] Add explicit -mtriple=x86_64-linux and -mtriple=x86_64-win32. Thanks to Nadav, it might be fixed in r126424.

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

13 years agotest commit
Jin-Gu Kang [Sat, 5 Mar 2011 02:36:09 +0000 (02:36 +0000)]
test commit

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

13 years agoCompute the constraints for global live range splitting from an interference pattern.
Jakob Stoklund Olesen [Sat, 5 Mar 2011 01:10:31 +0000 (01:10 +0000)]
Compute the constraints for global live range splitting from an interference pattern.

This simplifies the code and makes it faster too.

The interference patterns are saved for each candidate register. It will be
reused for actually executing the split. Work in progress.

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

13 years agoTeach the register scavenger to take subregs into account when finding a free register.
Jim Grosbach [Sat, 5 Mar 2011 00:20:19 +0000 (00:20 +0000)]
Teach the register scavenger to take subregs into account when finding a free register.

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

13 years agoSupport unregistering exception frames of functions when they are removed.
Eric Christopher [Fri, 4 Mar 2011 23:37:39 +0000 (23:37 +0000)]
Support unregistering exception frames of functions when they are removed.

Patch by Johannes Schaub!

Fixes PR8548

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

13 years agoFix the case where the number of jobs is less than the
David Greene [Fri, 4 Mar 2011 23:02:52 +0000 (23:02 +0000)]
Fix the case where the number of jobs is less than the
number of threads.  In that case make the number of threads
equal to the number of jobs and launch one jobs on each
thread.  This makes things work like make -j.

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

13 years agoImprove readability with some whitespace!
Eric Christopher [Fri, 4 Mar 2011 22:47:12 +0000 (22:47 +0000)]
Improve readability with some whitespace!

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

13 years agoExtract a method. No functional change.
Jakob Stoklund Olesen [Fri, 4 Mar 2011 22:11:11 +0000 (22:11 +0000)]
Extract a method. No functional change.

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

13 years agoInitialize variable.
Bill Wendling [Fri, 4 Mar 2011 21:38:47 +0000 (21:38 +0000)]
Initialize variable.

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

13 years agoGo back to comparing spill weights when deciding if interference can be evicted.
Jakob Stoklund Olesen [Fri, 4 Mar 2011 21:32:50 +0000 (21:32 +0000)]
Go back to comparing spill weights when deciding if interference can be evicted.

It gives better results. Sometimes, a live range can be large and still have
high spill weight. Such a range should not be spilled.

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

13 years agoImprove div/rem node handling on mips. Patch by Akira Hatanaka
Bruno Cardoso Lopes [Fri, 4 Mar 2011 21:03:24 +0000 (21:03 +0000)]
Improve div/rem node handling on mips. Patch by Akira Hatanaka

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

13 years agoAdd testcase for r127032
Bruno Cardoso Lopes [Fri, 4 Mar 2011 20:48:39 +0000 (20:48 +0000)]
Add testcase for r127032

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

13 years agoExpands register/immediate pairs when the immediate is too large to fit in 16-bit...
Bruno Cardoso Lopes [Fri, 4 Mar 2011 20:48:08 +0000 (20:48 +0000)]
Expands register/immediate pairs when the immediate is too large to fit in 16-bit field. Patch by Akira Hatanaka

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

13 years agoWhen decling to reuse existing expressions that involve casts, ignore
Dan Gohman [Fri, 4 Mar 2011 20:46:46 +0000 (20:46 +0000)]
When decling to reuse existing expressions that involve casts, ignore
bitcasts, which are really no-ops here. This fixes slowdowns on
MultiSource/Applications/aha and others.

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

13 years agoRewrite and simplify o32 vaarg passing, no functional changes. Patch by Sasa Stankovic
Bruno Cardoso Lopes [Fri, 4 Mar 2011 20:27:44 +0000 (20:27 +0000)]
Rewrite and simplify o32 vaarg passing, no functional changes. Patch by Sasa Stankovic

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

13 years agoBe nice to Xcore and the XMOS assembler and avoid quoting section names
Joerg Sonnenberger [Fri, 4 Mar 2011 20:03:14 +0000 (20:03 +0000)]
Be nice to Xcore and the XMOS assembler and avoid quoting section names
that contain only letters, digits and the characters "_" and ".".

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

13 years agoLowers block address. Currently asserts when relocation model is not PIC. Patch by...
Bruno Cardoso Lopes [Fri, 4 Mar 2011 20:01:52 +0000 (20:01 +0000)]
Lowers block address. Currently asserts when relocation model is not PIC. Patch by Akira Hatanaka

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

13 years agoraw_ostream: while it is generally desirable to do larger writes, it can lead to
Benjamin Kramer [Fri, 4 Mar 2011 19:49:30 +0000 (19:49 +0000)]
raw_ostream: while it is generally desirable to do larger writes, it can lead to
inefficient file system buffering if the writes are not a multiple of the desired
buffer size. Avoid this by limiting the large write to a multiple of the buffer
size and copying the remainder into the buffer.

Thanks to Dan for pointing this out.

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

13 years agoRenumber slot indexes locally when possible.
Jakob Stoklund Olesen [Fri, 4 Mar 2011 19:43:38 +0000 (19:43 +0000)]
Renumber slot indexes locally when possible.

Initially, slot indexes are quad-spaced. There is room for inserting up to 3
new instructions between the original instructions.

When we run out of indexes between two instructions, renumber locally using
double-spaced indexes. The original quad-spacing means that we catch up quickly,
and we only have to renumber a handful of instructions to get a monotonic
sequence. This is much faster than renumbering the whole function as we did
before.

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

13 years agoXFAIL for all. These tests are darwin specific anyway.
Devang Patel [Fri, 4 Mar 2011 19:38:10 +0000 (19:38 +0000)]
XFAIL for all. These tests are darwin specific anyway.

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

13 years agoRevert broken srem logic from r126991.
Nick Lewycky [Fri, 4 Mar 2011 19:26:08 +0000 (19:26 +0000)]
Revert broken srem logic from r126991.

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

13 years agoFix an old copy-n-paste
Bruno Cardoso Lopes [Fri, 4 Mar 2011 19:20:24 +0000 (19:20 +0000)]
Fix an old copy-n-paste

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

13 years agoDisable ARMGlobalMerge on darwin. The debugger is not yet able to extract individual...
Devang Patel [Fri, 4 Mar 2011 19:11:05 +0000 (19:11 +0000)]
Disable ARMGlobalMerge on darwin. The debugger is not yet able to extract individual variable's info from merged global.

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

13 years agoExpands FCOS and FSIN nodes when type is f64.
Bruno Cardoso Lopes [Fri, 4 Mar 2011 18:54:14 +0000 (18:54 +0000)]
Expands FCOS and FSIN nodes when type is f64.

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

13 years agoNumber SlotIndexes uniformly without looking at the number of defs on each instruction.
Jakob Stoklund Olesen [Fri, 4 Mar 2011 18:51:09 +0000 (18:51 +0000)]
Number SlotIndexes uniformly without looking at the number of defs on each instruction.

You can't really predict how many indexes will be needed from the number of
defs, so let's keep it simple.

Also remove an extra empty index that was inserted after each basic block. It
was intended for live-out ranges, but it was never used that way.

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

13 years agoSymbolize the default instruction distance.
Jakob Stoklund Olesen [Fri, 4 Mar 2011 18:36:51 +0000 (18:36 +0000)]
Symbolize the default instruction distance.

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

13 years agoraw_ostream: If writing a string that is larger than the buffer, write it directly...
Benjamin Kramer [Fri, 4 Mar 2011 18:18:16 +0000 (18:18 +0000)]
raw_ostream: If writing a string that is larger than the buffer, write it directly instead of doing many buffer-sized writes.

This caps the number of write(2) calls per string to a maximum of 2.

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

13 years agoDeferred SlotIndex renumbering was a good idea but never used.
Jakob Stoklund Olesen [Fri, 4 Mar 2011 18:08:32 +0000 (18:08 +0000)]
Deferred SlotIndex renumbering was a good idea but never used.

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

13 years agoAdd SlotIndex statistics.
Jakob Stoklund Olesen [Fri, 4 Mar 2011 18:08:29 +0000 (18:08 +0000)]
Add SlotIndex statistics.

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

13 years agoTweak debug output. No functional changes.
Jakob Stoklund Olesen [Fri, 4 Mar 2011 18:08:26 +0000 (18:08 +0000)]
Tweak debug output. No functional changes.

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

13 years agoFixes addc pattern when immediate cannot be represented with 16-bit. Patch by Akira...
Bruno Cardoso Lopes [Fri, 4 Mar 2011 17:59:18 +0000 (17:59 +0000)]
Fixes addc pattern when immediate cannot be represented with 16-bit. Patch by Akira Hatanaka

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

13 years agoRemove (hopefully) all trailing whitespaces from the mips backend. Patch by Hatanaka...
Bruno Cardoso Lopes [Fri, 4 Mar 2011 17:51:39 +0000 (17:51 +0000)]
Remove (hopefully) all trailing whitespaces from the mips backend. Patch by Hatanaka, Akira

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

13 years agoRevert commit 126684 "Use the correct shift amount type". It is only the correct
Duncan Sands [Fri, 4 Mar 2011 14:28:59 +0000 (14:28 +0000)]
Revert commit 126684 "Use the correct shift amount type".  It is only the correct
type after type legalization has completed.  Before then it may simply not be big
enough to hold the shift amount, particularly on x86 which uses a very small type
for shifts (this issue broke stuff in the past which is why LegalizeTypes carefully
uses a large type for shift amounts).

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

13 years agoAllow vector shifts (shl,lshr,ashr) on SPU.
Kalle Raiskila [Fri, 4 Mar 2011 13:19:18 +0000 (13:19 +0000)]
Allow vector shifts (shl,lshr,ashr) on SPU.
There was a previous implementation with patterns that would
have matched e.g.
shl <v4i32> <i32>,
but this is not valid LLVM IR so they never were selected.

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

13 years agoAllow load from constant on SPU.
Kalle Raiskila [Fri, 4 Mar 2011 12:00:11 +0000 (12:00 +0000)]
Allow load from constant on SPU.
A 'load <4 x i32>* null' crashes llc before this fix.

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

13 years agoFold "icmp pred (srem X, Y), Y" like we do for urem. Handle signed comparisons
Nick Lewycky [Fri, 4 Mar 2011 10:06:52 +0000 (10:06 +0000)]
Fold "icmp pred (srem X, Y), Y" like we do for urem. Handle signed comparisons
in the urem case, though not the other way around. This is enough to get #3 from
PR9343!

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

13 years agoTeach instruction simplify to use constant ranges to solve problems of the form
Nick Lewycky [Fri, 4 Mar 2011 07:00:57 +0000 (07:00 +0000)]
Teach instruction simplify to use constant ranges to solve problems of the form
"icmp pred %X, CI" and a number of examples where "%X = binop %Y, CI2".

Some of these cases (div and rem) used to make it through opt -O2, but the
others are probably now making code elsewhere redundant (probably instcombine).

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

13 years agoFollowup to r126970: add 64-bit encoding tests for str with reg operand.
Eli Friedman [Fri, 4 Mar 2011 04:06:47 +0000 (04:06 +0000)]
Followup to r126970: add 64-bit encoding tests for str with reg operand.

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

13 years agoDenseMap<uintptr_t,...> doesn't allow all values as keys.
Jakob Stoklund Olesen [Fri, 4 Mar 2011 02:48:56 +0000 (02:48 +0000)]
DenseMap<uintptr_t,...> doesn't allow all values as keys.

Avoid colliding with the sentinels, hopefully unbreaking
llvm-gcc-x86_64-linux-selfhost.

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

13 years agoMinor pre-RA-sched fixes and cleanup.
Andrew Trick [Fri, 4 Mar 2011 02:03:45 +0000 (02:03 +0000)]
Minor pre-RA-sched fixes and cleanup.
Fix the PendingQueue, then disable it because it's not required for
the current schedulers' heuristics.
Fix the logic for the unused list-ilp scheduler.

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

13 years agoAdd ArrayRef variant.
Devang Patel [Fri, 4 Mar 2011 01:20:33 +0000 (01:20 +0000)]
Add ArrayRef variant.

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

13 years agoPrecompute block frequencies, pow() isn't free.
Jakob Stoklund Olesen [Fri, 4 Mar 2011 00:58:40 +0000 (00:58 +0000)]
Precompute block frequencies, pow() isn't free.

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

13 years agoUse an IndexedMap instead of a DenseMap for the live-out cache.
Jakob Stoklund Olesen [Fri, 4 Mar 2011 00:15:36 +0000 (00:15 +0000)]
Use an IndexedMap instead of a DenseMap for the live-out cache.

This speeds up updateSSA() so it only accounts for 5% of the live range
splitting time.

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

13 years agoPR9377: Handle x86 str with register operand in a way consistent with gas.
Eli Friedman [Fri, 4 Mar 2011 00:10:17 +0000 (00:10 +0000)]
PR9377: Handle x86 str with register operand in a way consistent with gas.

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

13 years agoThere are times when the landing pad won't have a call to 'eh.selector' in
Bill Wendling [Thu, 3 Mar 2011 23:14:05 +0000 (23:14 +0000)]
There are times when the landing pad won't have a call to 'eh.selector' in
it. It's been assumed up til now that it would be in its immediate
successor. However, this isn't necessarily the case. It could be in one of its
successor's successors.

Modify the code to more thoroughly check for an 'eh.selector' call in
successors. It only looks at a successor if we get there as a result of an
unconditional branch.

Testcase ObjC/exceptions-4.m in r126968.

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

13 years agoPR8053: Fix encoding of S bit in some ARM instructions.
Bob Wilson [Thu, 3 Mar 2011 23:07:15 +0000 (23:07 +0000)]
PR8053: Fix encoding of S bit in some ARM instructions.
Patch by Zonr Chang!

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

13 years agoRevert r123908; the code in question is completely untested and wrong.
Eli Friedman [Thu, 3 Mar 2011 22:33:23 +0000 (22:33 +0000)]
Revert r123908; the code in question is completely untested and wrong.

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

13 years agoBug#9033: For the ELF assembler output, always quote the section name.
Joerg Sonnenberger [Thu, 3 Mar 2011 22:31:08 +0000 (22:31 +0000)]
Bug#9033: For the ELF assembler output, always quote the section name.

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

13 years agoFix typo.
Devang Patel [Thu, 3 Mar 2011 21:49:41 +0000 (21:49 +0000)]
Fix typo.

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

13 years agoFix thinko in previous check-in.
Devang Patel [Thu, 3 Mar 2011 20:08:10 +0000 (20:08 +0000)]
Fix thinko in previous check-in.
Add comment.

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

13 years agollvm::Function argument count is not a good indicator of how many arugments does...
Devang Patel [Thu, 3 Mar 2011 20:02:02 +0000 (20:02 +0000)]
llvm::Function argument count is not a good indicator of how many arugments does the function have at source level. If we need more space, just resize vector conservatively. This vector is only used once per function.

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

13 years agoAllow a target to choose whether to prefer the scavenger emergency spill slot
Jim Grosbach [Thu, 3 Mar 2011 20:01:52 +0000 (20:01 +0000)]
Allow a target to choose whether to prefer the scavenger emergency spill slot
be next to the frame pointer or the stack pointer.

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

13 years agoSplit MCEELFStreamer and ELFObjectWriter into .h and .cpp files, so that other compon...
Jan Sjödin [Thu, 3 Mar 2011 14:52:12 +0000 (14:52 +0000)]
Split MCEELFStreamer and ELFObjectWriter into .h and .cpp files, so that other components can use them.

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

13 years agoFix typo in comment.
Richard Osborne [Thu, 3 Mar 2011 14:21:22 +0000 (14:21 +0000)]
Fix typo in comment.

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

13 years agoOptimize fprintf -> iprintf if there are no floating point arguments
Richard Osborne [Thu, 3 Mar 2011 14:20:22 +0000 (14:20 +0000)]
Optimize fprintf -> iprintf if there are no floating point arguments
and siprintf is available on the target.

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

13 years agoPTX: Fix Emacs renaming a symbol
Justin Holewinski [Thu, 3 Mar 2011 14:09:40 +0000 (14:09 +0000)]
PTX: Fix Emacs renaming a symbol

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

13 years agoOptimize sprintf -> siprintf if there are no floating point arguments
Richard Osborne [Thu, 3 Mar 2011 14:09:28 +0000 (14:09 +0000)]
Optimize sprintf -> siprintf if there are no floating point arguments
and siprintf is available on the target.

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

13 years agoPTX: Fix a couple of lint violations
Justin Holewinski [Thu, 3 Mar 2011 13:34:29 +0000 (13:34 +0000)]
PTX: Fix a couple of lint violations

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

13 years agoOptimize printf -> iprintf if there are no floating point arguments
Richard Osborne [Thu, 3 Mar 2011 13:17:51 +0000 (13:17 +0000)]
Optimize printf -> iprintf if there are no floating point arguments
and iprintf is available on the target. Currently iprintf is only
marked as being available on the XCore.

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

13 years agoUse X86_thiscall calling convention for Win64 as well.
Tilmann Scheller [Thu, 3 Mar 2011 07:49:07 +0000 (07:49 +0000)]
Use X86_thiscall calling convention for Win64 as well.

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

13 years agoPR9352: Always emit a relocation for weak symbols. Not emitting relocations
Eli Friedman [Thu, 3 Mar 2011 07:24:36 +0000 (07:24 +0000)]
PR9352: Always emit a relocation for weak symbols. Not emitting relocations
for calls to weak symbols with a definition has the appearance of working
with LLVM-generated code because weak symbol definitions are put in their
own sections.

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

13 years agoTableGen should not ignore BX instructions for the ARM disassembler. pr9368.
Bob Wilson [Thu, 3 Mar 2011 07:19:52 +0000 (07:19 +0000)]
TableGen should not ignore BX instructions for the ARM disassembler. pr9368.

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

13 years agoAdd a readme entry for the redundant movw issue for pr9370.
Bob Wilson [Thu, 3 Mar 2011 06:39:09 +0000 (06:39 +0000)]
Add a readme entry for the redundant movw issue for pr9370.

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

13 years agoRenumber slot indexes uniformly instead of spacing according to the number of defs.
Jakob Stoklund Olesen [Thu, 3 Mar 2011 06:29:01 +0000 (06:29 +0000)]
Renumber slot indexes uniformly instead of spacing according to the number of defs.

There are probably much larger speedups to be had by renumbering locally instead
of looping over the whole function. For now, the greedy register allocator is
25% faster.

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

13 years agoRepresent sentinel slot indexes with a null pointer.
Jakob Stoklund Olesen [Thu, 3 Mar 2011 05:40:04 +0000 (05:40 +0000)]
Represent sentinel slot indexes with a null pointer.

This is much faster than using a pointer to a ManagedStatic object accessed with
a function call. The greedy register allocator is 5% faster overall just from
the SlotIndex default constructor savings.

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

13 years agoAvoid comparing invalid slot indexes, and assert that it doesn't happen.
Jakob Stoklund Olesen [Thu, 3 Mar 2011 05:18:19 +0000 (05:18 +0000)]
Avoid comparing invalid slot indexes, and assert that it doesn't happen.

The SlotIndex created by the default construction does not represent a position
in the function, and it doesn't make sense to compare it to other indexes.

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

13 years agoOptimize SlotIndex equality tests.
Jakob Stoklund Olesen [Thu, 3 Mar 2011 05:18:15 +0000 (05:18 +0000)]
Optimize SlotIndex equality tests.

IndexListEntries have unique indexes, so it is not necessary to dereference
pointers to them.

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

13 years agoAvoid comparing invalid slot indexes.
Jakob Stoklund Olesen [Thu, 3 Mar 2011 04:23:52 +0000 (04:23 +0000)]
Avoid comparing invalid slot indexes.

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

13 years agoCache basic block bounds instead of asking SlotIndexes::getMBBRange all the time.
Jakob Stoklund Olesen [Thu, 3 Mar 2011 03:41:29 +0000 (03:41 +0000)]
Cache basic block bounds instead of asking SlotIndexes::getMBBRange all the time.

This speeds up the greedy register allocator by 15%.
DenseMap is not as fast as one might hope.

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

13 years agoCheck the ASM, not LLVM IR.
Bill Wendling [Thu, 3 Mar 2011 02:02:12 +0000 (02:02 +0000)]
Check the ASM, not LLVM IR.

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

13 years agopr9367: Add missing predicated BLX instructions.
Bob Wilson [Thu, 3 Mar 2011 01:41:01 +0000 (01:41 +0000)]
pr9367: Add missing predicated BLX instructions.
Patch by Jyun-Yan You, with some minor adjustments and a testcase from me.

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

13 years agoTestcase for r126913.
Bill Wendling [Thu, 3 Mar 2011 01:32:56 +0000 (01:32 +0000)]
Testcase for r126913.

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

13 years agoChange the SplitEditor interface to a single instance can be shared for multiple...
Jakob Stoklund Olesen [Thu, 3 Mar 2011 01:29:13 +0000 (01:29 +0000)]
Change the SplitEditor interface to a single instance can be shared for multiple splits.

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

13 years agoOnly run the updateSSA loop when we have actually seen multiple values.
Jakob Stoklund Olesen [Thu, 3 Mar 2011 01:29:10 +0000 (01:29 +0000)]
Only run the updateSSA loop when we have actually seen multiple values.

When only a single value has been seen, new PHIDefs are never needed.

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

13 years agoFix PHI handling in LiveIntervals::shrinkToUses().
Jakob Stoklund Olesen [Thu, 3 Mar 2011 00:20:51 +0000 (00:20 +0000)]
Fix PHI handling in LiveIntervals::shrinkToUses().

We need to wait until we meet a PHIDef in its defining block before resurrecting
PHIKills in the predecessors.

This should unbreak the llvm-gcc-build-x86_64-darwin10-x-mingw32-x-armeabi bot.

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

13 years agoTest case for r126864. Radar 9056407.
Stuart Hastings [Wed, 2 Mar 2011 23:41:40 +0000 (23:41 +0000)]
Test case for r126864.  Radar 9056407.

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

13 years agoAvoid exponential blow-up when printing DAGs.
Bob Wilson [Wed, 2 Mar 2011 23:38:06 +0000 (23:38 +0000)]
Avoid exponential blow-up when printing DAGs.

David Greene changed CannotYetSelect() to print the full DAG including multiple
copies of operands reached through different paths in the DAG.  Unfortunately
this blows up exponentially in some cases.  The depth limit of 100 is way too
high to prevent this -- I'm seeing a message string of 150MB with a depth of
only 40 in one particularly bad case, even though the DAG has less than 200
nodes.  Part of the problem is that the printing code is following chain
operands, so if you fail to select an operation with a chain, the printer will
follow all the chained operations back to the entry node.

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

13 years agoTurn the Edit member into a pointer so it can change dynamically.
Jakob Stoklund Olesen [Wed, 2 Mar 2011 23:31:50 +0000 (23:31 +0000)]
Turn the Edit member into a pointer so it can change dynamically.

No functional change.

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

13 years agoTest case for r126672. Radar 9055247.
Stuart Hastings [Wed, 2 Mar 2011 23:24:44 +0000 (23:24 +0000)]
Test case for r126672.  Radar 9055247.

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

13 years agoFixes an assertion failure while disassembling ARM rsbs reg/reg form.
Kevin Enderby [Wed, 2 Mar 2011 23:08:33 +0000 (23:08 +0000)]
Fixes an assertion failure while disassembling ARM rsbs reg/reg form.
Patch by Ted Kremenek!

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

13 years agoTransfer simply defined values directly without recomputing liveness and SSA.
Jakob Stoklund Olesen [Wed, 2 Mar 2011 23:05:19 +0000 (23:05 +0000)]
Transfer simply defined values directly without recomputing liveness and SSA.

Values that map to a single new value in a new interval after splitting don't
need new PHIDefs, and if the parent value was never rematerialized the live
range will be the same.

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

13 years agoExtract a method. No functional change.
Jakob Stoklund Olesen [Wed, 2 Mar 2011 23:05:16 +0000 (23:05 +0000)]
Extract a method. No functional change.

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

13 years agoFixing a bug when printing fpu text to object file. Patch by Mans Rullgard.
Renato Golin [Wed, 2 Mar 2011 21:20:09 +0000 (21:20 +0000)]
Fixing a bug when printing fpu text to object file. Patch by Mans Rullgard.

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

13 years agoadd some slice helper methods.
Chris Lattner [Wed, 2 Mar 2011 20:55:51 +0000 (20:55 +0000)]
add some slice helper methods.

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

13 years agoRemove DIFactory. Patch by Devang.
Duncan Sands [Wed, 2 Mar 2011 20:30:37 +0000 (20:30 +0000)]
Remove DIFactory.  Patch by Devang.

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

13 years agoCan't introduce floating-point immediate constants after legalization.
Stuart Hastings [Wed, 2 Mar 2011 19:36:30 +0000 (19:36 +0000)]
Can't introduce floating-point immediate constants after legalization.
Radar 9056407.

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

13 years agoAdd Win64 thiscall calling convention.
Tilmann Scheller [Wed, 2 Mar 2011 19:29:22 +0000 (19:29 +0000)]
Add Win64 thiscall calling convention.

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

13 years agoSupport for parallel compilation (/MP) when using the VS IDE.
Oscar Fuentes [Wed, 2 Mar 2011 17:47:37 +0000 (17:47 +0000)]
Support for parallel compilation (/MP) when using the VS IDE.

Patch by Erik Olofsson!

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

13 years ago[AVX] Fix mask predicates for 256-bit UNPCKLPS/D and implement
David Greene [Wed, 2 Mar 2011 17:23:43 +0000 (17:23 +0000)]
[AVX] Fix mask predicates for 256-bit UNPCKLPS/D and implement
      missing patterns for them.

      Add a SIMD test subdirectory to hold tests for SIMD instruction
      selection correctness and quality.
'

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

13 years agoptx: fix lint and compiler warnings
Che-Liang Chiou [Wed, 2 Mar 2011 07:58:46 +0000 (07:58 +0000)]
ptx: fix lint and compiler warnings

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

13 years agoAdd 64-bit addressing to PTX backend
Che-Liang Chiou [Wed, 2 Mar 2011 07:36:48 +0000 (07:36 +0000)]
Add 64-bit addressing to PTX backend

- Add '64bit' sub-target option.
- Select 32-bit/64-bit loads/stores based on '64bit' option.
- Fix function parameter order.

Patch by Justin Holewinski

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

13 years agoAdd a special streamer to libLTO that just records symbols definitions and
Rafael Espindola [Wed, 2 Mar 2011 04:14:42 +0000 (04:14 +0000)]
Add a special streamer to libLTO that just records symbols definitions and
uses.

The result produced by the streamer is used to give the linker more accurate
information and to add to llvm.compiler.used. The second improvement removes
the need for the user to add __attribute__((used)) to functions only used in
inline asm. The first one lets us build firefox with LTO on Darwin :-)

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

13 years agoFix some typos.
Cameron Zwarich [Wed, 2 Mar 2011 04:03:46 +0000 (04:03 +0000)]
Fix some typos.

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

13 years agoTeach the clang attribute emitter about InheritableParamAttr.
John McCall [Wed, 2 Mar 2011 04:00:52 +0000 (04:00 +0000)]
Teach the clang attribute emitter about InheritableParamAttr.
Intended to be atomic with clang r126828.

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

13 years agoRemove some more unused code that I missed.
Cameron Zwarich [Wed, 2 Mar 2011 03:48:29 +0000 (03:48 +0000)]
Remove some more unused code that I missed.

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

13 years agoEliminate the unused CodeGenPrepare option to split critical edges.
Cameron Zwarich [Wed, 2 Mar 2011 03:31:46 +0000 (03:31 +0000)]
Eliminate the unused CodeGenPrepare option to split critical edges.

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

13 years agoExtend initial support for primitive types in PTX backend
Che-Liang Chiou [Wed, 2 Mar 2011 03:20:28 +0000 (03:20 +0000)]
Extend initial support for primitive types in PTX backend

- Allow i16, i32, i64, float, and double types, using the native .u16,
  .u32, .u64, .f32, and .f64 PTX types.
- Allow loading/storing of all primitive types.
- Allow primitive types to be passed as parameters.
- Allow selection of PTX Version and Shader Model as sub-target attributes.
- Merge integer/floating-point test cases for load/store.
- Use .u32 instead of .s32 to conform to output from NVidia nvcc compiler.

Patch by Justin Holewinski

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

13 years agoSmall cleanup.
Bill Wendling [Wed, 2 Mar 2011 02:17:11 +0000 (02:17 +0000)]
Small cleanup.

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

13 years agoMove extendRange() into SplitEditor and delete the LiveRangeMap class.
Jakob Stoklund Olesen [Wed, 2 Mar 2011 01:59:34 +0000 (01:59 +0000)]
Move extendRange() into SplitEditor and delete the LiveRangeMap class.

Extract the updateSSA() method from the too long extendRange().

LiveOutCache can be shared among all the new intervals since there is at most
one of the new ranges live out from each basic block.

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

13 years agoQuiet a compiler warning about unused variable 'ExtVNI'.
Nick Lewycky [Wed, 2 Mar 2011 01:43:30 +0000 (01:43 +0000)]
Quiet a compiler warning about unused variable 'ExtVNI'.

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