Commit Graph

56860 Commits

Author SHA1 Message Date
Sean Callanan 0205452f38 ...and fixed the Makefile.
llvm-svn: 95119
2010-02-02 20:20:30 +00:00
Sean Callanan 2e66266d68 Renamed the ed directory to edis, as suggested
yesterday.  This eliminates possible confusion
about what exactly in this directory; the name
is still short, though.

llvm-svn: 95118
2010-02-02 20:11:23 +00:00
Chris Lattner 29e0702dc8 remove the remnants of TargetMachOWriterInfo.
llvm-svn: 95114
2010-02-02 19:41:23 +00:00
Chris Lattner 809ae81ff9 Add a new top-level MachO.h file for manifest constants, fixing
a layering violation from MC -> Target.

llvm-svn: 95113
2010-02-02 19:38:14 +00:00
Johnny Chen 8487d65ea2 Added t2BFI (Bitfield Insert) entry for disassembler, with blank pattern field.
llvm-svn: 95112
2010-02-02 19:31:58 +00:00
Chris Lattner d1e821f7eb remove PPCMachOWriterInfo.
llvm-svn: 95111
2010-02-02 19:23:55 +00:00
Chris Lattner 03dc0f7077 eliminate all forms of addPassesToEmitMachineCode except
the one used by the JIT.  Remove all forms of
addPassesToEmitFileFinish except the one used by the static
code generator.  Inline the remaining version of
addPassesToEmitFileFinish into its only caller.

llvm-svn: 95109
2010-02-02 19:14:27 +00:00
Kevin Enderby db32c4567b Added another version of the X86 assembler matcher test case.
This test case is different subset of the full auto generated test case, and a
larger subset that is in x86_32-bit.s (that set will encode correctly).  These
instructions can pass though llvm-mc as it were a logical cat(1) and then
reassemble to the same instruction.  It is useful as we bring up the parser and
matcher so we don't break things that currently work.

llvm-svn: 95107
2010-02-02 19:05:57 +00:00
Chris Lattner 57992e2da6 remove dead code, we're requesting TargetMachine::AssemblyFile here.
llvm-svn: 95105
2010-02-02 19:03:39 +00:00
Dale Johannesen da431c76fb Test revert 95050; there's a good chance it's causing
buildbot failure.

llvm-svn: 95103
2010-02-02 18:52:56 +00:00
Chris Lattner 2fdf5b535e Inline addAssemblyEmitter into its one real caller and delete
the -print-emitted-asm option.  The JIT shouldn't have to pull
in the asmprinter.

llvm-svn: 95100
2010-02-02 18:44:12 +00:00
Duncan Sands fa5f5965de Adding missing methods for creating Add, Mul, Neg and Sub with NUW.
llvm-svn: 95086
2010-02-02 12:53:04 +00:00
Zhongxing Xu 30678293f1 Return value on every path.
llvm-svn: 95075
2010-02-02 07:05:31 +00:00
Zhongxing Xu 0bb19a0483 simplify code.
llvm-svn: 95074
2010-02-02 06:33:32 +00:00
Zhongxing Xu b6c17a84d1 More logic correction: RemoveOverlap should always create new tree. Add a
parameter to record whether changes actually happened.

llvm-svn: 95073
2010-02-02 06:22:08 +00:00
Zhongxing Xu 4e9418ab28 Add a lookup method to the IntervalMap. The difference from the original
lookup is that if the lookup key is contained in the key, we return the data.

llvm-svn: 95070
2010-02-02 05:23:23 +00:00
Devang Patel 057c642486 Apparently gdb is not amused by empty lines in pubtypes section.
llvm-svn: 95064
2010-02-02 03:47:27 +00:00
Devang Patel 6d404adc1b NULL terminate name in pubtypes sections.
llvm-svn: 95062
2010-02-02 03:37:03 +00:00
Chris Lattner 8e2c471614 don't turn (A & (C0?-1:0)) | (B & ~(C0?-1:0)) -> C0 ? A : B
for vectors.  Codegen is generating awful code or segfaulting
in various cases (e.g. PR6204).

llvm-svn: 95058
2010-02-02 02:43:51 +00:00
Zhongxing Xu 372688757b Fix a bunch of errors in the old logic.
llvm-svn: 95056
2010-02-02 02:40:56 +00:00
Chris Lattner 302240d73e fix a crash in loop unswitch on a loop invariant vector condition.
llvm-svn: 95055
2010-02-02 02:26:54 +00:00
Chris Lattner 29bb9272a6 remove an unreduced testcase, rename another.
llvm-svn: 95054
2010-02-02 02:23:37 +00:00
Evan Cheng 55afd2564c Perform sibcall in some cases when arguments are passes memory. Look for cases
where callee's arguments are already in the caller's own caller's stack and
they line up perfectly. e.g.

extern int foo(int a, int b, int c);

int bar(int a, int b, int c) {
  return foo(a, b, c);
}

llvm-svn: 95053
2010-02-02 02:22:50 +00:00
Sean Callanan 339975e5d5 Removed an unnecessary class from the EDDisassembler
implementation.  Also made sure that the register maps
were created during disassembler initialization.

llvm-svn: 95051
2010-02-02 02:18:20 +00:00
Dale Johannesen c84816a62e Make local RA smarter about reusing input register of a copy
as output.  Needed for (functional) correctness in inline asm,
and should be generally beneficial.  7361612.

llvm-svn: 95050
2010-02-02 02:08:02 +00:00
Zhongxing Xu d2f8ba0b3d 11.8p1: A nested class is a member and as such has the same access rights as
any other member.

llvm-svn: 95047
2010-02-02 01:57:01 +00:00
Dan Gohman 949458d014 LangRef.html says that inttoptr and ptrtoint always use zero-extension
when the cast is extending.

llvm-svn: 95046
2010-02-02 01:44:02 +00:00
Dan Gohman f644af8bbe Factor out alignof expression folding into a separate function and
generalize it to handle more cases.

llvm-svn: 95045
2010-02-02 01:41:39 +00:00
Dan Gohman 7e5f1b2773 Various code simplifications.
llvm-svn: 95044
2010-02-02 01:38:49 +00:00
Daniel Dunbar 13ad81bd70 Update CMake.
llvm-svn: 95041
2010-02-02 01:12:20 +00:00
Eric Christopher 14dfc3f6df Don't need to check the last argument since it'll always be bool. We also
don't use TargetData here.

llvm-svn: 95040
2010-02-02 00:51:45 +00:00
Eric Christopher 9afa973203 More indentation/tabification fixes.
llvm-svn: 95036
2010-02-02 00:13:06 +00:00
Eric Christopher 1408234753 Untabify previous commit.
llvm-svn: 95035
2010-02-02 00:06:55 +00:00
Sean Callanan 10b9639b74 Changed to Chris Lattner's suggested approach, which
merely stubs out the blocks-based disassembly functions
if the library wasn't built with blocks, which allows a
constant .exports file and also properly deals with
situations in which the compiler used to build a client
is different from the compiler used to build the library.

llvm-svn: 95034
2010-02-02 00:04:46 +00:00
Nate Begeman 0b810279c8 Kill the Mach-O writer, and temporarily make filetype=obj an error.
The MCStreamer based assemblers will take over for this functionality.

llvm-svn: 95033
2010-02-01 23:56:58 +00:00
Sean Callanan 0972067c93 Fix for builds with separate source and build
directories (like, oh, say, any multistage build)

llvm-svn: 95028
2010-02-01 23:27:57 +00:00
Eric Christopher 56e4182c49 Formatting.
llvm-svn: 95027
2010-02-01 23:25:03 +00:00
Johnny Chen 5b66b31774 MOVi16 should also be marked as a UnaryDP instruction, i.e., it doesn't have a
Rn operand.

llvm-svn: 95025
2010-02-01 23:06:04 +00:00
Sean Callanan 23bd0193d4 Updated to use the proper .exports file for the
target platform, depending on whether the target
supports the blocks API or not

llvm-svn: 95024
2010-02-01 23:01:38 +00:00
Bill Wendling c5829c4a50 Add "dump" method to IVUsersOneStride.
llvm-svn: 95022
2010-02-01 22:51:23 +00:00
Dale Johannesen 257d2dafbd Testcase for 94996 (PR 6157)
llvm-svn: 95021
2010-02-01 22:46:05 +00:00
Evan Cheng a49d8e6d38 Fix PR6196. GV callee may not be a function.
llvm-svn: 95017
2010-02-01 22:40:09 +00:00
Evan Cheng 4eb3d2867c Add test case for 95013.
llvm-svn: 95014
2010-02-01 22:32:42 +00:00
Mon P Wang d74e0023c5 Improve EXTRACT_VECTOR_ELT patch based on comments from Duncan
llvm-svn: 95012
2010-02-01 22:15:09 +00:00
Sean Callanan 47cbefac94 Rollback on including blocks functionality in .exports
because some platforms don't support blocks and then
break because the symbols aren't present

llvm-svn: 95011
2010-02-01 21:57:50 +00:00
Bob Wilson d517b52012 Add an option to GVN to remove all partially redundant loads. This is currently
disabled by default.  This divides the existing load PRE code into 2 phases:
first it checks that it is safe to move the load to each of the predecessors
where it is unavailable, and then if it is safe, the code is changed to move
the load.  Radar 7571861.

llvm-svn: 95007
2010-02-01 21:17:14 +00:00
Duncan Sands 180334e13f Do an early exit when the result is known cheaply.
llvm-svn: 95002
2010-02-01 20:57:35 +00:00
Chris Lattner f5edeebd8c eliminate a bunch of pointless LLVMContext arguments.
llvm-svn: 95001
2010-02-01 20:48:08 +00:00
Duncan Sands dddba06e9e Fix typo "of" -> "or" and change the way a line was formatted to fit
into 80 columns to match my artistic preferences.

llvm-svn: 95000
2010-02-01 20:42:02 +00:00
Chris Lattner 94eb4b285b fix PR6195, a bug constant folding scalar -> vector compares.
llvm-svn: 94997
2010-02-01 20:04:40 +00:00
Dale Johannesen 0b30cfc57e fix PR 6157. Testcase pending.
llvm-svn: 94996
2010-02-01 19:54:53 +00:00
Chris Lattner 9306ffa05a cleanups.
llvm-svn: 94995
2010-02-01 19:54:45 +00:00
Chris Lattner 3c46e14137 fix PR6197 - infinite recursion in ipsccp due to block addresses
evaluateICmpRelation wasn't handling blockaddress.

llvm-svn: 94993
2010-02-01 19:35:08 +00:00
Mon P Wang 72c60c73af Fixed a couple of optimization with EXTRACT_VECTOR_ELT that assumes the result
type is the same as the element type of the vector.  EXTRACT_VECTOR_ELT can
be used to extended the width of an integer type.  This fixes a bug for
Generic/vector-casts.ll on a ppc750.

llvm-svn: 94990
2010-02-01 19:03:18 +00:00
Dan Gohman 36bca4e4ba Update this test for a trivial register allocation difference.
llvm-svn: 94989
2010-02-01 19:00:32 +00:00
Dan Gohman e5e1b7b05a Generalize target-independent folding rules for sizeof to handle more
cases, and implement target-independent folding rules for alignof and
offsetof. Also, reassociate reassociative operators when it leads to
more folding.

Generalize ScalarEvolution's isOffsetOf to recognize offsetof on
arrays. Rename getAllocSizeExpr to getSizeOfExpr, and getFieldOffsetExpr
to getOffsetOfExpr, for consistency with analagous ConstantExpr routines.

Make the target-dependent folder promote GEP array indices to
pointer-sized integers, to make implicit casting explicit and exposed
to subsequent folding.

And add a bunch of testcases for this new functionality, and a bunch
of related existing functionality.

llvm-svn: 94987
2010-02-01 18:27:38 +00:00
Chris Lattner 846a52e228 fix rdar://7590304, a miscompilation of objc apps on arm. The caller
of objc message send was getting marked arm_apcscc, but the prototype
isn't.  This is fine at runtime because objcmsgsend is implemented in
assembly.  Only turn a mismatched caller and callee into 'unreachable'
if the callee is a definition.

llvm-svn: 94986
2010-02-01 18:11:34 +00:00
Chris Lattner 2cecedf081 fix rdar://7590304, an infinite loop in instcombine. In the invoke
case, instcombine can't zap the invoke for fear of changing the CFG.
However, we have to do something to prevent the next iteration of
instcombine from inserting another store -> undef before the invoke
thereby getting into infinite iteration between dead store elim and
store insertion.

Just zap the callee to null, which will prevent the next iteration
from doing anything.

llvm-svn: 94985
2010-02-01 18:04:58 +00:00
Bob Wilson f65ba356e1 Fix pr6198 by moving the isSized() check to an outer conditional.
The testcase from pr6198 does not crash for me -- I don't know what's up with
that -- so I'm not adding it to the tests.

llvm-svn: 94984
2010-02-01 17:41:44 +00:00
Dan Gohman de047f2051 Add a getNUWMul function.
llvm-svn: 94982
2010-02-01 16:38:14 +00:00
Dan Gohman ede94e6850 Add a generalized form of ConstantExpr::getOffsetOf which works for
array types as well as struct types, and which accepts arbitrary
Constant indicies.  

llvm-svn: 94981
2010-02-01 16:37:38 +00:00
Bruno Cardoso Lopes aa8c429a53 MulOp is actually a Mips specific node, so do the match using Opcode. This fixes PR6192
llvm-svn: 94977
2010-02-01 12:16:39 +00:00
Zhongxing Xu d41dacdcbf Add an immutable interval map, prepared to be used by flat memory model
in the analyzer. WIP.

llvm-svn: 94976
2010-02-01 10:43:31 +00:00
Sean Callanan bc7bd4bf40 Whoops, left some debugging code in that broke
a buildbot.  Removed.

llvm-svn: 94975
2010-02-01 09:02:24 +00:00
Sean Callanan 328f60f08c Added the enhanced disassembly library's implementation and
fleshed out the .exports file.  I still have to fix several
details of operand parsing, but the basic functionality is
there and usable.

llvm-svn: 94974
2010-02-01 08:49:35 +00:00
Zhongxing Xu 7120eb77d1 Simplify code. We can compare TNew with T in one batch.
llvm-svn: 94973
2010-02-01 07:32:52 +00:00
Evan Cheng ed8ca56eeb Undo r94946 now all the tests are passing again.
llvm-svn: 94970
2010-02-01 02:13:39 +00:00
Bruno Cardoso Lopes 1cb8b33d61 Fix stack size bug while using o32 abi
llvm-svn: 94969
2010-02-01 02:03:24 +00:00
Johnny Chen b3562f7cf6 For MVNr and MVNs, we need to set Inst{25} = 0 so as not to confuse the decoder.
llvm-svn: 94955
2010-01-31 11:22:28 +00:00
Evan Cheng b33dbc5019 Change TAILJMP's to be varargs and transfer implicit uses over from TCRETURN's. Otherwise the missing uses can make post-regalloc scheduling do bad things. This fixes 403.gcc.
llvm-svn: 94950
2010-01-31 07:28:44 +00:00
Evan Cheng 9adc6f46cf Fix a missing check from my last commit.
llvm-svn: 94949
2010-01-31 07:27:31 +00:00
Evan Cheng 7f62def0f9 Avoid recursive sibcall's.
llvm-svn: 94946
2010-01-31 06:44:49 +00:00
Eli Friedman 0de0b3677a Remove a completed item, add a couple new ones.
llvm-svn: 94945
2010-01-31 04:55:32 +00:00
Eli Friedman 690c7f4dfd Remove test which is no longer relevant.
llvm-svn: 94944
2010-01-31 04:40:45 +00:00
Eli Friedman a2cc2875fc Simplify/generalize the xor+add->sign-extend instcombine.
llvm-svn: 94943
2010-01-31 04:29:12 +00:00
Eli Friedman 37a8197b61 Add a small transform: transform -(X<<Y) to (-X<<Y) when the shift has a single
use and X is free to negate.

llvm-svn: 94941
2010-01-31 02:30:23 +00:00
Sean Callanan 9aeccadce4 Moved InstallLexer() from the X86-specific AsmLexer
to the TargetAsmLexer class so that clients can
actually use the TargetAsmLexer they get from a
Target.

llvm-svn: 94940
2010-01-31 02:28:18 +00:00
Evan Cheng d86d3fe0c3 Do not mark no-return calls tail calls. It'll screw up special calls like longjmp and it doesn't make much sense for performance reason. If my logic is faulty, please let me know.
llvm-svn: 94937
2010-01-31 00:59:31 +00:00
Bruno Cardoso Lopes 193e64c699 Fix PR6144. Reload GP before the emission of CALLSEQ_END to guarantee the right reload order
llvm-svn: 94915
2010-01-30 18:32:07 +00:00
Bruno Cardoso Lopes 7ee71912ed Fix mov.d out register by using the FFR register class directly
llvm-svn: 94914
2010-01-30 18:29:19 +00:00
Anton Korobeynikov 25df248382 Fix a gross typo: ARMv6+ may or may not support unaligned memory operations.
Even if they are suported by the core, they can be disabled
(this is just a configuration bit inside some register).

Allow unaligned memops on darwin and conservatively disallow them otherwise.

llvm-svn: 94889
2010-01-30 14:08:12 +00:00
Bob Wilson 56600a15ad Check alignment of loads when deciding whether it is safe to execute them
unconditionally.  Besides checking the offset, also check that the underlying
object is aligned as much as the load itself.

llvm-svn: 94875
2010-01-30 04:42:39 +00:00
Evan Cheng 70f714fdbe Allow more tailcall optimization: calls with inputs that are all passed in registers.
llvm-svn: 94873
2010-01-30 01:22:00 +00:00
Evan Cheng 2d5a75b42a Don't forget to transfer target flag when inserting a tailcall instruction.
llvm-svn: 94872
2010-01-30 01:16:15 +00:00
Devang Patel 160c92dd19 Emit declaration DIE for the class static variables.
llvm-svn: 94870
2010-01-30 01:08:30 +00:00
Daniel Dunbar 76e5d70c57 MC/X86 AsmParser: Handle absolute memory operands correctly. We were doing
something totally broken and parsing them as immediates, but the .td file also
had the wrong match class so things sortof worked. Except, that is, that we
would parse
  movl $0, %eax
as
  movl 0, %eax
Feel free to guess how well that worked.

llvm-svn: 94869
2010-01-30 01:02:48 +00:00
Daniel Dunbar cf18153de2 AsmMatcher: Create operand classes before use, apparently records aren't visited
in the order they were declared.

llvm-svn: 94868
2010-01-30 01:02:37 +00:00
Dale Johannesen e057403835 Fix a case where debug_value could affect codegen.
llvm-svn: 94866
2010-01-30 00:57:47 +00:00
Bob Wilson 4b71b6c179 Use more specific types to avoid casts. No functionality change.
llvm-svn: 94863
2010-01-30 00:41:10 +00:00
Bob Wilson 2e51136f80 Remove ARM-specific calling convention from this test. Target data is
needed for this test, but otherwise, there's nothing ARM-specific about
it and no need to specify the calling convention.

llvm-svn: 94862
2010-01-30 00:40:23 +00:00
Daniel Dunbar f05d00787a X86.td: Refactor to bring operands that use print_pcrel_imm together.
llvm-svn: 94861
2010-01-30 00:24:12 +00:00
Daniel Dunbar e9aa36c895 FileCheck: When looking for "possible matches", only compare against the prefix
line. Turns out edit_distance can be slow if the string we are scanning for
happens to be quite large.

llvm-svn: 94860
2010-01-30 00:24:06 +00:00
Daniel Dunbar a97adee959 AsmMatcher/X86: Separate out sublass for memory operands that have no segment
register, and use to cleanup a FIXME in X86AsmParser.cpp.

llvm-svn: 94859
2010-01-30 00:24:00 +00:00
Jakob Stoklund Olesen e27dc727e2 Keep iterating over all uses when meeting a phi node in AllUsesOfValueWillTrapIfNull().
This bug was exposed by my inliner cost changes in r94615, and caused failures
of lencod on most architectures when building with LTO.

This patch fixes lencod and 464.h264ref on x86-64 (and likely others).

llvm-svn: 94858
2010-01-29 23:54:14 +00:00
Daniel Dunbar 7f0421eebb MC/X86: Add a nice X86 assembler matcher test case from Kevin Enderby.
- This test case is auto generated, and has been verified to round-trip
   correctly through llvm-mc by checking the assembled .o file before and after
   piping through llvm-mc. It will be extended over time as the matcher grows
   support for more instructions.

llvm-svn: 94857
2010-01-29 23:32:40 +00:00
Johnny Chen 34a6afc68d Modified encoding bits specification for VFP instructions. In particular, the D
bit (Inst{22}) and the M bit (Inst{5}) should be left unspecified.  For binary
format instructions, Inst{6} and Inst{4} need to specified for proper decodings.

llvm-svn: 94855
2010-01-29 23:21:10 +00:00
Dan Gohman 5ded1424b0 Print a comment next to "materializable" global values, to distinguish
them from values that are not actually defined in the module.

llvm-svn: 94854
2010-01-29 23:12:36 +00:00
Evan Cheng 25217ffaed PPC is not ready for sibcall optimization.
llvm-svn: 94853
2010-01-29 23:05:56 +00:00
Bob Wilson 1b8453067b Preserve load alignment in instcombine transformations. I've been unable to
create a testcase where this matters.  The select+load transformation only
occurs when isSafeToLoadUnconditionally is true, and in those situations,
instcombine also changes the underlying objects to be aligned.  This seems
like a good idea regardless, and I've verified that it doesn't pessimize
the subsequent realignment.

llvm-svn: 94850
2010-01-29 22:39:21 +00:00
Dan Gohman 2bf486eb14 Minor code cleanup.
llvm-svn: 94848
2010-01-29 21:57:46 +00:00
Dan Gohman df22bbf76c Skip whitespace when looking for a potential intended match.
Before:

<stdin>:94:1: note: possible intended match here
 movsd 4096(%rsi), %xmm0
^

After:
<stdin>:94:2: note: possible intended match here
 movsd 4096(%rsi), %xmm0
 ^

llvm-svn: 94847
2010-01-29 21:55:16 +00:00
Dan Gohman 838fb09a75 Fix the position of the caret in the FileCheck error message.
Before:

test/CodeGen/X86/lsr-reuse.ll:52:34: error: expected string not found in input
; CHECK: movsd -2048(%rsi), %xmm0
                                 ^

After:

test/CodeGen/X86/lsr-reuse.ll:52:10: error: expected string not found in input
; CHECK: movsd -2048(%rsi), %xmm0
         ^

llvm-svn: 94846
2010-01-29 21:53:18 +00:00
Junjie Gu 6abe6cb8b5 Make sure the size is doubled (not 4x).
llvm-svn: 94845
2010-01-29 21:34:26 +00:00
Sean Callanan fd86e790cc Removed symbols from .exports that are not yet in
the library.

llvm-svn: 94844
2010-01-29 21:21:44 +00:00
Dale Johannesen ad00f03e86 Add assertion to humor the paranoid.
llvm-svn: 94843
2010-01-29 21:21:28 +00:00
Victor Hernandez 6b7f4216b6 We were not writing bitcode for function-local metadata whose operands have been erased (making it not have any more function-local operands)
llvm-svn: 94842
2010-01-29 21:19:19 +00:00
Eric Christopher 5a0e174863 Revert my last couple of patches. They appear to have broken bison.
llvm-svn: 94841
2010-01-29 21:16:24 +00:00
Jeffrey Yasskin b36dc68f61 Rename two IRReader.h functions to indicate that they return a Module
that loads its contents lazily from bitcode.  I think these are the
only remaining mis-named functions.

llvm-svn: 94840
2010-01-29 21:11:04 +00:00
Bob Wilson 34e10c2218 Use uint64_t instead of unsigned for offsets and sizes.
llvm-svn: 94835
2010-01-29 20:34:28 +00:00
Bob Wilson 7c42b9d51e Improve isSafeToLoadUnconditionally to recognize that GEPs with constant
indices are safe if the result is known to be within the bounds of the
underlying object.

llvm-svn: 94829
2010-01-29 19:19:08 +00:00
Jeffrey Yasskin 9fb8ce835d Belatedly document r85295 and r85330.
llvm-svn: 94825
2010-01-29 19:10:38 +00:00
Devang Patel aedd6f5b33 Add size and location info in DW_TAG_class_type descriptor.
llvm-svn: 94822
2010-01-29 18:34:58 +00:00
Devang Patel 7f8be9ba95 Before inserting llvm.dbg.declare intrinsic at the end of a basic block, check whether the basic block has a terminator or not.
This API is used by clang and the test case is test/CodeGen/debug-info-crash.c in clang module.

llvm-svn: 94820
2010-01-29 18:30:57 +00:00
Benjamin Kramer ef14f80e95 Fix MSVC build.
llvm-svn: 94809
2010-01-29 15:19:06 +00:00
Benjamin Kramer b17c58674e Convert some users of ftostr to raw_ostream.
llvm-svn: 94808
2010-01-29 14:42:22 +00:00
Benjamin Kramer 6bee24ae9a Use llvm::format instead of ftostr (which just calls sprintf).
llvm-svn: 94807
2010-01-29 14:40:33 +00:00
Duncan Sands 3327498095 Change the SREM case to match the logic in the IR version ComputeMaskedBits.
llvm-svn: 94805
2010-01-29 09:45:26 +00:00
Evan Cheng 297a494f55 Catch more trivial tail call opportunities: no inputs and output types match.
llvm-svn: 94804
2010-01-29 06:45:59 +00:00
Duncan Sands c8a3e56870 Having RHSKnownZero and RHSKnownOne be alternative names for KnownZero and KnownOne
(via APInt &RHSKnownZero = KnownZero, etc) seems dangerous and confusing to me: it
is easy not to notice this, and then wonder why KnownZero/RHSKnownZero changed
underneath you when you modified RHSKnownZero/KnownZero etc.  So get rid of this.
No intended functionality change (tested with "make check" + llvm-gcc bootstrap).

llvm-svn: 94802
2010-01-29 06:18:46 +00:00
Duncan Sands 26cd6bd0b0 It looks like the changes to the SRem logic of SimplifyDemandedUseBits
(fix for PR6165) are needed here too.

llvm-svn: 94801
2010-01-29 06:18:37 +00:00
Daniel Dunbar 864b1aae63 FileCheck: Switch "possible match" calculation to use StringRef::edit_distance.
- Thanks Doug, who is obviously less lazy than me!

llvm-svn: 94795
2010-01-29 03:22:19 +00:00
Eric Christopher 9b3c02b7da Make strcpy_chk lower to strcpy if we have a safe size.
llvm-svn: 94783
2010-01-29 01:37:11 +00:00
Sean Callanan e8f5e8c9f8 Quick fix to make the header file for the enhanced
disassembly information have a better comment (and
better guard macros).

llvm-svn: 94781
2010-01-29 01:34:29 +00:00
Sean Callanan 2444ed4fea Added a bare-bones Makefile to build the enhanced disassembly
library as a static and a shared library.  Added dependencies
so the target-specific enhanced disassembly info tables are
built before the library.

llvm-svn: 94780
2010-01-29 01:30:01 +00:00
Ted Kremenek 9d1e666af0 Recognize 'add_executable' when analyzing CMake files.
llvm-svn: 94777
2010-01-29 01:10:55 +00:00
Ted Kremenek ffe9c20eaa Update CMake build.
llvm-svn: 94776
2010-01-29 01:10:25 +00:00
Eric Christopher 997f7ca8c5 Add constant support to object size handling and remove default
lowering. We'll either figure it out, or not and be lowered by
SelectionDAGBuild.

Add test.

llvm-svn: 94775
2010-01-29 01:09:57 +00:00
Bill Wendling 48816a0b3f Generic reformatting and comment fixing. No functionality change.
llvm-svn: 94771
2010-01-29 00:52:43 +00:00
Bill Wendling 8277838cf8 Add newline to debugging output, and fix some grammar-os in comment.
llvm-svn: 94765
2010-01-29 00:27:39 +00:00
Sean Callanan 82436d1666 Added a custom TableGen backend to support the
enhanced disassembler, and the necessary makefile
rules to build the table for X86.

llvm-svn: 94764
2010-01-29 00:21:04 +00:00
Victor Hernandez 006b53f199 mem2reg erases the dbg.declare intrinsics that it converts to dbg.val intrinsics
llvm-svn: 94763
2010-01-29 00:01:35 +00:00
Bill Wendling 954cb187e0 Assign the ordering of SDNodes in a much less intrusive fashion. After the
"visit*" method is called, take the newly created nodes, walk them in a DFS
fashion, and if they don't have an ordering set, then give it one.

llvm-svn: 94757
2010-01-28 21:51:40 +00:00
Mikhail Glushenkov 04f442c515 Support some more options...
llvm-svn: 94752
2010-01-28 18:19:36 +00:00
Dan Gohman a424b9fbd1 Remove the folding rule
getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1) 
  to
  inttoptr (i64 0 to i8*)
from the VMCore constant folder. It didn't handle sign-extension properly
in the case where the source integer is smaller than a pointer size. And,
it relied on an assumption about sizeof(i8).

The Analysis constant folder still folds these kinds of things; it has
access to TargetData, so it can do them right.

Add a testcase which tests that the VMCore constant folder doesn't
miscompile this, and that the Analysis folder does fold it.

llvm-svn: 94750
2010-01-28 18:08:26 +00:00
Benjamin Kramer 29063eac23 Replace strcpy with memcpy when we have the length around anyway.
llvm-svn: 94746
2010-01-28 18:04:38 +00:00
Duncan Sands 3a48b87c54 Fix PR6165. The bug was that LHSKnownZero was being and'd with DemandedMask
when it should have been and'd with LowBits.  Fix that and while there beef
up the logic in the case of a negative LHS.

llvm-svn: 94745
2010-01-28 17:22:42 +00:00
Douglas Gregor 1051937c21 Add llvm::Program::ChangeStderrToBinary().
llvm-svn: 94743
2010-01-28 06:42:08 +00:00
Dan Gohman 9f4ea22c88 Check Type::isSized before calling ScalarEvolution::getAllocSizeExpr,
rather than after.

llvm-svn: 94742
2010-01-28 06:32:46 +00:00
Chris Lattner cc9a6f0580 convert the last 3 targets to use EmitFunctionBody() now that
it has before/end body hooks.

 lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp |   49 ++-----------
 lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp   |   87 ++++++------------------
 lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp |   56 +++------------
 test/CodeGen/XCore/ashr.ll                      |    2 
 4 files changed, 48 insertions(+), 146 deletions(-)

llvm-svn: 94741
2010-01-28 06:22:43 +00:00
Dan Gohman a9be73929f Make getAlignOf return an i64, for consistency with getSizeOf and
getOffsetOf, and remove the comment about assuming i8 is byte-aligned,
which is no longer applicable.

llvm-svn: 94738
2010-01-28 02:43:22 +00:00
Dan Gohman cf9138307d Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their place
use plain SCEVUnknowns with ConstantExpr::getSizeOf and
ConstantExpr::getOffsetOf constants. This eliminates a bunch of
special-case code.

Also add code for pattern-matching these expressions, for clients that
want to recognize them.

Move ScalarEvolution's logic for expanding array and vector sizeof
expressions into an element count times the element size, to expose
the multiplication to subsequent folding, into the regular constant
folder.

llvm-svn: 94737
2010-01-28 02:15:55 +00:00
Chris Lattner c968f4475e add target hooks for emitting random gunk before and after the function body.
llvm-svn: 94732
2010-01-28 01:58:58 +00:00
Evan Cheng 346af88396 Fix a bug introduced by r94490 where it created a X86ISD::CMP whose output type is different from its inputs.
This fixes PR6146.

llvm-svn: 94731
2010-01-28 01:57:22 +00:00
Chris Lattner 125c118cd8 switch blackfin to the default runOnMachineFunction
llvm-svn: 94729
2010-01-28 01:54:33 +00:00
Chris Lattner b662b7c801 eliminate a now-useless class.
llvm-svn: 94728
2010-01-28 01:50:22 +00:00
Chris Lattner fd97a3369e Switch MSP430, SPU, Sparc, and SystemZ to use EmitFunctionBody().
Diffstat:
 6 files changed, 30 insertions(+), 284 deletions(-)

llvm-svn: 94727
2010-01-28 01:48:52 +00:00
Jim Grosbach 54c0530834 Update of 94055 to track the IR level call site information via an intrinsic.
This allows code gen and the exception table writer to cooperate to make sure
landing pads are associated with the correct invoke locations.

llvm-svn: 94726
2010-01-28 01:45:32 +00:00
Jeffrey Yasskin 4a8b1da865 Record the death of ModuleProvier and GhostLinkage in the release notes and
give upgrade instructions.

llvm-svn: 94723
2010-01-28 01:41:20 +00:00
Chris Lattner 73de5fbfc3 Give AsmPrinter the most common expected implementation of
runOnMachineFunction, and switch PPC to use EmitFunctionBody.
The two ppc asmprinters now don't heave to define 
runOnMachineFunction.

llvm-svn: 94722
2010-01-28 01:28:58 +00:00
Jeffrey Yasskin 0830b9709d Truncate the release notes so they're ready to accumulate notes for the 2.7 release.
llvm-svn: 94720
2010-01-28 01:14:43 +00:00