Commit Graph

95949 Commits

Author SHA1 Message Date
Chris Lattner bbb0f9661d filecheckize, this is still not optimal, see PR8643
llvm-svn: 119693
2010-11-18 07:49:32 +00:00
Chris Lattner c274a83442 remove another pointless noalias check: M is a memcpy, so the
source and dest are known to not overlap.

llvm-svn: 119692
2010-11-18 07:39:57 +00:00
Chris Lattner 75cfe98534 use AA::isNoAlias instead of open coding it. Remove an extraneous noalias check:
there is no need to check to see if the source and dest of a memcpy are noalias,
behavior is undefined if not.

llvm-svn: 119691
2010-11-18 07:38:43 +00:00
Chris Lattner 1e37bbafbb finish a thought.
llvm-svn: 119690
2010-11-18 07:32:33 +00:00
Chris Lattner 7e9b2ea3bf rearrange some code, splitting memcpy/memcpy optimization
out of processMemCpy into its own function.

llvm-svn: 119687
2010-11-18 07:02:37 +00:00
Chris Lattner ac5701319b allow eliminating an alloca that is just copied from an constant global
if it is passed as a byval argument.  The byval argument will just be a
read, so it is safe to read from the original global instead.  This allows
us to promote away the %agg.tmp alloca in PR8582

llvm-svn: 119686
2010-11-18 06:41:51 +00:00
John McCall 7decc9e4ea Calculate the value kind of an expression when it's created and
store it on the expression node.  Also store an "object kind",
which distinguishes ordinary "addressed" l-values (like
variable references and pointer dereferences) and bitfield,
@property, and vector-component l-values.

Currently we're not using these for much, but I aim to switch
pretty much everything calculating l-valueness over to them.
For now they shouldn't necessarily be trusted.

llvm-svn: 119685
2010-11-18 06:31:45 +00:00
Marcin Swiderski e5a1e8ae12 Added method for handling CXXOperatorCallExpr differently from CallExpr if CXXOperatorCallExpr represents method call.
Also fixed returning ExpolodedNodeSet from VisitCXXMethodCallExpr.

llvm-svn: 119684
2010-11-18 06:29:23 +00:00
Chris Lattner f183d5c4be enhance the "alloca is just a memcpy from constant global"
to ignore calls that obviously can't modify the alloca
because they are readonly/readnone.

llvm-svn: 119683
2010-11-18 06:26:49 +00:00
Chris Lattner 7aeae25c78 fix a small oversight in the "eliminate memcpy from constant global"
optimization.  If the alloca that is "memcpy'd from constant" also has
a memcpy from *it*, ignore it: it is a load.  We now optimize the testcase to:

define void @test2() {
  %B = alloca %T
  %a = bitcast %T* @G to i8*
  %b = bitcast %T* %B to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %a, i64 124, i32 4, i1 false)
  call void @bar(i8* %b)
  ret void
}

previously we would generate:

define void @test() {
  %B = alloca %T
  %b = bitcast %T* %B to i8*
  %G.0 = getelementptr inbounds %T* @G, i32 0, i32 0
  %tmp3 = load i8* %G.0, align 4
  %G.1 = getelementptr inbounds %T* @G, i32 0, i32 1
  %G.15 = bitcast [123 x i8]* %G.1 to i8*
  %1 = bitcast [123 x i8]* %G.1 to i984*
  %srcval = load i984* %1, align 1
  %B.0 = getelementptr inbounds %T* %B, i32 0, i32 0
  store i8 %tmp3, i8* %B.0, align 4
  %B.1 = getelementptr inbounds %T* %B, i32 0, i32 1
  %B.12 = bitcast [123 x i8]* %B.1 to i8*
  %2 = bitcast [123 x i8]* %B.1 to i984*
  store i984 %srcval, i984* %2, align 1
  call void @bar(i8* %b)
  ret void
}

llvm-svn: 119682
2010-11-18 06:20:47 +00:00
Chris Lattner 9434184142 filecheckize
llvm-svn: 119681
2010-11-18 06:16:43 +00:00
Greg Clayton 3af9ea56d3 Fixed Process::Halt() as it was broken for "process halt" after recent changes
to the DoHalt down in ProcessGDBRemote. I also moved the functionality that
was in ProcessGDBRemote::DoHalt up into Process::Halt so not every class has
to implement a tricky halt/resume on the internal state thread. The 
functionality is the same as it was before with two changes:
- when we eat the event we now just reuse the event we consume when the private
  state thread is paused and set the interrupted bool on the event if needed
- we also properly update the Process::m_public_state with the state of the
  event we consume.
  
Prior to this, if you issued a "process halt" it would eat the event, not 
update the process state, and then produce a new event with the interrupted
bit set and send it. Anyone listening to the event would get the stopped event
with a process that whose state was set to "running".

Fixed debugserver to not have to be spawned with the architecture of the
inferior process. This worked fine for launching processes, but when attaching
to processes by name or pid without a file in lldb, it would fail.

Now debugserver can support multiple architectures for a native debug session
on the current host. This currently means i386 and x86_64 are supported in
the same binary and a x86_64 debugserver can attach to a i386 executable.
This change involved a lot of changes to make sure we dynamically detect the
correct registers for the inferior process.

llvm-svn: 119680
2010-11-18 05:57:03 +00:00
Sean Callanan 19ca5608db Instructions for building LLDB with a debug LLVM
build under Xcode.

llvm-svn: 119679
2010-11-18 03:56:17 +00:00
Anton Yartsev 3f8f2886c1 comparison of AltiVec vectors now gives bool result (fix for 7533)
llvm-svn: 119678
2010-11-18 03:19:30 +00:00
Sean Callanan 79439e86d1 Updated to the LLVM/Clang of 2010-11-17 at 3:30pm.
llvm-svn: 119677
2010-11-18 02:56:27 +00:00
Chris Lattner dca25f69ca trivial QoI improvement. On this invalid input:
sahf	movl	344(%rdi),%r14d
we used to produce:

t.s:2:1: error: unexpected token in argument list

^

we now produce:
t.s:1:11: error: unexpected token in argument list
sahf	movl	344(%rdi),%r14d
    	    	^

rdar://8581401

llvm-svn: 119676
2010-11-18 02:53:02 +00:00
Jim Ingham 773d981ce2 The thread plan destructors may call Thread virtual methods. That means they have to get cleaned up in the derived class's destructor. Make sure that happens.
llvm-svn: 119675
2010-11-18 02:47:07 +00:00
Chris Lattner 8930615e78 patch from Frits van Bommel:
The attached patch fixes IRBuilder and the NoFolder class so that when
NoFolder is used the instructions it generates are treated just like
the ones IRBuilder creates directly (insert into block, assign them a
name and debug info, as applicable).
It does this by
1) having NoFolder return Instruction*s instead of Value*s,
2) having IRBuilder call Insert(Value, Name) on values obtained from
the folder like it does on instructions it creates directly, and
3) adding an Insert(Constant*, const Twine& = "") overload which just
returns the constant so that the other folders shouldn't have any
extra overhead as long as inlining is enabled.

While I was there, I also added some missing (CreateFNeg and various
Create*Cast) methods to NoFolder.

llvm-svn: 119614
2010-11-18 02:15:42 +00:00
Rafael Espindola 67c6ab8865 Change CodeGen to use .loc directives. This produces a lot more readable output
and testing is easier.  A good example is the unknown-location.ll test that
now can just look for ".loc 1 0 0".  We also don't use a DW_LNE_set_address for
every address change anymore.

llvm-svn: 119613
2010-11-18 02:04:25 +00:00
Howard Hinnant fb34010258 LWG 1432
llvm-svn: 119611
2010-11-18 01:47:02 +00:00
Evan Cheng 2d4e42fba6 Silence compiler warnings.
llvm-svn: 119610
2010-11-18 01:43:23 +00:00
Howard Hinnant a4a1ef1fc2 LWG 1404
llvm-svn: 119609
2010-11-18 01:40:00 +00:00
Jim Grosbach 9c335bf977 Remove trailing whitespace.
llvm-svn: 119608
2010-11-18 01:39:50 +00:00
Jim Grosbach a74c7ccd59 ARM PseudoInst instructions don't need or use an assembler string. Get rid of
the operand to the pattern.

llvm-svn: 119607
2010-11-18 01:38:26 +00:00
Jim Grosbach 96ef39a8db Revert 119600 to unbreak the build. Francois, please investigate.
llvm-svn: 119606
2010-11-18 01:38:07 +00:00
Dale Johannesen ed0d840838 Do not throw away alignment when generating the DAG for
memset; we may need it to decide between MOVAPS and MOVUPS
later.  Adjust a test that was looking for wrong code.
PR 3866 / 8675131.

llvm-svn: 119605
2010-11-18 01:35:23 +00:00
Evan Cheng a2f30cc121 Code clean up.
llvm-svn: 119604
2010-11-18 01:28:51 +00:00
Jim Grosbach 19be1fbca1 Add FIXME.
llvm-svn: 119603
2010-11-18 01:20:48 +00:00
Jim Grosbach cfb66204b7 Refactor the ARM PICADD and PICLDR* instructions to really be pseudos and not
just pretend to be.

llvm-svn: 119602
2010-11-18 01:15:56 +00:00
Owen Anderson d127e7174b Try again at providing Thumb2 encodings for basic multiplication operators.
llvm-svn: 119601
2010-11-18 01:08:42 +00:00
Francois Pichet ce52087bf3 Appease MSVC 2008: you can't use keyword this inside EXPECT_EQ().
This is because of bug 331418 on Microsoft Connect.

llvm-svn: 119600
2010-11-18 00:59:50 +00:00
John Thompson 488051f1a6 Fixed to use input redirection for source - to eliminate .s output.
llvm-svn: 119599
2010-11-18 00:50:20 +00:00
Jim Grosbach 8e7f8df4a2 Refactor a few ARM load instructions to better parameterize things and re-use
common encoding information.

llvm-svn: 119598
2010-11-18 00:46:58 +00:00
Owen Anderson 28883834e1 Revert r119593 while I figure out my testing disagrees with the buildbot.
llvm-svn: 119597
2010-11-18 00:42:51 +00:00
Ted Kremenek 5d304a34c6 CursorVisitor: switch remaining expressions over
to the data-recursion algorithm.  CursorVisitor
now no longer subclasses StmtVisitor.

llvm-svn: 119596
2010-11-18 00:42:18 +00:00
Dan Gohman 8ea83d81e0 Introduce memoization for ScalarEvolution dominates and properlyDominates
queries, and SCEVExpander getRelevantLoop queries.

llvm-svn: 119595
2010-11-18 00:34:22 +00:00
Argyrios Kyrtzidis ef6c8da50f -Rename -Wargument-larger-than -> -Wlarge-by-value-copy
-Improve the diagnostic message
-Add some comments

Suggestions by Chris.

llvm-svn: 119594
2010-11-18 00:20:36 +00:00
Owen Anderson 64aaddcd64 Provide correct Thumb2 encodings for basic multiplication operators.
llvm-svn: 119593
2010-11-18 00:19:10 +00:00
Oscar Fuentes b59ee62583 Updated library dependencies.
llvm-svn: 119592
2010-11-18 00:12:27 +00:00
Ted Kremenek 8390027a99 CursorVisitor: migrate handling of
'DependentScopeDeclRefExpr' and
'CXXDependentScopeMemberExpr' to the
data-recursion algorithm.

llvm-svn: 119591
2010-11-18 00:02:32 +00:00
John Thompson ddc7ce548c Bug 8621 fix - pointer cast stripped from inline asm constraint argument.
llvm-svn: 119590
2010-11-17 23:58:47 +00:00
Wesley Peck eef03fb444 Make MCJIT work with CMake.
llvm-svn: 119589
2010-11-17 23:35:07 +00:00
Jim Grosbach 56f471726c Clean up LEApcrel instuction(s) a bit. It's not really a Pseudo, so don't mark
it as such. Add some encoding information.

llvm-svn: 119588
2010-11-17 23:33:14 +00:00
Dan Gohman 7e6b393e66 Factor out the code for purging a SCEV from all the various memoization maps.
Some of these maps may merge in the future, but for now it's convenient to have
a utility function for them.

llvm-svn: 119587
2010-11-17 23:28:48 +00:00
Ted Kremenek 7df92ae92b Make definition of CXTranslationUnitImpl private
to libclang.

llvm-svn: 119585
2010-11-17 23:24:11 +00:00
Dan Gohman 7ee1bbb76c Merge the implementations of isLoopInvariant and hasComputableLoopEvolution, and
memoize the results. This improves compile time in code which highly complex
expressions which get queried many times.

llvm-svn: 119584
2010-11-17 23:21:44 +00:00
Argyrios Kyrtzidis af84ec0a96 Introduce option -Wargument-larger-than[=N] which warns about function definitions if they take by-value
or return by-value any POD that is larger than some threshold (default is 64 bytes).

Implements rdar://8548050.

llvm-svn: 119583
2010-11-17 23:11:54 +00:00
Sean Callanan afe16a71f7 Added support for constant strings of the form @"this-is-a-string".
They are replaced with calls to the CoreFoundation function 
CFStringCreateWithBytes() by a portion of the IRForTarget pass.

llvm-svn: 119582
2010-11-17 23:00:36 +00:00
Sean Callanan ac6429fc9a Whitespace fix.
llvm-svn: 119581
2010-11-17 23:00:07 +00:00
Wesley Peck 307e4688c5 Now that the MBlaze backend is in its own directory, split the test cases into multiple files for different types of instructions.
llvm-svn: 119580
2010-11-17 22:54:43 +00:00