oota-llvm.git
15 years agomake jump threading handle lexically identical compare instructions
Chris Lattner [Fri, 19 Jun 2009 16:27:56 +0000 (16:27 +0000)]
make jump threading handle lexically identical compare instructions
as if they were multiple uses of the same instruction.  This interacts
well with the existing loadpre that j-t does to open up many new jump
threads earlier.

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

15 years agofix the sparc codegen to not depend on the sparc asmprinter.
Chris Lattner [Fri, 19 Jun 2009 15:48:10 +0000 (15:48 +0000)]
fix the sparc codegen to not depend on the sparc asmprinter.

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

15 years agoAdd support for AuroraUX. Patch by evocallaghan.
Duncan Sands [Fri, 19 Jun 2009 14:40:01 +0000 (14:40 +0000)]
Add support for AuroraUX.  Patch by evocallaghan.

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

15 years agoSince -Wno-long-long is ignored without -pedantic,
Duncan Sands [Fri, 19 Jun 2009 12:40:30 +0000 (12:40 +0000)]
Since -Wno-long-long is ignored without -pedantic,
place it with -pedantic.  Remove -Wunused since it
is implied by -Wall.  Group -Wno-unused-parameter
with -Wall -W since it is the combination of these
two that turns on -Wunused-parameter.

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

15 years agoAdd comments.
Evan Cheng [Fri, 19 Jun 2009 07:06:07 +0000 (07:06 +0000)]
Add comments.

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

15 years agoFix for PR2484: add an SSE1 pattern for a shuffle we normally prefer to
Eli Friedman [Fri, 19 Jun 2009 07:00:55 +0000 (07:00 +0000)]
Fix for PR2484: add an SSE1 pattern for a shuffle we normally prefer to
handle with an SSE2 instruction.

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

15 years agoShould be using Bcc (average) latency to determine if-conversion threshold, not BL.
Evan Cheng [Fri, 19 Jun 2009 06:56:26 +0000 (06:56 +0000)]
Should be using Bcc (average) latency to determine if-conversion threshold, not BL.

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

15 years agoMinor cleanup; fixes review comments for a previous patch. Sorry for
Eli Friedman [Fri, 19 Jun 2009 06:01:55 +0000 (06:01 +0000)]
Minor cleanup; fixes review comments for a previous patch.  Sorry for
taking so long to get to this!

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

15 years agoTeach jump threading to look at comparisons between phi nodes and non-constants.
Nick Lewycky [Fri, 19 Jun 2009 04:56:29 +0000 (04:56 +0000)]
Teach jump threading to look at comparisons between phi nodes and non-constants.

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

15 years agoMisc tweaks to Intel asm printing to make it more compatible with MASM.
Eli Friedman [Fri, 19 Jun 2009 04:48:38 +0000 (04:48 +0000)]
Misc tweaks to Intel asm printing to make it more compatible with MASM.
Patch by Benedict Gaster.

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

15 years agoImprove tail call elim to move loads above readonly calls
Chris Lattner [Fri, 19 Jun 2009 04:22:16 +0000 (04:22 +0000)]
Improve tail call elim to move loads above readonly calls
when it allows forming a tail call.  Patch by Frits van
Bommel.  This implements PR4323.

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

15 years agopart of PR4405: disable a contentious optimization for
Chris Lattner [Fri, 19 Jun 2009 04:17:36 +0000 (04:17 +0000)]
part of PR4405: disable a contentious optimization for
strcmp -> memcmp when the lengths of the strings are unknown.

Patch by Nick Lewycky!

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

15 years agoMore VNInfo tweaking, plus a little progress on intra-block splitting.
Lang Hames [Fri, 19 Jun 2009 02:17:53 +0000 (02:17 +0000)]
More VNInfo tweaking, plus a little progress on intra-block splitting.

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

15 years agoTransfer dead markers when a ldrd is changed into a ldm or a pair of ldr.
Evan Cheng [Fri, 19 Jun 2009 01:59:04 +0000 (01:59 +0000)]
Transfer dead markers when a ldrd is changed into a ldm or a pair of ldr.

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

15 years agoInclude DataTypes.h for 'uint64_t'.
Zhongxing Xu [Fri, 19 Jun 2009 01:56:53 +0000 (01:56 +0000)]
Include DataTypes.h for 'uint64_t'.

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

15 years agoLatency information for ARM v6. It's rough and not yet hooked up. Right now we are...
Evan Cheng [Fri, 19 Jun 2009 01:51:50 +0000 (01:51 +0000)]
Latency information for ARM v6. It's rough and not yet hooked up. Right now  we are only using branch latency to determine if-conversion limits.

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

15 years agoMark a few Thumb instructions commutable; just happened to spot this
Eli Friedman [Fri, 19 Jun 2009 01:43:08 +0000 (01:43 +0000)]
Mark a few Thumb instructions commutable; just happened to spot this
while experimenting.  I'm reasonably sure this is correct, but please
tell me if these instructions have some strange property which makes this
change unsafe.

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

15 years agoFix weird class-size-being-different problems. At some level this is being caused...
Owen Anderson [Fri, 19 Jun 2009 00:48:22 +0000 (00:48 +0000)]
Fix weird class-size-being-different problems.  At some level this is being caused by config.h not being
included everywhere.

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

15 years agoadd a file I missed, this goes with r73743
Chris Lattner [Fri, 19 Jun 2009 00:47:59 +0000 (00:47 +0000)]
add a file I missed, this goes with r73743

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

15 years agoAdd some scaffolding for a new experimental asmprinter
Chris Lattner [Fri, 19 Jun 2009 00:47:33 +0000 (00:47 +0000)]
Add some scaffolding for a new experimental asmprinter
implementation.  The idea is that we want asmprinting to
work by converting MachineInstrs into a new MCInst class,
then the per-instruction asmprinter works on MCInst.  MCInst
and the new asmprinters will not depend on most of the
llvm code generators.  This allows building diassemblers
that don't link in the whole llvm code generator.  This is
step #1 of many.

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

15 years agomerge the common darwin settings from the X86/PPC/ARM targets
Chris Lattner [Fri, 19 Jun 2009 00:08:39 +0000 (00:08 +0000)]
merge the common darwin settings from the X86/PPC/ARM targets
into DarwinTargetAsmInfo.cpp.  The remaining differences should
be evaluated.  It seems strange that x86/arm has .zerofill but ppc
doesn't, etc.

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

15 years agofix build problem pointed out by John Thompson!
Chris Lattner [Thu, 18 Jun 2009 23:46:04 +0000 (23:46 +0000)]
fix build problem pointed out by John Thompson!

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

15 years agomove mangler quote handling from asm printers to TargetAsmInfo.
Chris Lattner [Thu, 18 Jun 2009 23:41:35 +0000 (23:41 +0000)]
move mangler quote handling from asm printers to TargetAsmInfo.

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

15 years agominor cleanup
Chris Lattner [Thu, 18 Jun 2009 23:33:13 +0000 (23:33 +0000)]
minor cleanup

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

15 years agosimplify macro debug info directive handling.
Chris Lattner [Thu, 18 Jun 2009 23:31:37 +0000 (23:31 +0000)]
simplify macro debug info directive handling.

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

15 years agoRemove UseThumbBacktraces. Just check if subtarget is darwin.
Evan Cheng [Thu, 18 Jun 2009 23:14:30 +0000 (23:14 +0000)]
Remove UseThumbBacktraces. Just check if subtarget is darwin.

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

15 years agofix file header
Chris Lattner [Thu, 18 Jun 2009 23:05:21 +0000 (23:05 +0000)]
fix file header

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

15 years agoAdd a skeleton driver for new machine code level fun. llvm-mc is meant
Chris Lattner [Thu, 18 Jun 2009 23:04:45 +0000 (23:04 +0000)]
Add a skeleton driver for new machine code level fun.  llvm-mc is meant
to be a test driver of other components in the system, which will develop
over time.

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

15 years agonew testcase for rdar://6983634
Chris Lattner [Thu, 18 Jun 2009 22:53:26 +0000 (22:53 +0000)]
new testcase for rdar://6983634

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

15 years agoAdd a parent pointer to SCEV, in preparation for getting rid of the global uniquing...
Owen Anderson [Thu, 18 Jun 2009 22:25:12 +0000 (22:25 +0000)]
Add a parent pointer to SCEV, in preparation for getting rid of the global uniquing tables.  No functionality change.

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

15 years agoImproved PHI def marking, replaced some gotos with breaks.
Lang Hames [Thu, 18 Jun 2009 22:01:47 +0000 (22:01 +0000)]
Improved PHI def marking, replaced some gotos with breaks.

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

15 years agoAllow user to specify separate SVN url for llvm and the test suite.
Evan Cheng [Thu, 18 Jun 2009 21:39:50 +0000 (21:39 +0000)]
Allow user to specify separate SVN url for llvm and the test suite.

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

15 years agoSimplify.
Owen Anderson [Thu, 18 Jun 2009 21:35:56 +0000 (21:35 +0000)]
Simplify.

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

15 years agoSimplify.
Owen Anderson [Thu, 18 Jun 2009 20:56:48 +0000 (20:56 +0000)]
Simplify.

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

15 years agoAdd a SmartScopedLock, and use it to simplify code.
Owen Anderson [Thu, 18 Jun 2009 20:51:00 +0000 (20:51 +0000)]
Add a SmartScopedLock, and use it to simplify code.

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

15 years agoSimplify with SmartRWMutex.
Owen Anderson [Thu, 18 Jun 2009 20:44:31 +0000 (20:44 +0000)]
Simplify with SmartRWMutex.

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

15 years agoOn Darwin, ams printer should output a second label before a jump table so the linker...
Evan Cheng [Thu, 18 Jun 2009 20:37:15 +0000 (20:37 +0000)]
On Darwin, ams printer should output a second label before a jump table so the linker knows it's a new atom. But this is only needed if the jump table is put in a separate section from the function body.

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

15 years agoSimplify by using no-op-when-not-multithreaded locks.
Owen Anderson [Thu, 18 Jun 2009 20:36:21 +0000 (20:36 +0000)]
Simplify by using no-op-when-not-multithreaded locks.

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

15 years agoGeneralize LSR's OptimizeSMax to handle unsigned max tests as well
Dan Gohman [Thu, 18 Jun 2009 20:23:18 +0000 (20:23 +0000)]
Generalize LSR's OptimizeSMax to handle unsigned max tests as well
as signed max tests. Along with r73717, this helps CodeGen avoid
emitting code for a maximum operation for this class of loop.

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

15 years agoRecognize n != 0 ? n : 1 as umax(n, 1). Previously only ULT/UGT/ULE/UGE
Dan Gohman [Thu, 18 Jun 2009 20:21:07 +0000 (20:21 +0000)]
Recognize n != 0 ? n : 1 as umax(n, 1). Previously only ULT/UGT/ULE/UGE
comparisons were recognized for umax, but instcombine canonicalizes
unsigned comparisons with zero to this simpler form.

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

15 years agoSimplify using mutexes that become no-ops when not in multithreaded mode.
Owen Anderson [Thu, 18 Jun 2009 20:15:26 +0000 (20:15 +0000)]
Simplify using mutexes that become no-ops when not in multithreaded mode.

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

15 years agoRevert IRBuilder CC propagation. Fix SimplifyLibCalls instead.
Anton Korobeynikov [Thu, 18 Jun 2009 20:05:31 +0000 (20:05 +0000)]
Revert IRBuilder CC propagation. Fix SimplifyLibCalls instead.

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

15 years agoSimplify a lot of code by using a R/W mutex that becomes a no-op when multithreading...
Owen Anderson [Thu, 18 Jun 2009 19:10:19 +0000 (19:10 +0000)]
Simplify a lot of code by using a R/W mutex that becomes a no-op when multithreading is disabled.

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

15 years agoUse SmartMutex to simplify.
Owen Anderson [Thu, 18 Jun 2009 18:36:34 +0000 (18:36 +0000)]
Use SmartMutex to simplify.

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

15 years agoSimplify the SmartMutex implementation a bit.
Owen Anderson [Thu, 18 Jun 2009 18:29:03 +0000 (18:29 +0000)]
Simplify the SmartMutex implementation a bit.

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

15 years agoGive RWMutex the SmartRWMutex treatment too.
Owen Anderson [Thu, 18 Jun 2009 18:26:15 +0000 (18:26 +0000)]
Give RWMutex the SmartRWMutex treatment too.

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

15 years agoInsert a SmartMutex templated class into the class hierarchy, which takes a template...
Owen Anderson [Thu, 18 Jun 2009 17:53:17 +0000 (17:53 +0000)]
Insert a SmartMutex templated class into the class hierarchy, which takes a template parameter specifying whether this mutex
should become a no-op when not running in multithreaded mode.  Make sys::Mutex a typedef of SmartMutex<false>, to preserve source compatibility.

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

15 years agoUpdate CMake files to account for new location of Threading.cpp.
Ted Kremenek [Thu, 18 Jun 2009 17:47:09 +0000 (17:47 +0000)]
Update CMake files to account for new location of Threading.cpp.

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

15 years agoMove Threading.[h|cpp] from Support to System.
Owen Anderson [Thu, 18 Jun 2009 16:54:52 +0000 (16:54 +0000)]
Move Threading.[h|cpp] from Support to System.

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

15 years agoRemove the code from IVUsers that attempted to handle
Dan Gohman [Thu, 18 Jun 2009 16:54:06 +0000 (16:54 +0000)]
Remove the code from IVUsers that attempted to handle
casted induction variables in cases where the cast
isn't foldable. It ended up being a pessimization in
many cases. This could be fixed, but it would require
a bunch of complicated code in IVUsers' clients. The
advantages of this approach aren't visible enough to
justify it at this time.

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

15 years agoGeneralize the zext(trunc(t) & C) instcombine to work even with
Dan Gohman [Thu, 18 Jun 2009 16:30:21 +0000 (16:30 +0000)]
Generalize the zext(trunc(t) & C) instcombine to work even with
C is not a low-bits mask, and add a similar instcombine for
zext((trunc(t) & C) ^ C).

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

15 years agoUpdate a comment to reflect the code.
Dan Gohman [Thu, 18 Jun 2009 16:24:47 +0000 (16:24 +0000)]
Update a comment to reflect the code.

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

15 years agoFix the double checked locking in this file too.
Owen Anderson [Thu, 18 Jun 2009 16:17:42 +0000 (16:17 +0000)]
Fix the double checked locking in this file too.

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

15 years agoAs pointed out by Duncan, I accidentally dropped the first MemoryFence of the
Owen Anderson [Thu, 18 Jun 2009 16:08:27 +0000 (16:08 +0000)]
As pointed out by Duncan, I accidentally dropped the first MemoryFence of the
double-checked locking pattern here.

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

15 years agoForgot to commit this hunk
Anton Korobeynikov [Thu, 18 Jun 2009 08:30:57 +0000 (08:30 +0000)]
Forgot to commit this hunk

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

15 years agoPropagate calling conv for invokes too
Anton Korobeynikov [Thu, 18 Jun 2009 08:13:56 +0000 (08:13 +0000)]
Propagate calling conv for invokes too

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

15 years agoDon't use int8_t, that requires DataTypes.h
Chris Lattner [Thu, 18 Jun 2009 04:56:53 +0000 (04:56 +0000)]
Don't use int8_t, that requires DataTypes.h

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

15 years agoFix build when disable thread support.
Owen Anderson [Thu, 18 Jun 2009 04:44:46 +0000 (04:44 +0000)]
Fix build when disable thread support.

Patch by Howard Su.

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

15 years agoinclude header for uint8_t.
Zhongxing Xu [Thu, 18 Jun 2009 04:11:43 +0000 (04:11 +0000)]
include header for uint8_t.

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

15 years agoAdd braces to clarify if/else structure and remove warning.
Nick Lewycky [Thu, 18 Jun 2009 03:01:42 +0000 (03:01 +0000)]
Add braces to clarify if/else structure and remove warning.

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

15 years ago- Update register allocation hint after coalescing. This is done by the target since...
Evan Cheng [Thu, 18 Jun 2009 02:04:01 +0000 (02:04 +0000)]
- Update register allocation hint after coalescing. This is done by the target since the hint is target dependent. This is important for ARM register pair hints.
- Register allocator should resolve the second part of the hint (register number) before passing it to the target since it knows virtual register to physical register mapping.
- More fixes to get ARM load / store double word working.

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

15 years agoIt looks like nobody is working on PR 4158, so I'm
Dale Johannesen [Thu, 18 Jun 2009 01:07:23 +0000 (01:07 +0000)]
It looks like nobody is working on PR 4158, so I'm
adding a check to catch this case at compile time
instead of quietly generating incorrect code.
That will at least let us identify CBE failures
that are not due to this problem.

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

15 years agoFix trailing whitespace from ScalarEvolution::print.
Dan Gohman [Thu, 18 Jun 2009 00:37:45 +0000 (00:37 +0000)]
Fix trailing whitespace from ScalarEvolution::print.

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

15 years agoARM unified syntax is not specific to ELF; use it for Darwin, too.
Bob Wilson [Thu, 18 Jun 2009 00:36:17 +0000 (00:36 +0000)]
ARM unified syntax is not specific to ELF; use it for Darwin, too.

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

15 years agoTeach ScalarEvolution how to recognize another xor(and(x, C), C) case.
Dan Gohman [Thu, 18 Jun 2009 00:00:20 +0000 (00:00 +0000)]
Teach ScalarEvolution how to recognize another xor(and(x, C), C) case.
If C is a single bit and the and gets analyzed as a truncate and
zero-extend, the xor can be represnted as an add.

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

15 years agoDelete unnecessary braces.
Dan Gohman [Wed, 17 Jun 2009 23:54:37 +0000 (23:54 +0000)]
Delete unnecessary braces.

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

15 years agoReapply r73647 in a non-broken form.
Owen Anderson [Wed, 17 Jun 2009 23:49:06 +0000 (23:49 +0000)]
Reapply r73647 in a non-broken form.

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

15 years agoFix asm string from MOVi16
Anton Korobeynikov [Wed, 17 Jun 2009 23:43:36 +0000 (23:43 +0000)]
Fix asm string from MOVi16

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

15 years agoThumb2 instructions are enabled only in unified assembler mode.
Anton Korobeynikov [Wed, 17 Jun 2009 23:43:18 +0000 (23:43 +0000)]
Thumb2 instructions are enabled only in unified assembler mode.
Emit switch directive for it. I have no idea whether this is
requirement for Darwin or not.

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

15 years agoInstcombine zext(trunc(x) & mask) to x&mask, even if the trunc has
Dan Gohman [Wed, 17 Jun 2009 23:17:05 +0000 (23:17 +0000)]
Instcombine zext(trunc(x) & mask) to x&mask, even if the trunc has
multiple users.

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

15 years agoUse double-checked locking for this lazy initialization.
Owen Anderson [Wed, 17 Jun 2009 22:53:57 +0000 (22:53 +0000)]
Use double-checked locking for this lazy initialization.

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

15 years agoProtect the GC table in Function.cpp
Owen Anderson [Wed, 17 Jun 2009 22:23:31 +0000 (22:23 +0000)]
Protect the GC table in Function.cpp

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

15 years agoHonour calling convention and attributes of Callee by default.
Anton Korobeynikov [Wed, 17 Jun 2009 22:20:46 +0000 (22:20 +0000)]
Honour calling convention and attributes of Callee by default.

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

15 years agoUse atomic increment here.
Owen Anderson [Wed, 17 Jun 2009 22:01:09 +0000 (22:01 +0000)]
Use atomic increment here.

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

15 years agoThread-safe (and ManagedStatic-ized) LeakDetector!
Owen Anderson [Wed, 17 Jun 2009 21:56:05 +0000 (21:56 +0000)]
Thread-safe (and ManagedStatic-ized) LeakDetector!

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

15 years agoGuard mutation of the timing info global.
Owen Anderson [Wed, 17 Jun 2009 21:28:54 +0000 (21:28 +0000)]
Guard mutation of the timing info global.

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

15 years agoWe need to use double-checked locking for lazy initialization in this case when runni...
Owen Anderson [Wed, 17 Jun 2009 21:16:20 +0000 (21:16 +0000)]
We need to use double-checked locking for lazy initialization in this case when running multithreaded.

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

15 years agoFix link to BasicBlock doxygen documentation in Programmer's Manual
Stefanus Du Toit [Wed, 17 Jun 2009 21:12:26 +0000 (21:12 +0000)]
Fix link to BasicBlock doxygen documentation in Programmer's Manual

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

15 years agoVNInfo cleanup.
Lang Hames [Wed, 17 Jun 2009 21:01:20 +0000 (21:01 +0000)]
VNInfo cleanup.

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

15 years agoAdd -disable-output to a bunch of tests that don't care about the output.
Dan Gohman [Wed, 17 Jun 2009 20:56:26 +0000 (20:56 +0000)]
Add -disable-output to a bunch of tests that don't care about the output.

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

15 years agoThis fixes a bug introduced in 72661, which can
Dale Johannesen [Wed, 17 Jun 2009 20:48:23 +0000 (20:48 +0000)]
This fixes a bug introduced in 72661, which can
move loads back past a check that the load address
is valid, see new testcase.  The test that went
in with 72661 has exactly this case, except that
the conditional it's moving past is checking
something else; I've settled for changing that
test to reference a global, not a pointer.  It
may be possible to scan all the tests you pass and
make sure none of them are checking any component
of the address, but it's not trivial and I'm not
trying to do that here.

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

15 years agoFactor out some common code.
Owen Anderson [Wed, 17 Jun 2009 20:43:39 +0000 (20:43 +0000)]
Factor out some common code.

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

15 years agoAdd an RAII ScopedWriter, which allows one to acquire a writer lock for the duration...
Owen Anderson [Wed, 17 Jun 2009 20:34:43 +0000 (20:34 +0000)]
Add an RAII ScopedWriter, which allows one to acquire a writer lock for the duration of a scope.  Simplify a lot of uses of
writer locks in Constants.cpp by using it.

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

15 years agoSimplify the locking on the Constants tables, and make it more efficient, by pushing...
Owen Anderson [Wed, 17 Jun 2009 20:10:08 +0000 (20:10 +0000)]
Simplify the locking on the Constants tables, and make it more efficient, by pushing it into the ValueMap from the callers.
Document those ValueMap functions that are _not_ locked, so that callers are aware that they need to do the locking themselves.

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

15 years agoAdd debug message about non-local loads being clobbered.
Torok Edwin [Wed, 17 Jun 2009 18:48:18 +0000 (18:48 +0000)]
Add debug message about non-local loads being clobbered.

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

15 years agoType safety for Constants.cpp! Some of this is temporary, as I'm planning to push...
Owen Anderson [Wed, 17 Jun 2009 18:40:29 +0000 (18:40 +0000)]
Type safety for Constants.cpp!  Some of this is temporary, as I'm planning to push some of the R/W locking into FoldingSet.

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

15 years agoInitial support for some Thumb2 instructions.
Anton Korobeynikov [Wed, 17 Jun 2009 18:13:58 +0000 (18:13 +0000)]
Initial support for some Thumb2 instructions.
Patch by Viktor Kutuzov and Anton Korzh from Access Softek, Inc.

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

15 years agoUpdate comments to use doxygen syntax.
Dan Gohman [Wed, 17 Jun 2009 17:51:33 +0000 (17:51 +0000)]
Update comments to use doxygen syntax.

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

15 years agoProtect the ValueHandle table.
Owen Anderson [Wed, 17 Jun 2009 17:36:57 +0000 (17:36 +0000)]
Protect the ValueHandle table.

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

15 years agoWe need to guard reads of the AbstractTypeUsers list, as well as writes to it. While...
Owen Anderson [Wed, 17 Jun 2009 17:13:54 +0000 (17:13 +0000)]
We need to guard reads of the AbstractTypeUsers list, as well as writes to it.  While it would be nice to use a R/W lock here,
we can't, because it HAS to be recursive.

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

15 years agoDefine LLVM_NATIVE_ARCH in CMake, so that lli can actually JIT
Douglas Gregor [Wed, 17 Jun 2009 17:01:56 +0000 (17:01 +0000)]
Define LLVM_NATIVE_ARCH in CMake, so that lli can actually JIT

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

15 years agoAdd RWMutex.cpp to the CMake makefiles
Douglas Gregor [Wed, 17 Jun 2009 17:01:30 +0000 (17:01 +0000)]
Add RWMutex.cpp to the CMake makefiles

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

15 years agoType safety for TypeSymbolTable!
Owen Anderson [Wed, 17 Jun 2009 16:56:27 +0000 (16:56 +0000)]
Type safety for TypeSymbolTable!

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

15 years agomake sure that JIT examples link in their appropriate target.
Chris Lattner [Wed, 17 Jun 2009 16:48:44 +0000 (16:48 +0000)]
make sure that JIT examples link in their appropriate target.

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

15 years agoremove two headers subsumed by TargetSelect.h
Chris Lattner [Wed, 17 Jun 2009 16:45:02 +0000 (16:45 +0000)]
remove two headers subsumed by TargetSelect.h

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

15 years agoswitch to using llvm/Target/TargetSelect.h
Chris Lattner [Wed, 17 Jun 2009 16:42:19 +0000 (16:42 +0000)]
switch to using llvm/Target/TargetSelect.h

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

15 years agoAdd a utility header that makes it easy to link in the right set
Chris Lattner [Wed, 17 Jun 2009 16:42:01 +0000 (16:42 +0000)]
Add a utility header that makes it easy to link in the right set
of targets for various purposes.

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

15 years agoImprove the Win32 reader-writer lock implementation by making it just a normal
Owen Anderson [Wed, 17 Jun 2009 09:10:42 +0000 (09:10 +0000)]
Improve the Win32 reader-writer lock implementation by making it just a normal
lock.  This is obviously bad, but at least it's threadsafe!  If you know how
to improve this in a pre-Vista friendly well, patches welcome!

Patch by Max Burke.

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

15 years agoFix libLTO by #include'ing the initializers for all targets and all asm
Nick Lewycky [Wed, 17 Jun 2009 06:52:10 +0000 (06:52 +0000)]
Fix libLTO by #include'ing the initializers for all targets and all asm
printers.

While I'm here, alphabetize.

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

15 years ago>> What if my global variable was into a different address space than stack?
Sanjiv Gupta [Wed, 17 Jun 2009 06:47:15 +0000 (06:47 +0000)]
>> What if my global variable was into a different address space than stack?
>>
>
> It doesn't matter in terms of semantics: because AnalyzeGlobal
> returned false, we're guaranteed the address of the global is never
> taken.  I wouldn't be surprised if we end up generating invalid IR in
> some cases, though, because of the semantics of replaceAllUsesWith.
> Do you have a testcase that breaks?
>
>
The problem is replaceAllUsesWith asserts for type mismatch here. Try attached .bc with llvm-ld.

assert(New->getType() == getType() &&
        "replaceAllUses of value with new value of different type!");

Since stack is always on address space zero, I don't think that type of GV in a different address space is ever going to match.
The other way is to allow replaceAllUsesWith to ignore address spaces while comparing types. (do we have  a way to do that ?).
But then such an optimization may fail the entire idea of user wanting to place a variable into different memory space. The original idea of user might be to save on the stack space (data memory) and hence he asked the variable to be placed into different memory space (program memory). So the best bet here is to deny this optimization by checking

GV->getType()->getAddressSpace() == 0.

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