Commit Graph

71884 Commits

Author SHA1 Message Date
Rafael Espindola 7c7151512c Add an alternative implementation of CIE and FDE emission that outputs them
in the same order as the one in CodeGen.

llvm-svn: 130471
2011-04-29 02:42:28 +00:00
Nick Lewycky 61aed87a49 Rename profile_rt.so to libprofile_rt.so under configure+make (it already was
under cmake).

Add libprofile_rt.a so that we can tell clang to link against it in --coverage
mode. Also turn it on by default in cmake builds.

Oscar, this touches a change you made for EXCLUDE_FROM_ALL support -- I think
I've done the right thing, but please let me know (or fix and commit) if not!

llvm-svn: 130470
2011-04-29 02:12:06 +00:00
Eric Christopher 9ade5e2495 Update comments and checks to match reality.
llvm-svn: 130464
2011-04-29 00:07:20 +00:00
Eric Christopher 501d2e2c14 Whitespace.
llvm-svn: 130463
2011-04-29 00:03:10 +00:00
Eli Friedman 517728b1ae Revert r130454; apparently this doesn't actually work.
llvm-svn: 130462
2011-04-28 23:55:14 +00:00
Eli Friedman 37b9ede969 Fix runline.
llvm-svn: 130455
2011-04-28 23:12:24 +00:00
Eli Friedman e4ecd42926 Fix a rather obscure crash caused by ARM fast-isel generating code which redefines a register.
rdar://problem/9338332 .

llvm-svn: 130454
2011-04-28 23:03:25 +00:00
Devang Patel 80d1d3aaec Preserve line number information.
llvm-svn: 130450
2011-04-28 22:48:14 +00:00
Matt Beaumont-Gay c99298ab5e Coalesce some DEBUGs (moving an only-used-in-DEBUG variable's declaration into the DEBUG)
llvm-svn: 130448
2011-04-28 22:26:05 +00:00
Benjamin Kramer cf9d1ad62e We require threse bits to be zero, too.
This shouldn't happen in practice because the icmp would be a constant.
Add a check so we don't miscompile code if something goes wrong.

llvm-svn: 130446
2011-04-28 21:38:51 +00:00
Nick Lewycky 6aa79492a5 Only read *predecessor once so as to fix a theoretical issue where it changes
between two reads (threading).

Fix an off-by-one in the indirect counter table that I meant to revert after an
earlier experiment. Whoops!

Implement GCOV_PREFIX. Doesn't handle GCOV_PREFIX_STRIP yet.

Fix an off-by-one in string emission. Extra whoops!

Tolerate DISubprograms that have null Function*'s attached to them. I don't yet
understand what this means, but it happens when you have a global static with
a non-trivial constructor/destructor.

Fix a crash on switch statements with a single successor (default-only).

llvm-svn: 130443
2011-04-28 21:35:49 +00:00
Daniel Dunbar a86188bf8e Target/X86/MC: Add an option for disabling arith relaxation, for my own testing
purposes.

llvm-svn: 130438
2011-04-28 21:23:31 +00:00
Rafael Espindola 6bd6a70837 Add the getExprForFDESymbol method that responsible for computing the
expressions used in the FDE to refer to symbols.

llvm-svn: 130437
2011-04-28 21:04:39 +00:00
Devang Patel d36bdb5208 Beautify debug info probe output.
llvm-svn: 130435
2011-04-28 20:46:18 +00:00
Ted Kremenek e203bbb47e Add MemoryBuffer::getBufferKind() to report whether a memory buffer uses malloc'ed or mmap'ed memory. This is for performance analysis.
llvm-svn: 130432
2011-04-28 20:34:18 +00:00
Devang Patel 72aa1a8a68 Remove DbgDeclare only if all uses are converted.
llvm-svn: 130431
2011-04-28 20:32:02 +00:00
Lenny Maiorani 367342e209 Remove bounded StringRef::compare() since nothing but Clang SA was using it and it is just as easy to use StringRef::substr() preceding StringRef::compare() to achieve the same thing.
llvm-svn: 130430
2011-04-28 20:20:12 +00:00
Eli Friedman 7cd5101ad3 fast-isel sret calls, try 2. We actually do need to do something on x86-32. rdar://problem/9303592 .
llvm-svn: 130429
2011-04-28 20:19:12 +00:00
Benjamin Kramer 101720fb58 Fix a comment.
llvm-svn: 130428
2011-04-28 20:09:57 +00:00
Chris Lattner a5452c0d67 improve comment.
llvm-svn: 130426
2011-04-28 20:02:57 +00:00
Devang Patel 33d87d97f6 Do not lose line number info while eliminating tail call.
llvm-svn: 130419
2011-04-28 18:43:39 +00:00
Eli Friedman 3cf6d4032a Actually revert r130348 correctly.
llvm-svn: 130418
2011-04-28 18:20:24 +00:00
Chris Lattner 1777601a74 final step needed to resolve PR6627, which allows us to flatten the code down to
a nice and tidy:
  %x1 = load i32* %0, align 4
  %1 = icmp eq i32 %x1, 1179403647
  br i1 %1, label %if.then, label %if.end

instead of doing lots of loads and branches.  May the FreeBSD bootloader
long fit in its allocated space.

llvm-svn: 130416
2011-04-28 18:15:47 +00:00
Chris Lattner 45e393fc9c code cleanups only.
llvm-svn: 130414
2011-04-28 18:08:21 +00:00
Eli Friedman d5a80ca3c8 Revert r130348; causing buildbot issues on x86-32.
llvm-svn: 130412
2011-04-28 18:06:10 +00:00
Owen Anderson 715973fc6c Fix a bug in tblgen that caused incorrect encodings on instructions that specified operands with "bit" instead of "bits<1>".
Unfortunately, my only testcase for this is fragile, and the ARM AsmParser can't round trip the instruction in question.
<rdar://problem/9345702>

llvm-svn: 130410
2011-04-28 17:51:45 +00:00
Devang Patel b63596436f Add command line option to print debug info in human readable form as comment in llvm IR output. This, i.e -enable-debug-info-comment, is very useful if you want to easily find out which optimization pass is losing line number information.
llvm-svn: 130409
2011-04-28 17:41:38 +00:00
Andrew Trick c4456ae6ec Reapply r130340: Fix for PR9730.
llvm-svn: 130408
2011-04-28 17:30:04 +00:00
Benjamin Kramer 4145c0d3b1 InstCombine: Merge "(trunc x) == C1 & (and x, CA) == C2" into a single and+icmp.
This happens when GVN widens loads. Part of PR6627.

llvm-svn: 130405
2011-04-28 16:58:40 +00:00
Eric Christopher 4f012fd0a1 Be more layout aware here and swap the successor and branch condition
if it means we get a fallthrough.

llvm-svn: 130404
2011-04-28 16:52:09 +00:00
Chris Lattner f81f789b6c centralize "marking for deletion" into a helper function. Pass GVN around to
static functions instead of passing around tons of random ivars.

llvm-svn: 130403
2011-04-28 16:36:48 +00:00
Chris Lattner 6cec6ab275 Promote toErase to be an ivar of the GVN class.
llvm-svn: 130401
2011-04-28 16:18:52 +00:00
Rafael Espindola c5dac4df2e Add a getExprForPersonalitySymbol method to MCAsmInfo. Use it when
converting the symbol passed to .cfi_personality into bytes is the file.

llvm-svn: 130400
2011-04-28 16:09:09 +00:00
Rafael Espindola 349c3298da Mark the EH symbol global or weak if the corresponding function is.
llvm-svn: 130397
2011-04-28 12:50:37 +00:00
Jay Foad 07ef11112e Fix typos in comments.
llvm-svn: 130396
2011-04-28 09:12:47 +00:00
Chandler Carruth 93da3c8233 Fix the last -Wnon-pod-memset I'm seeing. This is benign, but appears
a bit more sinister as the memset doesn't do what the constructor does.
There seems to be a cleaner solution than a cast here though, instead we
can point the memset destination into the union its actually trying to
clear.

An alternative is to point to the Untyped member of this union. Review
appreciated, and if that is cleaner I'm happy to switch. All of these
should be functionally equivalent to the original code.

llvm-svn: 130395
2011-04-28 08:37:18 +00:00
Chandler Carruth 3f7b581e2f Revert an unintended commit. Very sorry for this one.
llvm-svn: 130393
2011-04-28 08:18:22 +00:00
Chandler Carruth 0c2bef1716 Fix more -Wnon-pod-memset warnings.
llvm-svn: 130392
2011-04-28 08:17:08 +00:00
Chandler Carruth e63a7b21f6 nuke gold
llvm-svn: 130391
2011-04-28 08:17:05 +00:00
Chris Lattner 827a270a2a teach GVN to widen integer loads when they are overaligned, when doing an
wider load would allow elimination of subsequent loads, and when the wider
load is still a native integer type.  This eliminates a ton of loads on 
various benchmarks involving struct fields, though it is somewhat hobbled
by clang not being very aggressive about field alignment.

This is yet another step along the way towards resolving PR6627.

llvm-svn: 130390
2011-04-28 07:29:08 +00:00
Eric Christopher a98cd22d96 Let the immediate leaf pattern take transforms and switch the signed
immediate patterns in arm to using the pattern.

Handles rdar://9299434

llvm-svn: 130386
2011-04-28 05:49:04 +00:00
Chris Lattner 2a75c72e1c move PR9803 to this readme.
llvm-svn: 130385
2011-04-28 05:33:16 +00:00
Ted Kremenek 2901731553 Add utility method to DenseMap to return the amount of memory used for its buckets.
llvm-svn: 130382
2011-04-28 04:52:57 +00:00
Rafael Espindola 2eeee8cfef Add a small temporary hack for producing identical eh_frame sections on OS X.
This removes one of the main advantages of moving eh_frame to MC, but
makes the transition a lot easier to debug (run md5).

llvm-svn: 130379
2011-04-28 04:04:14 +00:00
Rafael Espindola bf60fb0a37 Produce the EH_frame# symbols if needed.
llvm-svn: 130378
2011-04-28 03:26:11 +00:00
Rafael Espindola 96b07932a3 Forward isFunctionEHFrameSymbolPrivate. If it is false, produce the foo.eh
symbols.

llvm-svn: 130375
2011-04-28 02:46:42 +00:00
Devang Patel 3e021533cd Teach dwarf writer to handle complex address expression for .debug_loc entries.
This fixes clang generated blocks' variables' debug info.
Radar 9279956.

llvm-svn: 130373
2011-04-28 02:22:40 +00:00
Chris Lattner 22e6c10256 silence some -Wnon-pod-memset warnings, since std::pair is not POD.
llvm-svn: 130364
2011-04-28 00:55:53 +00:00
Eli Friedman 33c133919a Fix a silly mistake in r130338.
llvm-svn: 130360
2011-04-28 00:42:03 +00:00
Justin Holewinski 45c30df303 PTX: support for select_cc and fixes for setcc
- expansion of SELECT_CC into SETCC
- force SETCC result type to i1
- custom selection for handling i1 using SETCC

Patch by Dan Bailey

llvm-svn: 130358
2011-04-28 00:19:56 +00:00
Justin Holewinski 498f703d84 PTX: support for select
- selection of SELP instruction
- new selp.ll test

Patch by Dan Bailey

llvm-svn: 130357
2011-04-28 00:19:55 +00:00
Justin Holewinski e7d272e68b PTX: mov fix and rounding correction for cvt
- fix typo in MOV
- correct fp rounding on CVT
- new cvt.ll test

Patch by Dan Bailey

llvm-svn: 130356
2011-04-28 00:19:54 +00:00
Justin Holewinski f6880019d1 PTX: support for fneg
- selection of FNEG instruction
- new fneg.ll test

Patch by Dan Bailey

llvm-svn: 130355
2011-04-28 00:19:53 +00:00
Justin Holewinski 99e03f1943 PTX: support for zext loads and trunc stores
- expansion of EXTLOAD and TRUNCSTORE instructions

Patch by Dan Bailey

llvm-svn: 130354
2011-04-28 00:19:52 +00:00
Justin Holewinski 18e6ac83ea PTX: support for bitwise operations on predicates
- selection of bitwise preds (AND, OR, XOR)
- new bitwise.ll test

Patch by Dan Bailey

llvm-svn: 130353
2011-04-28 00:19:51 +00:00
Justin Holewinski 638f0eb116 PTX: patch to AsmPrinter
- immediate value cast as long not int
- handles initializer for constant array

Patch by Dan Bailey

llvm-svn: 130352
2011-04-28 00:19:50 +00:00
Andrew Trick 1e34241abd Reverting r130340 in the unlikely event that it's responsible for a llvm-gcc stage2 compiler error.
llvm-svn: 130350
2011-04-28 00:13:59 +00:00
Eli Friedman 8bd572fc58 fast-isel sret. We actually don't need to do anything special on x86. :) rdar://problem/9303592 .
llvm-svn: 130348
2011-04-27 23:58:52 +00:00
Johnny Chen c3c7001844 Add tests for A8.6.110 NOP.
llvm-svn: 130345
2011-04-27 23:29:21 +00:00
Rafael Espindola ce83fc3463 Remove unnecessary argument.
llvm-svn: 130343
2011-04-27 23:17:57 +00:00
Rafael Espindola 08704349da Rename getPersonalityPICSymbol to getCFIPersonalitySymbol, document it, and
give it a bit more responsibility. Also implement it for MachO.

If hacked to use cfi, 32 bit MachO will produce

.cfi_personality 155, L___gxx_personality_v0$non_lazy_ptr

and 64 bit will produce

.cfi_presonality ___gxx_personality_v0

The general idea is that .cfi_personality gets passed the final symbol. It is
up to codegen to produce it if using indirect representation (like 32 bit
MachO), but it is up to MC to decide which relocations to create.

llvm-svn: 130341
2011-04-27 23:08:15 +00:00
Andrew Trick 29ac7b8858 Fixes PR9730: indvars: An asserting value handle still pointed to this value
Modified LinearFunctionTestReplace to push the condition on the dead
list instead of eagerly deleting it. This can cause unnecessary
IV rewrites, which should have no effect on codegen and will not be an
issue once we stop generating canonical IVs.

llvm-svn: 130340
2011-04-27 23:00:03 +00:00
Devang Patel 77dc541b00 Simplify handling of variables with complex address (i.e. blocks variables)
llvm-svn: 130339
2011-04-27 22:45:24 +00:00
Eli Friedman 406c471b69 Make the fast-isel code for literal 0.0 a bit shorter/faster, since 0.0 is common. rdar://problem/9303592 .
llvm-svn: 130338
2011-04-27 22:41:55 +00:00
Eli Friedman 121d27e9e4 Remove unused function.
llvm-svn: 130337
2011-04-27 22:21:02 +00:00
NAKAMURA Takumi 8513d4236c docs/doxygen.css: Tweak style for readability.
A few styles are brought from http://llvm.org/test-doxygen/api/api.css

llvm-svn: 130333
2011-04-27 21:53:35 +00:00
Rafael Espindola 3989776770 Fix indentation.
llvm-svn: 130331
2011-04-27 21:29:52 +00:00
Kevin Enderby 886894cb70 Fix a bug in the case that there is no add or subtract symbol and the offset
value is zero so it does not add a NULL expr operand.

llvm-svn: 130330
2011-04-27 21:02:27 +00:00
Dan Gohman 5394c70d1e Teach BasicAA about arm.neon.vld1 and vst1.
llvm-svn: 130327
2011-04-27 20:44:28 +00:00
Devang Patel e3745fdcf3 Revert r130178. It turned out to be not the optimal path to emit complex location expressions.
llvm-svn: 130326
2011-04-27 20:29:27 +00:00
Evan Cheng 9808d31b9e If converter was being too cute. It look for root BBs (which don't have
successors) and use inverse depth first search to traverse the BBs. However
that doesn't work when the CFG has infinite loops. Simply do a linear
traversal of all BBs work just fine.

rdar://9344645

llvm-svn: 130324
2011-04-27 19:32:43 +00:00
Dan Gohman 39b3a1ef7f When analyzing functions known to only access argument pointees,
only check arguments with pointer types. Update the documentation
of IntrReadArgMem reflect this.

While here, add support for TBAA tags on intrinsic calls.

llvm-svn: 130317
2011-04-27 18:39:03 +00:00
Andrew Trick 7d1eea86d9 Corrects an old, old typo in a case that doesn't seem to be reached in practice.
llvm-svn: 130316
2011-04-27 18:17:36 +00:00
Devang Patel 12bf0ab4b5 Simplify cfg inserts a call to trap when unreachable code is detected. Assign DebugLoc to this new trap instruction.
llvm-svn: 130315
2011-04-27 17:59:27 +00:00
Jakob Stoklund Olesen 71d3b895ba Also add <imp-def> operands for defined and dead super-registers when rewriting.
We cannot rely on the <imp-def> operands added by LiveIntervals in all cases as
demonstrated by the test case.

llvm-svn: 130313
2011-04-27 17:42:31 +00:00
Rafael Espindola 27c0c9bb87 Factor a bit of code to MCStreamer::EmitLabel. Keep track of the last
non private symbol. This will be use for handling

foo:
  .cfi_startproc
  ...

On OS X where we have to create a foo.eh symbol.

llvm-svn: 130305
2011-04-27 15:21:19 +00:00
Duncan Sands 085ad3b81a Stop trying to have instcombine preserve LCSSA form: this was not
effective in avoiding recomputation of LCSSA form; the widespread
use of instsimplify (which looks through phi nodes) means it was
not preserving LCSSA form anyway; and instcombine is no longer
scheduled in the middle of the loop passes so this doesn't matter
anymore.

llvm-svn: 130301
2011-04-27 10:55:12 +00:00
Andrew Trick 01eff820ae Test case and comment for PR9633.
llvm-svn: 130294
2011-04-27 05:42:17 +00:00
Nick Lewycky 6fac9bcf67 Use static inline to do the right thing when built in C99 mode. Of course,
C89 doesn't have an inline keyword.

llvm-svn: 130279
2011-04-27 03:22:17 +00:00
Eli Friedman bcc6914146 Refactor out code to fast-isel a memcpy operation with a small constant
length.  (I'm planning to use this to implement byval.)

llvm-svn: 130274
2011-04-27 01:45:07 +00:00
Rafael Espindola ae124da625 Force some values to be absolute and align based on the FDE pointers size. A small
step towards using .cfi_* on OS X.

llvm-svn: 130273
2011-04-27 01:43:49 +00:00
Eli Friedman 0eea0293d9 Fix an edge case involving branches in fast-isel on x86.
rdar://problem/9303306 .

llvm-svn: 130272
2011-04-27 01:34:27 +00:00
Andrew Trick 759ba0802d Fix for PR9633 [indvars] Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Added a type check in ScalarEvolution::computeSCEVAtScope to handle the case in which operands of an
AddRecExpr in the current scope are folded.

llvm-svn: 130271
2011-04-27 01:21:25 +00:00
Chris Lattner 7aab2799ae Enhance memdep to return clobber relation between noalias loads when
an earlier load could be widened to encompass a later load.  For example,
if we see:

  X = load i8* P, align 4
  Y = load i8* (P+3), align 1

and we have a 32-bit native integer type, we can widen the former load
to i32 which then makes the second load redundant.  GVN can't actually
do anything with this load/load relation yet, so this isn't testable, but 
it is the next step to resolving PR6627, and a fairly general class of 
"merge neighboring loads" missed optimizations.

llvm-svn: 130250
2011-04-26 22:42:01 +00:00
Jakob Stoklund Olesen eef2327360 Add a safe-guard against repeated splitting for some rare cases.
The number of blocks covered by a live range must be strictly decreasing when
splitting, otherwise we can't allow repeated splitting.

llvm-svn: 130249
2011-04-26 22:33:12 +00:00
Chris Lattner 32dc9bd1bb use AA::isMustAlias to simplify some calls.
llvm-svn: 130248
2011-04-26 21:53:34 +00:00
Chris Lattner 6b96621a8a remove support for llvm.invariant.end from memdep. It is a
work-in-progress that is not progressing, and it has issues.

llvm-svn: 130247
2011-04-26 21:50:51 +00:00
Evan Cheng 1355bbdd11 Be careful about scheduling nodes above previous calls. It increase usages of
more callee-saved registers and introduce copies. Only allows it if scheduling
a node above calls would end up lessen register pressure.

Call operands also has added ABI restrictions for register allocation, so be
extra careful with hoisting them above calls.

rdar://9329627

llvm-svn: 130245
2011-04-26 21:31:35 +00:00
Evan Cheng dbb86b8108 This test should be in MC. It breaks with changes to scheduling / register allocation so it's being removed.
llvm-svn: 130243
2011-04-26 21:09:04 +00:00
Chris Lattner 029afe4787 make a couple of changes to the standard pass pipeline:
1. Only run the early (in the module pass pipe) instcombine/simplifycfg
   if the "unit at a time" passes they are cleaning up after runs.

2. Move the "clean up after the unroller" pass to the very end of the
   function-level pass pipeline.  Loop unroll uses instsimplify now,
   so it doesn't create a ton of trash.  Moving instcombine later allows
   it to clean up after opportunities are exposed by GVN, DSE, etc.

3. Introduce some phase ordering tests for things that are specifically
   intended to be simplified by the full optimizer as a whole.

This resolves PR2338, and is progress towards PR6627, which will be 
generating code that looks similar to test2.

llvm-svn: 130241
2011-04-26 20:45:33 +00:00
Chris Lattner 1b06c71668 Transform: "icmp eq (trunc (lshr(X, cst1)), cst" to "icmp (and X, mask), cst"
when X has multiple uses.  This is useful for exposing secondary optimizations,
but the X86 backend isn't ready for this when X has a single use.  For example,
this can disable load folding.

This is inching towards resolving PR6627.

llvm-svn: 130238
2011-04-26 20:18:20 +00:00
Chris Lattner 31b106d7dd some random cleanups, no functionality change.
llvm-svn: 130237
2011-04-26 20:02:45 +00:00
Chris Lattner 6320840583 add an m_ConstantInt matching predicate that binds to a uint64_t, and add an m_OneUse()
predicate that matches if the subexpr has a single use.

llvm-svn: 130235
2011-04-26 19:50:39 +00:00
Jim Grosbach d4b733e4d8 ARM and Thumb2 support for atomic MIN/MAX/UMIN/UMAX loads.
rdar://9326019

llvm-svn: 130234
2011-04-26 19:44:18 +00:00
Rafael Espindola a4fa5ce911 Print the label if we will use it in debug_frame.
llvm-svn: 130232
2011-04-26 19:26:53 +00:00
Devang Patel ba5fbf17df Refactor code. Keep dwarf register operation selection logic at one place.
llvm-svn: 130231
2011-04-26 19:06:18 +00:00
Jakob Stoklund Olesen 3b7b7bcc7f Use the new TRI->getLargestLegalSuperClass hook to constrain register class inflation.
This has two effects: 1. We never inflate to a larger register class than what
the sub-target can handle. 2. Completely unconstrained virtual registers get the
largest possible register class.

llvm-svn: 130229
2011-04-26 18:52:36 +00:00
Jakob Stoklund Olesen 803a200077 Add a TRI::getLargestLegalSuperClass hook to provide an upper limit on register class inflation.
The hook will be used by the register allocator when recomputing register
classes after removing constraints.

Thumb1 code doesn't allow anything larger than tGPR, and x86 needs to ensure
that the spill size doesn't change.

llvm-svn: 130228
2011-04-26 18:52:33 +00:00
Benjamin Kramer 1d4c835089 Force a triple on this test to unbreak windows buildbots.
llvm-svn: 130226
2011-04-26 18:47:43 +00:00
Devang Patel b5ea255fb4 Fix an off by one error while accessing complex address element of a DIVariable.
This worked untill now because stars are aligned (i.e. num of complex address elments are always 0 or 2+ and when it is 2+ at least two elements are access together)

llvm-svn: 130225
2011-04-26 18:24:39 +00:00
Chris Lattner eb045f9c02 Improve the bail-out predicate to really only kick in when phi
translation fails.  We were bailing out in some cases that would
cause us to miss GVN'ing some non-local cases away.

llvm-svn: 130206
2011-04-26 17:41:02 +00:00
Dan Gohman 7da91aee83 Fast-isel support for simple inline asms.
llvm-svn: 130205
2011-04-26 17:18:34 +00:00
Oscar Fuentes 638aaecc4d Honor LLVM_BUILD_RUNTIME.
llvm-svn: 130199
2011-04-26 14:55:27 +00:00
Rafael Espindola 580eebaa20 Add test for PR9743.
llvm-svn: 130198
2011-04-26 14:17:42 +00:00
Duncan Sands d4ea3ec87f Another example of a static table that wasn't marked static.
llvm-svn: 130193
2011-04-26 07:30:10 +00:00
Chris Lattner 189ca1498f don't emit the symbol name twice for local bss and common
symbols.  For example, don't emit:
        .comm   _i,4,2                  ## @i
                                        ## @i

instead emit:
        .comm   _i,4,2                  ## @i

llvm-svn: 130192
2011-04-26 06:14:13 +00:00
Nick Lewycky 68d2218978 Add cmakefiles to build profile_rt.so!
llvm-svn: 130191
2011-04-26 05:48:41 +00:00
Evan Cheng 2f64754031 Fix typo
llvm-svn: 130190
2011-04-26 04:57:37 +00:00
Rafael Espindola 80cb3cb1d6 Print all the moves at a given label instead of just the first one.
Remove previous DwarfCFI hack.

llvm-svn: 130187
2011-04-26 03:58:56 +00:00
Nick Lewycky c58d293a6f Rename everything to follow LLVM style ... I think.
Add support for switch and indirectbr edges. This works by densely numbering
all blocks which have such terminators, and then separately numbering the
possible successors. The predecessors write down a number, the successor knows
its own number (as a ConstantInt) and sends that and the pointer to the number
the predecessor wrote down to the runtime, who looks up the counter in a
per-function table.

Coverage data should now be functional, but I haven't tested it on anything
other than my 2-file synthetic test program for coverage.

llvm-svn: 130186
2011-04-26 03:54:16 +00:00
Rafael Espindola 3584ab6cc6 No relocation produces a SLEB or ULEB, make sure they are handled in MC.
llvm-svn: 130181
2011-04-26 02:17:58 +00:00
Chris Lattner 6f83d06ffa Enhance MemDep: When alias analysis returns a partial alias result,
return it as a clobber.  This allows GVN to do smart things.

Enhance GVN to be smart about the case when a small load is clobbered
by a larger overlapping load.  In this case, forward the value.  This
allows us to compile stuff like this:

int test(void *P) {
  int tmp = *(unsigned int*)P;
  return tmp+*((unsigned char*)P+1);
}

into:

_test:                                  ## @test
	movl	(%rdi), %ecx
	movzbl	%ch, %eax
	addl	%ecx, %eax
	ret

which has one load.  We already handled the case where the smaller
load was from a must-aliased base pointer.

llvm-svn: 130180
2011-04-26 01:21:15 +00:00
Devang Patel cae2fbd6fc Let dwarf writer allocate extra space in the debug location expression. This space, if requested, will be used for complex addresses of the Blocks' variables.
llvm-svn: 130178
2011-04-26 00:12:46 +00:00
Devang Patel 2606f4d6d2 Rename a local variable.
llvm-svn: 130171
2011-04-25 23:05:21 +00:00
Devang Patel 8ce24133fd Rename a method to match what it really does.
s/addVariableAddress/addFrameVariableAddress/g

llvm-svn: 130170
2011-04-25 23:02:17 +00:00
Devang Patel 2688e4aba6 Do not drop a variable's complex address if it is not based on frame base.
Observed this while reading code, so I do not have a test case handy here.

llvm-svn: 130167
2011-04-25 22:52:55 +00:00
Dan Gohman 6acd95b3c1 Fix an iterator invalidation bug.
llvm-svn: 130166
2011-04-25 22:48:29 +00:00
Eric Christopher 238a21f2d5 Make this test disable fast isel as it's not needed.
llvm-svn: 130165
2011-04-25 22:39:46 +00:00
Chris Lattner f5ba0415df mark a large static table static. Pointed out by Michael Ilseman!
llvm-svn: 130160
2011-04-25 22:14:33 +00:00
Chris Lattner 50686bf55c Improve adherence to general style, use "foo_t &x" instead of "foo_t& x"
llvm-svn: 130153
2011-04-25 21:02:12 +00:00
Chris Lattner 63e9190f71 allow adding a FoldingSetNodeID to a FastFoldingSetNode, resolving PR9499,
patch by Johannes Schaub!

llvm-svn: 130151
2011-04-25 20:58:50 +00:00
Chris Lattner 6e29892430 add a missed bitfield instcombine.
llvm-svn: 130137
2011-04-25 18:44:26 +00:00
Akira Hatanaka 0e7ee666b7 Lower BlockAddress node when relocation-model is static.
llvm-svn: 130131
2011-04-25 17:10:45 +00:00
Devang Patel 734f2218ac A dbg.declare may not be in entry block, even if it is referring to an incoming argument. However, It is appropriate to emit DBG_VALUE referring to this incoming argument in entry block in MachineFunction.
llvm-svn: 130129
2011-04-25 16:33:52 +00:00
Benjamin Kramer ba446cc12a Make tests more useful.
lit needs a linter ...

llvm-svn: 130126
2011-04-25 10:12:01 +00:00
Chandler Carruth 9b73c8e293 Remove some hard coded CR-LFs. Some of these were the entire files, one of
these was just one line of a file. Explicitly set the eol-style property on the
files to try and ensure this fix stays.

llvm-svn: 130125
2011-04-25 07:11:23 +00:00
Duncan Sands 56ca6292dc Fix comment typo. Noticed by Liu.
llvm-svn: 130120
2011-04-25 06:21:43 +00:00
Rafael Espindola a076199e71 Simplify the logic. Noticed by aKor.
llvm-svn: 130116
2011-04-24 19:55:34 +00:00
Rafael Espindola 5c54ecc9af Synchronize the conditions for producing a .cfi_startproc and a .cfi_endproc.
Fixes PR9787.

llvm-svn: 130115
2011-04-24 19:00:34 +00:00
Sebastian Redl 5519ff9d4e Fix Target/ARM/Thumb1FrameLowering.h header guard.
llvm-svn: 130097
2011-04-24 15:47:01 +00:00
Sebastian Redl 1b86ea80bb Give MC/MCDisassembler/Disassembler.h a header guard.
llvm-svn: 130096
2011-04-24 15:46:56 +00:00
Sebastian Redl b8a62aa3c9 Give SplitKit.h a header guard.
llvm-svn: 130095
2011-04-24 15:46:51 +00:00
Sebastian Redl 76e34f0175 Give ImmutableIntervalMap.h an include guard.
llvm-svn: 130094
2011-04-24 15:46:46 +00:00
Jay Foad f7adb3204e Fix an assert to check exactly what it says.
llvm-svn: 130093
2011-04-24 14:30:00 +00:00
Mikhail Glushenkov acb5f8ecf7 Add a TODO.
llvm-svn: 130092
2011-04-24 14:17:41 +00:00
Mikhail Glushenkov 06655d4a61 Regenerate.
llvm-svn: 130091
2011-04-24 14:17:37 +00:00
Mikhail Glushenkov f08209382a Remove all references to plugins from the LLVMC docs.
llvm-svn: 130090
2011-04-24 14:17:32 +00:00
Jay Foad dbf81d8ddf PR9214: Convert the DIBuilder API to use ArrayRef.
llvm-svn: 130086
2011-04-24 10:11:03 +00:00
Jay Foad 1a180156b6 Remove unused STL header includes.
llvm-svn: 130068
2011-04-23 19:53:52 +00:00
Jay Foad 72e705ed94 Like the coding standards say, do not use "using namespace std".
llvm-svn: 130054
2011-04-23 09:06:00 +00:00
Benjamin Kramer 3db054650b Silence an overzealous uninitialized variable warning from GCC.
llvm-svn: 130053
2011-04-23 08:21:06 +00:00
Andrew Trick 76dca78cb4 Accidental function name mangling.
llvm-svn: 130050
2011-04-23 04:08:15 +00:00
Andrew Trick 0ed5778a1e Thumb2 and ARM add/subtract with carry fixes.
Fixes Thumb2 ADCS and SBCS lowering: <rdar://problem/9275821>.
t2ADCS/t2SBCS are now pseudo instructions, consistent with ARM, so the
assembly printer correctly prints the 's' suffix.

Fixes Thumb2 adde -> SBC matching to check for live/dead carry flags.

Fixes the internal ARM machine opcode mnemonic for ADCS/SBCS.
Fixes ARM SBC lowering to check for live carry (potential bug).

llvm-svn: 130048
2011-04-23 03:55:32 +00:00
Andrew Trick 3260c9df4e Comment edit.
llvm-svn: 130047
2011-04-23 03:27:19 +00:00
Andrew Trick 1a1f8d4640 whitespace
llvm-svn: 130046
2011-04-23 03:24:11 +00:00
NAKAMURA Takumi aa3d6242cf docs: Introduce cascading style <div> and <p> continued on <h[2-5]>.
<h2>Section Example</h2>
<div> <!-- h2+div is applied -->
<p>Section preamble.</p>

<h3>Subsection Example</h3>
<p> <!-- h3+p is applied -->
Subsection body
</p>

<!-- End of section body -->
</div>

FIXME: Care H5 better.
llvm-svn: 130040
2011-04-23 00:30:22 +00:00
NAKAMURA Takumi 576273cf56 test/CodeGen/X86/shrink-compare.ll: Relax expressions for Win64.
llvm-svn: 130039
2011-04-23 00:15:45 +00:00
Owen Anderson dd450b86cf Teach FastISel to deal with instructions that have two immediate operands.
llvm-svn: 130033
2011-04-22 23:38:06 +00:00
Devang Patel 1d6bbd41aa Let front-end tie subprogram declaration with subprogram definition directly.
llvm-svn: 130028
2011-04-22 23:10:17 +00:00
Eric Christopher 2ee5b37ab6 Fix comment.
llvm-svn: 130027
2011-04-22 23:08:45 +00:00