Commit Graph

6731 Commits

Author SHA1 Message Date
Chris Lattner e2846b6929 add missing #include.
llvm-svn: 51227
2008-05-18 14:24:58 +00:00
Bill Wendling d70febc73b On Darwin, the string header file isn't 64-bit clean. The use of
"-Wshorten-64-to-32 -Werror" will cause a failure when compiling this complex
program:

#include <string>

class Path {
  mutable std::string path;
public:
  bool operator == (const Path &that) {
    return path == that.path;
  }
};

Using strcmp gets us past this annoying error.

llvm-svn: 51218
2008-05-17 09:10:40 +00:00
Nick Lewycky 79376f4e02 Move isTrueWhenEqual to ICmpInst.
llvm-svn: 51215
2008-05-17 07:33:39 +00:00
Dale Johannesen ab5b577a99 Add CommonLinkage.
llvm-svn: 51208
2008-05-16 22:42:11 +00:00
Eric Christopher 901b1a75c9 Add functions to enable adding a single attribute to a function and
its associated call site.

llvm-svn: 51204
2008-05-16 20:39:43 +00:00
Gabor Greif e1f6e4b21d API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
llvm-svn: 51200
2008-05-16 19:29:10 +00:00
Dan Gohman 32db11b634 Update comments based on Duncan's feedback.
llvm-svn: 51170
2008-05-15 23:35:32 +00:00
Evan Cheng 29e59ad6c9 Fix typos and comments.
llvm-svn: 51165
2008-05-15 22:13:02 +00:00
Dan Gohman 12fce7751b IR support for extractvalue and insertvalue instructions. Also, begin
moving toward making structs and arrays first-class types.

llvm-svn: 51157
2008-05-15 19:50:34 +00:00
Evan Cheng ef377adca0 Make use of vector load and store operations to implement memcpy, memmove, and memset. Currently only X86 target is taking advantage of these.
llvm-svn: 51140
2008-05-15 08:39:06 +00:00
Nate Begeman 60f9320fc5 Move the operator new and operator delete out of line. This fixes an issue with
operator new() referring to the static initTags function, which has to be in the 
same linkage unit as any file including User.h.

llvm-svn: 51136
2008-05-15 01:23:11 +00:00
Nate Begeman 7402017b9a Add support to IR builder for new vicmp, vfcmp routines
llvm-svn: 51127
2008-05-14 20:29:46 +00:00
Nate Begeman 94849f2246 Don't generate unused variables in a no-assert build
Add some checks to the new vicmp,vfcmp instructions

llvm-svn: 51125
2008-05-14 20:28:31 +00:00
Dale Johannesen ce4396bc92 Add CommonLinkage; currently tentative definitions
are represented as "weak", but there are subtle differences
in some cases on Darwin, so we need both.  The intent
is that "common" will behave identically to "weak" unless
somebody changes their target to do something else.
No functional change as yet.

llvm-svn: 51118
2008-05-14 20:12:51 +00:00
Devang Patel f2763e233e Simplify internalize pass. Add test case.
Patch by Matthijs Kooijman!

llvm-svn: 51114
2008-05-14 20:01:01 +00:00
Roman Levenstein 52a005ac13 Do not generate by TableGen the hard-coded standard, target-independent part of
DAG instruction selectors. Introudce a dedicated header file for this part:
include/llvm/CodeGen/DAGISelHeader.h

TableGen now only generates the include preprocessor directive to include this
new header.

This is a preparation for supporting multiple implementations of instruction
selectors in the future.

Reviewed and approved by Evan and Dan.

llvm-svn: 51102
2008-05-14 10:17:11 +00:00
Dan Gohman f41600da59 Commit the header I accidentally left out of 51083.
llvm-svn: 51093
2008-05-14 04:39:40 +00:00
Dan Gohman 0f45b6fda5 Move RemoveFromVector out of the global namespace.
llvm-svn: 51090
2008-05-14 01:02:49 +00:00
Dan Gohman fd3e3003f3 Whitespace cleanups.
llvm-svn: 51089
2008-05-14 00:43:10 +00:00
Dan Gohman c92abb44db Make getNumContainedManagers and getNumContainedPasses const.
llvm-svn: 51087
2008-05-14 00:40:34 +00:00
Dan Gohman 1453fd6de6 Make PassInfo noncopyable.
llvm-svn: 51085
2008-05-14 00:39:39 +00:00
Dan Gohman 3dc2d92ebd Split the loop unroll mechanism logic out into a utility function.
Patch by Matthijs Kooijman!

llvm-svn: 51083
2008-05-14 00:24:14 +00:00
Gabor Greif 5ef7404dc7 Merge of r51073-51074 from use-diet branch.
Do not rely on std::swap<Use>, provide a (faster) member function instead.
This change is primarily necessitated by MSVC++'s incompatibility with
declaring std::swap<Use> to be a friend of Use.

Also contains some minor tweaks to Use inline functions,
to undo pointless changes that sneaked in with the last merge.

llvm-svn: 51078
2008-05-13 22:51:52 +00:00
Eric Christopher 29fafcccd3 Make this function public.
llvm-svn: 51077
2008-05-13 22:51:04 +00:00
Anton Korobeynikov 5c48bae209 Add thin layer over StringMap to form StringSet. By Mikhail Glushenkov.
llvm-svn: 51048
2008-05-13 15:03:16 +00:00
Evan Cheng 1120279ae6 Instead of a vector load, shuffle and then extract an element. Load the element from address with an offset.
pshufd $1, (%rdi), %xmm0
        movd %xmm0, %eax
=>
        movl 4(%rdi), %eax

llvm-svn: 51026
2008-05-13 08:35:03 +00:00
Gabor Greif 0d42adf65b Derive GetResultInst from UnaryInstruction, this simplifies code and removes a FIXME.
llvm-svn: 51023
2008-05-13 07:09:08 +00:00
Dan Gohman 0479aa5c0b Change class' public PassInfo variables to by initialized with the
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.

Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.

llvm-svn: 51022
2008-05-13 02:05:11 +00:00
Evan Cheng b980f6fb3d Xform bitconvert(build_pair(load a, load b)) to a single load if the load locations are at the right offset from each other.
llvm-svn: 51008
2008-05-12 23:04:07 +00:00
Bill Wendling 1e11768a4f Constify the machine instruction passed into the
"is{Trivially,Really}ReMaterializable" methods.

llvm-svn: 51001
2008-05-12 20:54:26 +00:00
Evan Cheng 5f52142ee0 Forgot this.
llvm-svn: 50993
2008-05-12 20:08:05 +00:00
Nate Begeman cfcb56091b Add support for vicmp/vfcmp codegen, more legalize support coming.
This is necessary to unbreak the build.

llvm-svn: 50988
2008-05-12 19:40:03 +00:00
Nate Begeman d21957002a Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRef
for details.  CodeGen support coming in a follow up patch

llvm-svn: 50985
2008-05-12 19:01:56 +00:00
Chris Lattner 5287765d1a Add a new SparsePropagation analysis utility, which allows you to do
SCCP like sparse lattice analysis with relative ease.  Just pick your
lattice function and implement the transfer function and you're good.
Just make sure you don't break monotonicity ;-)

llvm-svn: 50961
2008-05-12 01:12:24 +00:00
Nick Lewycky c38c1712f7 Make constructors target-specific. This fixes problems where the path would
include backslashes on Windows. This should fix llvm-ld problems on win32.

llvm-svn: 50960
2008-05-11 17:37:40 +00:00
Bill Wendling 9fbd6e7e8c Remove warnings when using -Wshorten-64-to-32.
llvm-svn: 50952
2008-05-10 19:59:59 +00:00
Bill Wendling 7385b08d34 Prevent -W64-to-32-shortened warnings.
llvm-svn: 50947
2008-05-10 11:26:52 +00:00
Bill Wendling a6c46c2f21 Prevent warnings from the -Wshorten-64-to-32 flag.
llvm-svn: 50946
2008-05-10 10:58:07 +00:00
Gabor Greif a1f949a2df remove commented-out code, it is subsumed by DECLARE_TRANSPARENT_OPERAND_ACCESSORS
llvm-svn: 50944
2008-05-10 09:36:58 +00:00
Gabor Greif f6caff66a1 merge of use-diet branch to trunk
llvm-svn: 50943
2008-05-10 08:32:32 +00:00
Evan Cheng 7f76852a50 Make OpActionsCapacity multiple of 4.
llvm-svn: 50917
2008-05-09 21:50:23 +00:00
Chris Lattner f2e4cfd7e2 add support for pattern matching 'neg'
llvm-svn: 50883
2008-05-09 05:20:27 +00:00
Chris Lattner 8462711ce8 add a new Instruction::mayReadFromMemory predicate, make
Instruction::mayWriteToMemory stronger for invokes.

llvm-svn: 50858
2008-05-08 17:16:51 +00:00
Anton Korobeynikov fc2edad4ae Turn StripPointerCast() into a method
llvm-svn: 50836
2008-05-07 22:54:15 +00:00
Ted Kremenek dac0391218 Make the interface of CStrInCStrNoCase be the same as strcasestr.
llvm-svn: 50828
2008-05-07 20:04:18 +00:00
Chris Lattner 621d33bbc0 Add a new LibCallAliasAnalysis pass, which is parameterized
by an instance of LibCallInfo to provide mod/ref info of
standard library functions.  This is powerful enough to
say that 'sqrt' is readonly except that it modifies errno,
or that "printf doesn't store to memory unless the %n
constraint is present" etc.

llvm-svn: 50827
2008-05-07 19:53:05 +00:00
Ted Kremenek 7b66ad294b Fix some serious logical errors in CStrInCStrNoCase pointed out by Bill.
llvm-svn: 50826
2008-05-07 19:22:36 +00:00
Duncan Sands e2b0bf43a7 Output correct exception handling and frame info
on x86-64 linux.  This causes no regressions on
32 bit linux and 32 bit ppc.  More tests pass
on 64 bit ppc with no regressions.  I didn't
turn on eh on 64 bit linux because the intrinsics
needed to compile the eh runtime aren't done
yet.  But if you turn it on and link with the
mainline runtime then eh seems to work fine
on x86-64 linux with this patch.  Thanks to
Dale for testing.  The main point of the patch
is that if you output that some object is
encoded using 4 bytes you had better not output
8 bytes for it: the patch makes everything
consistent.

llvm-svn: 50825
2008-05-07 19:11:09 +00:00
Ted Kremenek 13bbdf2389 Guard for empty strings in CStrInCStrNoCase.
llvm-svn: 50823
2008-05-07 18:49:31 +00:00
Ted Kremenek 3a9fa4e360 Added CStrInCStrNoCase, a portable implementation of strcasestr.
llvm-svn: 50821
2008-05-07 18:35:46 +00:00