Victor Hernandez
2b17e2a452
Avoid extra calls to MD->getNumOperands()
...
llvm-svn: 94618
2010-01-26 23:29:09 +00:00
Evan Cheng
75766332f9
Ignore 'forced' tailcall opt in fastisel mode.
...
llvm-svn: 94617
2010-01-26 23:28:40 +00:00
Chris Lattner
56e9b5975d
remove a noop function.
...
llvm-svn: 94616
2010-01-26 23:26:29 +00:00
Jakob Stoklund Olesen
0234628284
Fix inline cost predictions with SCIENCE.
...
After running a batch of measurements, it is clear that the inliner metrics
need some adjustments:
Own argument bonus: 20 -> 5
Outgoing argument penalty: 0 -> 5
Alloca bonus: 10 -> 5
Constant instr bonus: 7 -> 5
Dead successor bonus: 40 -> 5*(avg instrs/block)
The new cost metrics are generaly 25 points higher than before, so we may need
to move thresholds.
With this change, InlineConstants::CallPenalty becomes a political correction:
if (!isa<IntrinsicInst>(II) && !callIsSmall(CS.getCalledFunction()))
NumInsts += InlineConstants::CallPenalty + CS.arg_size();
The code size is accurately modelled by CS.arg_size(). CallPenalty is added
because calls tend to take a long time, so it may not be worth it to inline a
function with lots of calls.
All of the political corrections are in the InlineConstants namespace:
IndirectCallBonus, CallPenalty, LastCallToStaticBonus, ColdccPenalty,
NoreturnPenalty.
llvm-svn: 94615
2010-01-26 23:21:56 +00:00
Chris Lattner
c7b91156e4
now that enough stuff is constified, move function header printing
...
logic up from X86 into the common code. The other targets will
hopefully start using this soon.
llvm-svn: 94614
2010-01-26 23:18:44 +00:00
Chris Lattner
76555b513c
constify a bunch of dwarf stuff now that the registerinfo method
...
is constified.
llvm-svn: 94613
2010-01-26 23:18:02 +00:00
Chris Lattner
f13e5f7323
constify a method argument.
...
llvm-svn: 94612
2010-01-26 23:15:09 +00:00
Evan Cheng
c35b5a123b
Allow some automatic tailcall optimization without changing ABI.
...
llvm-svn: 94611
2010-01-26 23:13:04 +00:00
Evan Cheng
1b7b9e852c
Delete blank lines that bug me.
...
llvm-svn: 94610
2010-01-26 23:07:57 +00:00
Ted Kremenek
6296e0990b
Move 'LocalCheckers.h' to the 'Checkers' subdirectory.
...
llvm-svn: 94609
2010-01-26 22:59:55 +00:00
Ted Kremenek
b29faead69
Move 'include/Checkers/PathSensitive/Checkers' directory to 'include/Checkers'.
...
llvm-svn: 94608
2010-01-26 22:56:15 +00:00
Fariborz Jahanian
d59baba9fd
Patch to add 'volatile' to first argument of all
...
sync compare_and_swap to match them with gcc.
It also fixes a few incorrect argument defitions.
(fixes radar 7540291).
llvm-svn: 94607
2010-01-26 22:48:42 +00:00
Mike Stump
ded0a406b4
Refine the non-virtual this adjustments for thunks by using the offset
...
to the declaring class from the nearest virtual base class. WIP.
llvm-svn: 94606
2010-01-26 22:44:01 +00:00
Chris Lattner
3ba6da49f5
call emitconstantpool and emitjumptable like other targets.
...
llvm-svn: 94601
2010-01-26 22:06:58 +00:00
Devang Patel
670ca2bcbf
Before existing NamedMDNode entry in the symbol table, remove any existing entry with the same name.
...
llvm-svn: 94600
2010-01-26 22:03:41 +00:00
Sebastian Redl
833ef45b1d
Bring some semblance of order into Decl.h and Decl.cpp. While at it, fix some typo comments and remove an unused and unimplemented function prototype. No functionality change.
...
llvm-svn: 94599
2010-01-26 22:01:41 +00:00
Chris Lattner
b657c4cdc3
emit jump table an alias ".set" directives through MCStreamer as
...
assignments.
.set x, a-b
is the same as:
x = a-b
llvm-svn: 94596
2010-01-26 21:53:08 +00:00
Chris Lattner
37bc78a5e2
fix CastInst::castIsValid to reject aggregate types, fixing PR6153:
...
llvm-as: t.ll:1:25: error: invalid cast opcode for cast from '[4 x i8]' to '[1 x i32]'
@x = constant [1 x i32] bitcast ([4 x i8] c"abcd" to [1 x i32])
^
llvm-svn: 94595
2010-01-26 21:51:43 +00:00
Devang Patel
74da6a0480
Remve unnecessary include.
...
llvm-svn: 94594
2010-01-26 21:42:58 +00:00
Devang Patel
1973df2e3f
Use AssertingVH, just to be paranoid.
...
llvm-svn: 94593
2010-01-26 21:39:14 +00:00
Mike Stump
a04ecfb701
Refine the non-virtual this adjustments for thunks by using the offset
...
to the declaring class from the nearest virtual base class. WIP.
This fixes 40% of all the problems remaining in one of my testcases.
llvm-svn: 94592
2010-01-26 21:35:27 +00:00
Jakob Stoklund Olesen
87256d8fe1
Revert test polarity to match comment and desired outcome. Remove undeserved bonus.
...
A GEP with all constant indices is already considered free by
analyzeBasicBlock(), so don't give it an extra bonus in
CountCodeReductionForAlloca().
This patch should remove a small positive bias toward inlining functions with
variable-index GEPs, and remove a smaller negative bias from functions with
all-constant index GEPs.
llvm-svn: 94591
2010-01-26 21:31:35 +00:00
Jakob Stoklund Olesen
832e79ca32
Remove dead code.
...
Functions containing indirectbr are marked NeverInline by analyzeBasicBlock(),
so there is no point in giving indirectbr special treatment in
CountCodeReductionForConstant. It is never called.
No functional change intended.
llvm-svn: 94590
2010-01-26 21:31:30 +00:00
Jakob Stoklund Olesen
cab470b17a
Skip calculation of ArgumentWeights if it will never be used.
...
Save a few bytes by allocating the correct size vector.
No functional change intended.
llvm-svn: 94589
2010-01-26 21:31:24 +00:00
Devang Patel
303a1beea6
Emit DW_AT_containing_type attribute for a class if containing type is known.
...
llvm-svn: 94587
2010-01-26 21:16:06 +00:00
Devang Patel
f4b25d6d7b
Add extra element to composite type. This new element will be used to record c++ class that holds current class's vtable.
...
llvm-svn: 94586
2010-01-26 21:14:59 +00:00
Chris Lattner
ff234e09b9
Eliminate SetDirective, and replace it with HasSetDirective.
...
Default HasSetDirective to true, since most targets have it.
The targets that claim to not have it probably do, or it is
spelled differently. These include Blackfin, Mips, Alpha, and
PIC16. All of these except pic16 are normal ELF targets, so
they almost certainly have it.
llvm-svn: 94585
2010-01-26 20:40:54 +00:00
Fariborz Jahanian
f0ed69cb5b
Added assert to the rewrite.
...
llvm-svn: 94584
2010-01-26 20:37:44 +00:00
Evan Cheng
345ec3166e
Delete dead code.
...
llvm-svn: 94583
2010-01-26 20:36:21 +00:00
Rafael Espindola
dcb03f0f6b
Emit .comm alignment in bytes but .align in powers of 2 for ARM ELF.
...
Original patch by Sandeep Patel and updated by me.
llvm-svn: 94582
2010-01-26 20:21:43 +00:00
Chris Lattner
3dd38a8112
eliminate MCAsmInfo::NeedsSet: we now just use .set on any platform
...
that has it.
llvm-svn: 94581
2010-01-26 20:20:43 +00:00
Chris Lattner
526f560424
don't set to the default value.
...
llvm-svn: 94580
2010-01-26 20:17:34 +00:00
Ken Dyck
7df3cbeb01
Convert one last size variable to CharUnits (follow-on to 94577).
...
llvm-svn: 94579
2010-01-26 19:59:28 +00:00
Junjie Gu
6b0888a07d
test commit.
...
llvm-svn: 94578
2010-01-26 19:45:17 +00:00
Ken Dyck
3eb55cfe8a
Use CharUnits for sizes, offsets, alignments, and padding amounts for values
...
that are in character units.
llvm-svn: 94577
2010-01-26 19:44:24 +00:00
Douglas Gregor
64213261b4
Fix typo in comment
...
llvm-svn: 94576
2010-01-26 19:43:43 +00:00
Ted Kremenek
0b86e3a72d
Implement 'clang_getInclusions()' in CIndex. This API allows clients to walk the set of files included in a translation unit via the C API.
...
llvm-svn: 94575
2010-01-26 19:31:51 +00:00
Dan Gohman
80386c10d4
-disable-output is no longer needed with -analyze.
...
llvm-svn: 94574
2010-01-26 19:25:59 +00:00
Douglas Gregor
9bd6db5834
Eliminate clang_getInstantiationLocationOffset(), and instead add an
...
offset parameter to clang_getInstantiationLocation().
llvm-svn: 94573
2010-01-26 19:19:08 +00:00
Dan Gohman
85be4333ad
Make the unsigned-range code more consistent with the signed-range code,
...
and clean up some loose ends.
llvm-svn: 94572
2010-01-26 19:19:05 +00:00
Ken Dyck
5262b11962
Use CharUnits for alignments in character units.
...
llvm-svn: 94571
2010-01-26 19:13:33 +00:00
Evan Cheng
8703c412f4
Code refactoring, no functionality change.
...
llvm-svn: 94570
2010-01-26 19:04:47 +00:00
Bob Wilson
9c71bb03f3
Revert 94484. Re-disable unittests that need RTTI.
...
llvm-svn: 94569
2010-01-26 19:04:37 +00:00
Victor Hernandez
9ecd2f039f
Switch AllocaDbgDeclares to SmallVector and don't leak DIFactory
...
llvm-svn: 94567
2010-01-26 18:57:53 +00:00
Sebastian Redl
497c0a418d
Fix two redefinitions in test cases that weren't diagnosed yet, but will be soon.
...
llvm-svn: 94565
2010-01-26 18:52:33 +00:00
Ken Dyck
a0f99ff230
Use CharUnits for alignment of UTF16 string in GetAddrOfConstantCFString().
...
llvm-svn: 94564
2010-01-26 18:46:23 +00:00
Ken Dyck
e5402e4749
Use CharUnits for alignment in EmitNullInitializationLValue().
...
llvm-svn: 94563
2010-01-26 18:35:11 +00:00
Dan Gohman
a01418d75a
Fix a typo in a comment that Duncan noticed.
...
llvm-svn: 94562
2010-01-26 18:32:54 +00:00
Douglas Gregor
6165611986
Implement clang_annotateTokens(), which associates cursors with each
...
of the tokens within a raw token stream. This does not even attempt to
handle macros yet.
llvm-svn: 94561
2010-01-26 18:31:56 +00:00
Dan Gohman
1c7e3837fb
Remove SIL, DIL, and BPL from the GR8_NOREX allocation order also.
...
llvm-svn: 94560
2010-01-26 18:30:24 +00:00