Commit Graph

2471 Commits

Author SHA1 Message Date
Chris Lattner 378b041f03 improve const correctness.
llvm-svn: 60168
2008-11-27 08:39:18 +00:00
Chris Lattner 8b291e66eb add a long-overdue AllocaInst::isStaticAlloca method.
llvm-svn: 60080
2008-11-26 02:54:17 +00:00
Devang Patel cb181bb203 Silence unused variable warnings.
llvm-svn: 59841
2008-11-21 20:00:59 +00:00
Chris Lattner dd7083452f reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count.

llvm-svn: 59823
2008-11-21 16:42:48 +00:00
Bill Wendling 4bce2bff88 Revert r59802. It was breaking the build of llvm-gcc:
g++ -m32 -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wmissing-format-attribute -fno-common -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"i386-apple-darwin9.5.0\" -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include  -D_DEBUG  -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS   -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include ../../llvm-gcc.src/gcc/llvm-types.cpp -o llvm-types.o
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemCpy(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemMove(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemSet(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i64' is not a member of 'llvm::Intrinsic'
make[3]: *** [llvm-convert.o] Error 1
make[3]: *** Waiting for unfinished jobs....
rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

llvm-svn: 59809
2008-11-21 09:09:41 +00:00
Sanjiv Gupta 09a203765a Make mem[cpy,move,set] intrinsics overloaded.
llvm-svn: 59802
2008-11-21 07:49:09 +00:00
Bill Wendling fd2c607026 Use stripPointerCasts when checking for AllocaInsts for the stackprotector intrinsic.
llvm-svn: 59614
2008-11-19 09:17:16 +00:00
Bill Wendling 542c2da10e Use dyn_cast instead of cast.
llvm-svn: 59577
2008-11-19 01:25:41 +00:00
Bill Wendling 9dc0f61a5e Match an element of the return type if it returns a structure.
llvm-svn: 59576
2008-11-19 01:15:05 +00:00
Bill Wendling d8e312d11f Verify that the second parameter of the stacprotector intrinsic is an alloca
instruction.

llvm-svn: 59563
2008-11-18 23:09:31 +00:00
Nick Lewycky 967aeeb400 Correct this error message.
llvm-svn: 59370
2008-11-15 17:50:47 +00:00
Bill Wendling 9182147f17 Modify the intrinsics pattern to separate out the "return" types from the
"parameter" types. An intrinsic can now return a multiple return values like
this:

  def add_with_overflow : Intrinsic<[llvm_i32_ty, llvm_i1_ty],
                                    [LLVMMatchType<0>, LLVMMatchType<0>]>;

llvm-svn: 59237
2008-11-13 09:08:33 +00:00
Bill Wendling 9a04b9dd8b Refactor the code that does the type checking for intrinsics.
llvm-svn: 59228
2008-11-13 07:11:27 +00:00
Bill Wendling ccb67a3d85 Implement stack protectors as function attributes: "ssp" and "sspreq".
llvm-svn: 59202
2008-11-13 01:02:14 +00:00
Mon P Wang 25f0106fd9 Added support for the following definition of shufflevector
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> 

llvm-svn: 58964
2008-11-10 04:46:22 +00:00
Chris Lattner 5505eed5ac Use utohex_buffer instead of utohexstr to avoid creating a temporary
string in the .ll and .s printers.

llvm-svn: 58962
2008-11-10 04:30:26 +00:00
Dan Gohman 193e4c025e Fix a use of an invalid iterator when -debug-pass=Details is used.
llvm-svn: 58816
2008-11-06 21:57:17 +00:00
Bill Wendling f5f6f74c16 Add comments to function.
llvm-svn: 58781
2008-11-05 23:42:27 +00:00
Devang Patel e94321305f Silence unused variable warnings.
llvm-svn: 58743
2008-11-05 01:37:40 +00:00
Nuno Lopes 0460bb27e0 fix memory leak in pass manager when adding an analysis pass that already existed. as pass manager takes ownership of the added passes, it has to delete the pass if it isnt added to the pass list
tweak the opt tool so that it doesnt access a Pass after the ownership was taken by the pass manager

llvm-svn: 58730
2008-11-04 23:03:58 +00:00
Bill Wendling 2f40956c68 - Add a "getOrInsertGlobal" method to the Module class. This acts similarly to
"getOrInsertFunction" in that it either adds a new declaration of the global
  and returns it, or returns the current one -- optionally casting it to the
  correct type.
- Use the new getOrInsertGlobal in the stack protector code.
- Use "splitBasicBlock" in the stack protector code.

llvm-svn: 58727
2008-11-04 22:51:24 +00:00
Dan Gohman 20687e99b7 Duncan pointed out that the Extended case in getTypeForMVT could
be considerably simplified.

llvm-svn: 58703
2008-11-04 16:19:44 +00:00
Dan Gohman 72d10ab9ad Add a return statement to suppress warnings in NDEBUG builds.
llvm-svn: 58702
2008-11-04 16:08:57 +00:00
Dan Gohman ade09cd9d3 Add some asserts to verify MVT invariant assumptions.
llvm-svn: 58701
2008-11-04 16:03:56 +00:00
Devang Patel d26344d252 Fix unused variable warnings.
llvm-svn: 58653
2008-11-03 23:20:04 +00:00
Dan Gohman d5104a5de6 Add C bindings for extractvalue and insertvalue. Patch by Frits van Bommel!
llvm-svn: 58650
2008-11-03 22:55:43 +00:00
Dan Gohman d7546abb8a Change how extended types are represented in MVTs. Instead of fiddling
bits, use a union of a SimpleValueType enum and a regular Type*.

This increases the size of MVT on 64-bit hosts from 32 bits to 64 bits.
In most cases, this doesn't add significant overhead. There are places
in codegen that use arrays of MVTs, so these are now larger, but
they're small in common cases.

This eliminates restrictions on the size of integer types and vector
types that can be represented in codegen. As the included testcase
demonstrates, it's now possible to codegen very large add operations.
There are still some complications with using very large types. PR2880
is still open so they can't be used as return values on normal targets,
there are no libcalls defined for very large integers so operations
like multiply and divide aren't supported.

This also introduces a minimal tablgen Type library, capable of
handling IntegerType and VectorType. This will allow parts of
TableGen that don't depend on using SimpleValueType values to handle
arbitrary integer and vector types.

llvm-svn: 58623
2008-11-03 17:56:27 +00:00
Sanjiv Gupta 20b9687450 Reverting back 58505. Will commit it once I have the bc reader/writer/docs
ready.

llvm-svn: 58547
2008-11-01 10:57:12 +00:00
Sanjiv Gupta e3ba47b71b For some targets pointer and int are 16-bits. Allow 16-bits as a valid index
in such cases.

llvm-svn: 58505
2008-10-31 10:26:20 +00:00
Daniel Dunbar db0b70a937 Reuse PrintEscapedString for printing names in .ll
- One functionality change, '\\' in a name is now printed as a hex
   escape instead of "\\\\". This is consistent with other users of
   PrintEscapedString.

llvm-svn: 58343
2008-10-28 19:33:02 +00:00
Nick Lewycky c5a68d26d9 Fix an obvious copy/pasto.
llvm-svn: 58231
2008-10-27 07:28:44 +00:00
Bill Wendling 97f7de8875 Fix type-o in ExprMapKeyType::operator ==(). The "&&" was missing.
Patch by Frits van Bommel!

llvm-svn: 58175
2008-10-26 00:19:56 +00:00
Gordon Henriksen bf40eee91a Related to PR2911, reject as invalid non-pointer GC roots.
llvm-svn: 58143
2008-10-25 16:28:35 +00:00
Daniel Dunbar 81b5fa5620 Move Print*Pass to use raw_ostream.
llvm-svn: 57946
2008-10-22 03:25:22 +00:00
Oscar Fuentes f3c03b02dc CMake: Turned some libraries into partially linked objects. Corrected
names of LLVMCore and ARMCodeGen.

llvm-svn: 57943
2008-10-22 02:51:53 +00:00
Oscar Fuentes 7089213eec CMake: updated lib/VMCore/CMakeLists.txt
llvm-svn: 57937
2008-10-21 23:52:03 +00:00
Daniel Dunbar 54d5b9ea2c Privatize PrintModulePass and PrintFunctionPass and add
createPrintModulePass and createPrintFunctionPass.
 - So clients who compile w/o RTTI can use them.

llvm-svn: 57933
2008-10-21 23:33:38 +00:00
Chris Lattner 860df6e84c Keep track of *which* input constraint matches an output
constraint.  Reject asms where an output has multiple
input constraints tied to it.

llvm-svn: 57687
2008-10-17 16:47:46 +00:00
Gabor Greif 0bd120e817 Introduce a typing refinenement on tagged data
using the 'volatile' qualifier. This should not have any operational consequences
on code, because tags should always be stripped off (giving a non-volatile pointer)
before dereferencing. The new qualification is there to catch some attempts to use
tagged pointers in a context where an untagged pointer is appropriate.

Notably this approach does not catch dereferencing of tagged pointers, but helps
in separating the two concepts a bit.

llvm-svn: 57641
2008-10-16 15:33:02 +00:00
Chris Lattner 229f765dbe Verify prefetch arguments, PR2576.
llvm-svn: 57626
2008-10-16 06:00:36 +00:00
Chris Lattner 1baace07c4 apply Eli's patch for PR2165 and provide a testcase.
llvm-svn: 57625
2008-10-16 05:26:51 +00:00
Dan Gohman fc27e25a6e Fix Instruction::isIdenticalTo and isSameOperationAs to recognize
additional information in Loads, Stores, Calls, Invokes,
InsertValueInsts, and ExtractValueInsts.

llvm-svn: 57620
2008-10-16 01:24:45 +00:00
Dan Gohman 7847142f26 Correct the name of isTrapping in comments.
llvm-svn: 57606
2008-10-15 22:56:21 +00:00
Dan Gohman c7e00ba60f Fix a missing space after the return type in invoke statements.
This fixes PR2894.

llvm-svn: 57589
2008-10-15 18:02:08 +00:00
Daniel Dunbar 0f8155ae4e Prevent assert when using '"' in names (via hexadecimal).
Update LangRef to mention \xx quoting in names.

llvm-svn: 57538
2008-10-14 23:51:43 +00:00
Daniel Dunbar 389529a7df Change getLLVMName to use raw_ostream & PrintLLVMName.
- Avoids duplicated quotification code.
 - Remove QuoteNameIfNeeded.
 - No functionality change.

llvm-svn: 57537
2008-10-14 23:28:09 +00:00
Daniel Dunbar d94184395f Unbreak DbgStopPointInst::getFileName().
llvm-svn: 57373
2008-10-11 06:40:56 +00:00
Dale Johannesen 4f0bd68cfe Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger.  Restore return value to
IEEE754.  Adjust all users accordingly.

llvm-svn: 57329
2008-10-09 23:00:39 +00:00
Dale Johannesen 54306fe499 Rename APFloat::convertToAPInt to bitcastToAPInt to
make it clearer what the function does.  No functional
change.

llvm-svn: 57325
2008-10-09 18:53:47 +00:00
Duncan Sands 26ff6f9c54 Add <cstdio> include where needed by gcc-4.4.
Patch by Samuel Tardieu.

llvm-svn: 57291
2008-10-08 07:23:46 +00:00