Commit Graph

95961 Commits

Author SHA1 Message Date
Greg Clayton ce02552b6a Added missing file.
llvm-svn: 119709
2010-11-18 17:29:15 +00:00
Dan Gohman 5ed61fe6a1 Bounds-check APInt's operator[].
llvm-svn: 119708
2010-11-18 17:14:56 +00:00
Dan Gohman 21a9683641 ExpandPseudos doesn't have any dependencies, so it can use the
simple form of INITIALIZE_PASS.

llvm-svn: 119707
2010-11-18 17:14:05 +00:00
Dan Gohman f1ebfc1544 Strip trailing whitespace.
llvm-svn: 119706
2010-11-18 17:06:31 +00:00
Dan Gohman 0ab28b62b1 Use llvm_unreachable for "impossible" situations.
llvm-svn: 119705
2010-11-18 17:05:57 +00:00
Dan Gohman 2e1fc849b2 Add support for PHI-translating sext, zext, and trunc instructions,
enabling more PRE. PR8586.

llvm-svn: 119704
2010-11-18 17:05:13 +00:00
Howard Hinnant 908484b147 LWG 1439
llvm-svn: 119703
2010-11-18 17:01:36 +00:00
Howard Hinnant 48d05bd26c LWG 1339
llvm-svn: 119699
2010-11-18 16:13:03 +00:00
Benjamin Kramer 5a3f1cfafd Fix a typo in the UTF-8 BOM (PR8645). Use a StringSwitch while at it.
llvm-svn: 119698
2010-11-18 12:46:39 +00:00
Craig Silverstein 9bc166ac86 In some situations, TemplateArgumentLoc wasn't setting TypeSourceLoc (see
http://llvm.org/bugs/show_bug.cgi?id=8558).  This patch fixes it.  Thanks to
rjmccall for all the coaching!

Approved by rjmccall

llvm-svn: 119697
2010-11-18 08:32:02 +00:00
Chris Lattner 1385dff8c0 slightly simplify code and substantially improve comment. Instead of
saying "it would be bad", give an example of what is going on.

llvm-svn: 119695
2010-11-18 08:07:09 +00:00
Chris Lattner 731caac7c6 remove a pointless restriction from memcpyopt. It was
refusing to optimize two memcpy's like this:

copy A <- B
copy C <- A

if it couldn't prove that noalias(B,C).  We can eliminate
the copy by producing a memmove instead of memcpy.

llvm-svn: 119694
2010-11-18 08:00:57 +00:00
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