Commit Graph

82429 Commits

Author SHA1 Message Date
Duncan Sands 626b02470b Pointed out by housel on #llvm.
llvm-svn: 101395
2010-04-15 20:35:54 +00:00
Jakob Stoklund Olesen b642a27525 Fix PR6847. RegScavenger should ignore DebugValues.
llvm-svn: 101392
2010-04-15 20:28:39 +00:00
Nicolas Geoffray 19cd1d84ad Make sure the initialization of a GC root is after its definition.
llvm-svn: 101388
2010-04-15 19:53:35 +00:00
Anton Korobeynikov 839cdaa70a Revert r100896 and around - this breaks the only mingw32 buildbot we have.
llvm-svn: 101387
2010-04-15 19:51:42 +00:00
Gabor Greif b36d07cb93 prune includes
llvm-svn: 101385
2010-04-15 19:44:21 +00:00
Anders Carlsson 7a4a25de1e Improve the bit-field too wide error message.
llvm-svn: 101384
2010-04-15 18:47:32 +00:00
Evan Cheng 1ba1428577 ARM SelectDYN_ALLOC should emit a copy from SP rather than referencing SP directly. In cases where there are two dyn_alloc in the same BB it would have caused the old SP value to be reused and badness ensues. rdar://7493908
llvm is generating poor code for dynamic alloca, I'll fix that later.

llvm-svn: 101383
2010-04-15 18:42:28 +00:00
Johnny Chen 4230e35879 DEBUG() print out "Unknown format" msg.
llvm-svn: 101382
2010-04-15 18:13:51 +00:00
Douglas Gregor e8154339f4 Diagnose attempts to throw an abstract class type.
llvm-svn: 101381
2010-04-15 18:05:39 +00:00
Dan Gohman 48a189280e ReuseFrameIndexVals is used in multiple files, so it can't be static.
llvm-svn: 101379
2010-04-15 17:34:58 +00:00
Ted Kremenek 8db54ff1de Fix PR 6844, a regression caused by the introduction of llvm_unreachable for the default
case in GRExprEngine::Visit (in r101129).  Instead, enumerate all Stmt cases and have
no 'default' case in the switch statement.  When we encounter a Stmt we don't handle,
we should explicitly add it to the switch statement.

llvm-svn: 101378
2010-04-15 17:33:31 +00:00
Dan Gohman 2085719a98 EnablePPC64RS and EnablePPC32RS are used in multiple files, so they
can't be static.

llvm-svn: 101377
2010-04-15 17:20:57 +00:00
Dan Gohman b29cda9b3c Fix a bunch of namespace polution.
llvm-svn: 101376
2010-04-15 17:08:50 +00:00
Dan Gohman 345356ee9a Fix namespace polution.
llvm-svn: 101375
2010-04-15 16:23:27 +00:00
Dan Gohman 4e3c1139a2 Make getPredecessorWithUniqueSuccessorForBB return the unique successor
in addition to the predecessor.

llvm-svn: 101374
2010-04-15 16:19:08 +00:00
Anders Carlsson ea7b18298e Split adding the primary virtual base offsets out into a separate pass. This fixes a bug where we would lay out virtual bases in the wrong order.
llvm-svn: 101373
2010-04-15 16:12:58 +00:00
Douglas Gregor c1cf814c8b Fix a few cases where enum constant handling was using
ASTContext::getTypeSize() rather than ASTContext::getIntWidth() for
the width of an integral type. The former includes padding for bools
(to the target's size) while the latter does not, so we woud end up
zero-extending bools to the target width when we shouldn't. Fixes a
crash-on-valid in the included test.

llvm-svn: 101372
2010-04-15 15:53:31 +00:00
Gabor Greif ff3c8b7eaf typos
llvm-svn: 101371
2010-04-15 15:14:46 +00:00
Daniel Dunbar 9302f60606 clang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.
llvm-svn: 101370
2010-04-15 15:06:22 +00:00
Daniel Dunbar 1da6511b99 Tweak spelling (Bitfield -> BitField)
llvm-svn: 101369
2010-04-15 15:06:18 +00:00
Gabor Greif 9fd00c7d25 back out r101364, as it trips the linux nightlybot on some clang C++ tests
llvm-svn: 101368
2010-04-15 12:46:56 +00:00
Gabor Greif 3d9d235619 zap mergeinfo
llvm-svn: 101366
2010-04-15 11:36:12 +00:00
Benjamin Kramer a944a9a902 Simplify ".bc" detection.
llvm-svn: 101365
2010-04-15 11:33:14 +00:00
Gabor Greif aafd209632 rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

llvm-svn: 101364
2010-04-15 10:49:53 +00:00
Nick Lewycky a1e20de908 Teach -fixit to modify all of its inputs instead of just the main file, unless
-fixit-at specified a particular fixit to fix, or the -o flag was used.

llvm-svn: 101359
2010-04-15 06:46:58 +00:00
Ted Kremenek 72ac9505f0 Include sender address in completion log.
llvm-svn: 101358
2010-04-15 06:32:15 +00:00
Daniel Dunbar 3e0cac6f20 Tidy up comment.
llvm-svn: 101357
2010-04-15 06:18:42 +00:00
Daniel Dunbar 3d9289c736 Add TargetInfo::useBitfieldTypeAlignment().
- Used to determine whether the alignment of the type in a bit-field is
   respected when laying out structures. The default is true, targets can
   override this as needed.

 - This is designed to correspond to the PCC_BITFIELD_TYPE_MATTERS macro in
   gcc. The AST/Sema implementation only affects one line, unless I have
   forgotten something. I'd appreciate further review.

 - IRgen still needs to be updated to fully support this (which is effectively
   PR5591).

llvm-svn: 101356
2010-04-15 06:18:39 +00:00
Chris Lattner 3245afdf05 enhance the load/store narrowing optimization to handle a
tokenfactor in between the load/store.  This allows us to 
optimize test7 into:

_test7:                                 ## @test7
## BB#0:                                ## %entry
	movl	(%rdx), %eax
                                        ## kill: SIL<def> ESI<kill>
	movb	%sil, 5(%rdi)
	ret

instead of:

_test7:                                 ## @test7
## BB#0:                                ## %entry
	movl	4(%esp), %ecx
	movl	$-65281, %eax           ## imm = 0xFFFFFFFFFFFF00FF
	andl	4(%ecx), %eax
	movzbl	8(%esp), %edx
	shll	$8, %edx
	addl	%eax, %edx
	movl	12(%esp), %eax
	movl	(%eax), %eax
	movl	%edx, 4(%ecx)
	ret

llvm-svn: 101355
2010-04-15 06:10:49 +00:00
Daniel Dunbar 76fa840d09 Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM option parser.
- Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang.

llvm-svn: 101354
2010-04-15 06:09:03 +00:00
Chris Lattner 6ebd8674eb teach codegen to turn trunc(zextload) into load when possible.
This doesn't occur much at all, it only seems to formed in the case
when the trunc optimization kicks in due to phase ordering.  In that
case it is saves a few bytes on x86-32.

llvm-svn: 101350
2010-04-15 05:40:59 +00:00
Chris Lattner f9b2e3c68a add a simple dag combine to replace trivial shl+lshr with
and.  This happens with the store->load narrowing stuff.

llvm-svn: 101348
2010-04-15 05:28:43 +00:00
Daniel Dunbar 9c78d63fbc IRgen: Change CGBitFieldInfo to take the AccessInfo as constructor arguments, it is now an immutable object.
Also, add some checking of various invariants that should hold on the CGBitFieldInfo access.

llvm-svn: 101345
2010-04-15 05:09:32 +00:00
Daniel Dunbar bb13845c5f IRgen: Eliminate now unused fields from CGBitFieldInfo.
llvm-svn: 101344
2010-04-15 05:09:28 +00:00
Chris Lattner 4041ab6e00 Implement rdar://7860110 (also in target/readme.txt) narrowing
a load/or/and/store sequence into a narrower store when it is
safe.  Daniel tells me that clang will start producing this sort
of thing with bitfields, and this does  trigger a few dozen times
on 176.gcc produced by llvm-gcc even now.

This compiles code like CodeGen/X86/2009-05-28-DAGCombineCrash.ll 
into:

        movl    %eax, 36(%rdi)

instead of:

        movl    $4294967295, %eax       ## imm = 0xFFFFFFFF
        andq    32(%rdi), %rax
        shlq    $32, %rcx
        addq    %rax, %rcx
        movq    %rcx, 32(%rdi)

and each of the testcases into a single store.  Each of them used
to compile into craziness like this:

_test4:
	movl	$65535, %eax            ## imm = 0xFFFF
	andl	(%rdi), %eax
	shll	$16, %esi
	addl	%eax, %esi
	movl	%esi, (%rdi)
	ret

llvm-svn: 101343
2010-04-15 04:48:01 +00:00
Dan Gohman 913c998703 Add more const qualifiers for LLVM IR pointers in CodeGen.
llvm-svn: 101342
2010-04-15 04:33:49 +00:00
Chris Lattner 60bbb8c356 further tweak this to do something useful.
llvm-svn: 101341
2010-04-15 04:31:42 +00:00
Chris Lattner 9ebaf531ab remove undef control flow.
llvm-svn: 101340
2010-04-15 04:30:19 +00:00
Daniel Dunbar 67aba79b74 IRgen: (Reapply 101222, with fixes) Move EmitStoreThroughBitfieldLValue to use new CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself.
- Sadly, this doesn't seem to give any .ll size win so far. It is possible to make this routine significantly smarter & avoid various shifting, masking, and zext/sext, but I'm not really convinced it is worth it. It is tricky, and this is really instcombine's job.

 - No intended functionality change; the test case is just to increase coverage & serves as a demo file, it worked before this commit.

The new fixes from r101222 are:

 1. The shift to the target position needs to occur after the value is extended to the correct size. This broke Clang bootstrap, among other things no doubt.

 2. Swap the order of arguments to OR, to get a tad more constant folding.

llvm-svn: 101339
2010-04-15 03:47:33 +00:00
Daniel Dunbar f43481df34 Remove unnecessary uses of <iostream>.
llvm-svn: 101338
2010-04-15 03:47:24 +00:00
Daniel Dunbar 5f372e2f13 tests: MC/Disassembler tests depend on ARM support being compiler in.
llvm-svn: 101337
2010-04-15 03:47:20 +00:00
Chris Lattner 2df4fa5bc8 fix a crash on "lli ex" or any other file whose name is exactly two
characters long.

llvm-svn: 101336
2010-04-15 03:32:19 +00:00
Anders Carlsson 47bccf7f28 Fix build.
llvm-svn: 101335
2010-04-15 03:11:28 +00:00
Dan Gohman bcaf681cde Add const qualifiers to CodeGen's use of LLVM IR constructs.
llvm-svn: 101334
2010-04-15 01:51:59 +00:00
Eric Christopher 1bbc7086ff Rewrite handling of 64-bit palignr intrinsics to be vector shuffles.
Stop multiplying constant by 8 accordingly in the header and change
intrinsic definition for what types we expect.

Add to existing palignr test to check that we're emitting the correct things.

llvm-svn: 101332
2010-04-15 01:43:08 +00:00
Eric Christopher eabc9623da Allow lowering for palignr instructions for mmx sized vectors. Add
patterns to handle the lowering.

llvm-svn: 101331
2010-04-15 01:40:20 +00:00
Evan Cheng 87b4f7c1aa More 80 violations.
llvm-svn: 101330
2010-04-15 01:25:27 +00:00
Johnny Chen 0175ec1263 Wrap the error msgs in DEBUG() macro so that they won't appear in NDEBUG build.
llvm-svn: 101329
2010-04-15 01:20:56 +00:00
Ted Kremenek c9b748e74f Teach ASTVector::append() about the case where 'NumInputs' is 0. This hopefully fixes
a crash in InitListExpr's ctor.

llvm-svn: 101328
2010-04-15 01:14:12 +00:00
Ted Kremenek ef0ada67f5 Add simple python server for recording code completion timings.
llvm-svn: 101327
2010-04-15 01:02:31 +00:00