Commit Graph

56212 Commits

Author SHA1 Message Date
Dale Johannesen c65830519e One more place where debug info affects codegen.
llvm-svn: 66930
2009-03-13 19:23:20 +00:00
Devang Patel a01646efda Test case for rev. 66925
llvm-svn: 66927
2009-03-13 18:50:51 +00:00
Ted Kremenek 80caa92255 Update checker build.
llvm-svn: 66926
2009-03-13 18:48:36 +00:00
Douglas Gregor f50abb42c3 Remove an already-fixed FIXME
llvm-svn: 66924
2009-03-13 18:41:07 +00:00
Douglas Gregor 1baf54e1aa Refactor the way we handle operator overloading and template
instantiation for binary operators. This change moves most of the
operator-overloading code from the parser action ActOnBinOp to a new,
parser-independent semantic checking routine CreateOverloadedBinOp. 

Of particular importance is the fact that CreateOverloadedBinOp does
*not* perform any name lookup based on the current parsing context (it
doesn't take a Scope*), since it has to be usable during template
instantiation, when there is no scope information. Rather, it takes a
pre-computed set of functions that are visible from the context or via
argument-dependent lookup, and adds to that set any member operators
and built-in operator candidates. The set of functions is computed in
the parser action ActOnBinOp based on the current context (both
operator name lookup and argument-dependent lookup). Within a
template, the set computed by ActOnBinOp is saved within the
type-dependent AST node and is augmented with the results of
argument-dependent name lookup at instantiation time (see
TemplateExprInstantiator::VisitCXXOperatorCallExpr).

Sadly, we can't fully test this yet. I'll follow up with template
instantiation for sizeof so that the real fun can begin.

llvm-svn: 66923
2009-03-13 18:40:31 +00:00
Rafael Espindola 71144973f3 Improve sext and zext of TLS variables.
llvm-svn: 66922
2009-03-13 18:37:06 +00:00
Gabor Greif 258232fb80 Second installment of "BasicBlock operands to the back"
changes.

For InvokeInst now all arguments begin at op_begin().
The Callee, Cont and Fail are now faster to get by
access relative to op_end().

This patch introduces some temporary uglyness in CallSite.
Next I'll bring CallInst up to a similar scheme and then
the uglyness will magically vanish.

This patch also exposes all the reliance of the libraries
on InvokeInst's operand ordering. I am thinking of taking
care of that too.

llvm-svn: 66920
2009-03-13 18:27:29 +00:00
Chris Lattner a18c768e6d remove a buggy test, it is not ok to use -debug in RUN line.
llvm-svn: 66918
2009-03-13 18:19:34 +00:00
Daniel Dunbar 52183091f1 ccc/Driver: Forward -fheinous-gnu-extensions to clang.
llvm-svn: 66915
2009-03-13 18:12:01 +00:00
Daniel Dunbar c5a5ac5015 Driver: Fix '-x none' handling.
- Enough stuff works now we can test argument parsing & pipelining.

llvm-svn: 66913
2009-03-13 17:57:10 +00:00
Daniel Dunbar 7326ad57a4 ccc/Driver: Normalize phase spelling in -ccc-print-phases.
llvm-svn: 66912
2009-03-13 17:52:07 +00:00
Daniel Dunbar e2ca3bddde Driver: Some minor bug fixes.
- language recognition was recognizing prefixes incorrectly.
 - -x none wasn't working.
 - test for "can lipo" was backwords.
 - missed a '"' in -ccc-print-phases

llvm-svn: 66911
2009-03-13 17:46:02 +00:00
Chris Lattner cda4d7e196 introduce a new -fheinous-gnu-extensions flag that enables really
really horrible extensions that are disabled by default but that can
be accepted by -fheinous-gnu-extensions (but which always emit a 
warning when enabled).

As our first instance of this, implement PR3788/PR3794, which allows
non-lvalues in inline asms in contexts where lvalues are required. bleh.

llvm-svn: 66910
2009-03-13 17:38:01 +00:00
Chris Lattner ef26c77c56 add a helper function to strip noop casts.
llvm-svn: 66909
2009-03-13 17:28:01 +00:00
Daniel Dunbar dfab7abdea Driver: Fix think in ArgList::MakeIndex.
llvm-svn: 66908
2009-03-13 17:25:24 +00:00
Daniel Dunbar 3efedddcf9 Driver: Return 0 from BuildCompilation on -ccc-print-phases,
-ccc-print-options.

llvm-svn: 66907
2009-03-13 17:24:34 +00:00
Daniel Dunbar ed50f6c356 Driver: Print -ccc-print-phases on stderr.
llvm-svn: 66906
2009-03-13 17:20:20 +00:00
Ted Kremenek 3626e0add0 Fix typo.
llvm-svn: 66905
2009-03-13 17:02:59 +00:00
Steve Naroff c4b30e596c Fix <rdar://problem/6675489> BlockDecl should not use llvm::smallvector.
Also changed BlockDecl API to be more consistent (wrt FunctionDecl).

llvm-svn: 66904
2009-03-13 16:56:44 +00:00
Chris Lattner 3fb71c8f49 generalize this code so that fast isel handles integer truncates to i1, which
codegen to the same thing as integer truncates to i8 (the top bits are 
just undefined).  This implements rdar://6667338

llvm-svn: 66902
2009-03-13 16:36:42 +00:00
Ted Kremenek 22358bd681 Add a hack in the analyzer to recover some path-sensitivity at branch
conditions. Currently the analyzer does not reason well about
promotions/truncations of symbolic values, so at branch conditions when we see:

  if (condition)
  
and condition is something like a 'short' or 'char', essentially ignore the
promotion to 'int' so that we track constraints on the original symbolic value.
We only ignore the casts if the underlying type has the same or fewer bits as
the converted type.

This fixes:

<rdar://problem/6619921>

llvm-svn: 66899
2009-03-13 16:32:54 +00:00
Chris Lattner ba42e49c14 add a new TGError class and use it to propagate location info with
errors when thrown.  This gets us nice errors like this from tblgen:

CMOVL32rr: 	(set GR32:i32:$dst, (X86cmov GR32:$src1, GR32:$src2))
/Users/sabre/llvm/Debug/bin/tblgen: error:
Included from X86.td:116:
Parsing X86InstrInfo.td:922: In CMOVL32rr: X86cmov node requires exactly 4 operands!
def CMOVL32rr : I<0x4C, MRMSrcReg,       // if <s, GR32 = GR32
^

instead of just:

CMOVL32rr: 	(set GR32:i32:$dst, (X86cmov GR32:$src1, GR32:$src2))
/Users/sabre/llvm/Debug/bin/tblgen: In CMOVL32rr: X86cmov node requires exactly 4 operands!

This is all I plan to do with this, but it should be easy enough to improve if anyone 
cares (e.g. keeping more loc info in "dag" expr records in tblgen.

llvm-svn: 66898
2009-03-13 16:25:21 +00:00
Chris Lattner bd9b9210c2 give each Record a location.
llvm-svn: 66897
2009-03-13 16:09:24 +00:00
Steve Naroff cfb6cf4c02 Reimplement fix for <rdar://problem/6451399> problems with labels and blocks.
This solution is much simpler (and doesn't add any per-scope overhead, which concerned Chris). 

The only downside is the LabelMap is now declared in two places (Sema and BlockSemaInfo). My original fix tried to unify the LabelMap in "Scope" (which would support nested functions in general). In any event, this fixes the bug given the current language definition. If/when we decide to support GCC style nested functions, this will need to be tweaked.

llvm-svn: 66896
2009-03-13 16:03:38 +00:00
Chris Lattner 87710ca527 make "locations" a class instead of a typedef.
llvm-svn: 66895
2009-03-13 16:01:53 +00:00
Ted Kremenek 0bf152ef0b Updated comment.
llvm-svn: 66894
2009-03-13 15:39:16 +00:00
Steve Naroff 846b1ec40f Remove ActiveScope (revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65694 and http://llvm.org/viewvc/llvm-project?view=rev&revision=66741).
Will replace with something better today...

llvm-svn: 66893
2009-03-13 15:38:40 +00:00
Ted Kremenek ec94f08dce Fix failure reported by Sebastian of test/Analysis/ptr-arith.c when the target
is 64-bit. I used his suggestion of doing a direct bitwidth/signedness
conversion of the 'offset' instead of just changing the sign. For more
information, see:

http://lists.cs.uiuc.edu/pipermail/cfe-dev/2009-March/004587.html

llvm-svn: 66892
2009-03-13 15:35:24 +00:00
Douglas Gregor 201217324a Split get_involved into Get Involved and Open Projects pages
llvm-svn: 66891
2009-03-13 15:06:27 +00:00
Duncan Sands 0c9742c3ae Update these for the 2.5 release.
llvm-svn: 66890
2009-03-13 13:42:20 +00:00
Daniel Dunbar 0a180f1499 Driver: Fix thinko in Darwin host identification.
llvm-svn: 66889
2009-03-13 12:23:29 +00:00
Daniel Dunbar aaf1ea6386 Driver: Support -ccc-print-phases.
llvm-svn: 66888
2009-03-13 12:19:02 +00:00
Daniel Dunbar 80665fb0c5 Driver: Add cast<> support for Action, and some other accessors.
llvm-svn: 66887
2009-03-13 12:17:08 +00:00
Daniel Dunbar 92d19016b5 ccc: Don't print the arch for every action when printing phases.
llvm-svn: 66886
2009-03-13 12:16:31 +00:00
Daniel Dunbar 6522933d7a Driver: Complete "pipelining" (building the list of abstract actions
to perform). Still doesn't do anything interesting.
 - This code came out much cleaner than in ccc with the reworked
   phases & mapping of types to lists of compilation steps (phases) to
   perform.

llvm-svn: 66885
2009-03-13 11:38:42 +00:00
Gabor Greif aa033f9570 support cmake
llvm-svn: 66884
2009-03-13 11:37:39 +00:00
Daniel Dunbar 286c39a993 Driver: Make phase names nouns not verbs.
llvm-svn: 66883
2009-03-13 11:36:01 +00:00
Daniel Dunbar 2a62703018 Driver: Add remaining Action classes we need.
llvm-svn: 66882
2009-03-13 11:30:17 +00:00
Daniel Dunbar e71b9640ad Driver: Add types::getNumCompilationPhases, getCompilationPhase to
provide information about what steps should be done for a particular
file type.

llvm-svn: 66881
2009-03-13 11:28:30 +00:00
Daniel Dunbar 58cac7ca68 Driver: Pull Phase info into separate file.
llvm-svn: 66880
2009-03-13 11:27:05 +00:00
Daniel Dunbar 5a3b818dea ccc/Driver: Forward -fprint-source-range-info to clang.
llvm-svn: 66879
2009-03-13 10:03:45 +00:00
Bill Wendling 798fd56d0f These instructions have special lowering that may lower them to SSE
instructions. Prevent that if we don't want implicit uses of SSE.

llvm-svn: 66877
2009-03-13 08:41:47 +00:00
Argyrios Kyrtzidis afc74e2326 Unbreak build, bring in std::string for GCC 4.3
llvm-svn: 66876
2009-03-13 08:12:13 +00:00
Evan Cheng 1fb8aedd1e Fix some significant problems with constant pools that resulted in unnecessary paddings between constant pool entries, larger than necessary alignments (e.g. 8 byte alignment for .literal4 sections), and potentially other issues.
1. ConstantPoolSDNode alignment field is log2 value of the alignment requirement. This is not consistent with other SDNode variants.
2. MachineConstantPool alignment field is also a log2 value.
3. However, some places are creating ConstantPoolSDNode with alignment value rather than log2 values. This creates entries with artificially large alignments, e.g. 256 for SSE vector values.
4. Constant pool entry offsets are computed when they are created. However, asm printer group them by sections. That means the offsets are no longer valid. However, asm printer uses them to determine size of padding between entries.
5. Asm printer uses expensive data structure multimap to track constant pool entries by sections.
6. Asm printer iterate over SmallPtrSet when it's emitting constant pool entries. This is non-deterministic.


Solutions:
1. ConstantPoolSDNode alignment field is changed to keep non-log2 value.
2. MachineConstantPool alignment field is also changed to keep non-log2 value.
3. Functions that create ConstantPool nodes are passing in non-log2 alignments.
4. MachineConstantPoolEntry no longer keeps an offset field. It's replaced with an alignment field. Offsets are not computed when constant pool entries are created. They are computed on the fly in asm printer and JIT.
5. Asm printer uses cheaper data structure to group constant pool entries.
6. Asm printer compute entry offsets after grouping is done.
7. Change JIT code to compute entry offsets on the fly.

llvm-svn: 66875
2009-03-13 07:51:59 +00:00
Evan Cheng bd5616271b Unbreak build.
llvm-svn: 66874
2009-03-13 07:41:30 +00:00
Chris Lattner 8db9bc7ee4 split buffer management and diagnostic printing out of the tblgen
lexer into its own TGSourceMgr class.

llvm-svn: 66873
2009-03-13 07:05:43 +00:00
Owen Anderson d37ddf5b5b Convert VirtRegMap to a MachineFunctionPass.
llvm-svn: 66870
2009-03-13 05:55:11 +00:00
Chris Lattner 99cc133710 generalize the previous code to use the full generality of LEA
for i32/i64 expressions (we could also do i16 on cpus where
i16 lea is fast, but I didn't add this).  On the example, we now
generate:

_test:
	movl	4(%esp), %eax
	cmpl	$42, (%eax)
	setl	%al
	movzbl	%al, %eax
	leal	4(%eax,%eax,8), %eax
	ret

instead of:

_test:
	movl	4(%esp), %eax
	cmpl	$41, (%eax)
	movl	$4, %ecx
	movl	$13, %eax
	cmovg	%ecx, %eax
	ret

llvm-svn: 66869
2009-03-13 05:53:31 +00:00
Chris Lattner 4be6df5d86 optimize the case of cond ? 42 : 41 and friends. This compiles the
example to:

_test:
	movl	4(%esp), %eax
	cmpl	$41, (%eax)
	setg	%al
	movzbl	%al, %eax
	orl	$4294967294, %eax
	ret

instead of:

        movl    4(%esp), %eax
        cmpl    $41, (%eax)
	movl	$4294967294, %ecx
	movl	$4294967295, %eax
	cmova	%ecx, %eax
	ret

which is smaller in code size and faster. rdar://6668608

llvm-svn: 66868
2009-03-13 05:22:11 +00:00
Bill Wendling fa54bc2052 Oops...I committed too much.
llvm-svn: 66867
2009-03-13 04:39:26 +00:00