Commit Graph

113 Commits

Author SHA1 Message Date
Chris Lattner 1362602eb2 Change Pass::print to take a raw ostream instead of std::ostream,
update all code that this affects.

llvm-svn: 79830
2009-08-23 06:03:38 +00:00
Owen Anderson 55f1c09e31 Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Owen Anderson 5a1acd9912 Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.

llvm-svn: 77721
2009-07-31 20:28:14 +00:00
Owen Anderson edb4a70325 Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
llvm-svn: 77011
2009-07-24 23:12:02 +00:00
Owen Anderson 47db941fd3 Get rid of the Pass+Context magic.
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Owen Anderson b6b2530000 Move EVER MORE stuff over to LLVMContext.
llvm-svn: 75703
2009-07-14 23:09:55 +00:00
Torok Edwin fbcc663cbf llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Torok Edwin 6cdb897258 eliminate extra space.
llvm-svn: 75630
2009-07-14 12:22:58 +00:00
Owen Anderson 53a52215b5 Begin the painful process of tearing apart the rat'ss nest that is Constants.cpp and ConstantFold.cpp.
This involves temporarily hard wiring some parts to use the global context.  This isn't ideal, but it's
the only way I could figure out to make this process vaguely incremental.

llvm-svn: 75445
2009-07-13 04:09:18 +00:00
Chris Lattner 7b9d6ebb9c remove llvm.part.set.* and llvm.part.select.*. They have never been
implemented in codegen, have no frontend to generate them, and are 
better implemented with pattern matching (like the ppc backend does
to generate rlwimi/rlwinm etc).

PR4543

llvm-svn: 75430
2009-07-12 21:08:53 +00:00
Torok Edwin 56d0659726 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.

llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Torok Edwin ccb29cd290 Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
and abort()/exit() -> llvm_report_error().

llvm-svn: 75363
2009-07-11 13:10:19 +00:00
Owen Anderson a771459bb1 Push LLVMContext _back_ through IRBuilder.
llvm-svn: 75040
2009-07-08 20:50:47 +00:00
Owen Anderson 4c472e1cfa Get rid of these cache variables, which are a holdover from the days when
we had multiple type planes and these lookups were expensive.

llvm-svn: 74319
2009-06-26 20:33:47 +00:00
Owen Anderson b5042f20e7 Now with EVEN FEWER statics!
llvm-svn: 74143
2009-06-25 00:04:15 +00:00
Jay Foad 9a968a8b17 Switch to using IRBuilder throughout.
llvm-svn: 71587
2009-05-12 20:27:44 +00:00
Jay Foad aa9c019461 Don't generate redundant casts of constant values when lowering calls to
memcpy, memmove and memset.

llvm-svn: 71427
2009-05-11 11:32:25 +00:00
Duncan Sands 12da8ce3d2 Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr.  These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global.  In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time.   This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function.  If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body.  The
code generators on the other hand map weak and weak_odr linkage
to the same thing.

llvm-svn: 66339
2009-03-07 15:45:40 +00:00
Chris Lattner d8f0786c31 Add missing break statements, fixing PR3503.
llvm-svn: 64040
2009-02-07 22:37:06 +00:00
Zhou Sheng 4b23938fb9 As Duncan suggested, add braces for the one-line "else branch".
Thanks, Duncan.

llvm-svn: 63389
2009-01-30 09:44:49 +00:00
Zhou Sheng 25b6f8153e This is to fix the bug in IntrinsicLowering.cpp,
the LowerPartSet(). It didn't handle the situation correctly when
the low, high argument values are in reverse order (low > high)
with 'Val' type i32 (a corner case).

llvm-svn: 63388
2009-01-30 09:02:50 +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
Dale Johannesen f1acc4d610 More refactoring. Yawn.
llvm-svn: 56468
2008-09-22 20:51:30 +00:00
Dale Johannesen 7beddb8680 Refactor FP intrinisic setup. Per review feedback.
llvm-svn: 56456
2008-09-22 19:51:58 +00:00
Dale Johannesen da2d80688b Add intrinsics for log, log2, log10, exp, exp2.
No functional change (and no FE change to generate them).

llvm-svn: 55753
2008-09-04 00:47:13 +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
Gabor Greif e9ecc68d8f API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.

llvm-svn: 49277
2008-04-06 20:25:17 +00:00
Chris Lattner f3ebc3f3d2 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Christopher Lamb edf0788758 Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.
llvm-svn: 45082
2007-12-17 01:12:55 +00:00
Anton Korobeynikov 66b91e66ec Implement necessary bits for flt_rounds gcc builtin.
Codegen bits and llvm-gcc support will follow.

llvm-svn: 44182
2007-11-15 23:25:33 +00:00
Dan Gohman 9aa4fc5cd6 Teach IntrinsicLowering.cpp about the sin, cos, and pow intrinsics.
llvm-svn: 43020
2007-10-15 22:07:31 +00:00
Dale Johannesen 4d4e77af8e Rewrite sqrt and powi to use anyfloat. By popular demand.
llvm-svn: 42537
2007-10-02 17:43:59 +00:00
Dale Johannesen 6bf69ed3cc minor long double related changes
llvm-svn: 42439
2007-09-28 18:06:58 +00:00
Anton Korobeynikov 122bf4be7e Split eh.select / eh.typeid.for intrinsics into i32/i64 versions. This is needed, because they just "mark" register
liveins and we let frontend solve type issue, not lowering code :)

llvm-svn: 41763
2007-09-07 11:39:35 +00:00
Owen Anderson e2f23a3abf Add lengthof and endof templates that hide a lot of sizeof computations.
Patch by Sterling Stein!

llvm-svn: 41758
2007-09-07 04:06:50 +00:00
Chris Lattner 079ebcfae5 Fix a regression compiling 2005-05-11-Popcount-ffs-fls with the CBE,
introduced by chandler's patch.

llvm-svn: 40864
2007-08-06 16:36:18 +00:00
David Greene 17a5dfe6f7 New CallInst interface to address GLIBCXX_DEBUG errors caused by
indexing an empty std::vector.

Updates to all clients.

llvm-svn: 40660
2007-08-01 03:43:44 +00:00
Duncan Sands 9d97420473 The exception handling intrinsics return values,
so must be lowered to a value, not nothing at all.
Subtle point: I made eh_selector return 0 and
eh_typeid_for return 1.  This means that only
cleanups (destructors) will be run as the exception
unwinds [if eh_typeid_for returned 0 then it would
be as if the first catch always matched, and the
corresponding handler would be run], which is
probably want you want in the CBE.

llvm-svn: 37947
2007-07-06 14:46:23 +00:00
Duncan Sands fe80638417 Extend eh.selector to support both catches and filters.
Drop the eh.filter intrinsic.

llvm-svn: 37875
2007-07-04 20:52:51 +00:00
Tanya Lattner e199f97fa8 Codegen support (stripped out) for the annotate attribute.
llvm-svn: 37608
2007-06-15 22:26:58 +00:00
Lauro Ramos Venancio 4c2f003971 Fix a typo in bswap lowering.
llvm-svn: 37544
2007-06-11 23:16:16 +00:00
Zhou Sheng 0a0ae932ca Make LowerCTPOP() support arbitrary bitwidth integer type.
llvm-svn: 37397
2007-06-02 04:10:33 +00:00
Zhou Sheng d7dc1ed64c Correct the logic in LowerPartSet which cleared the bits from 0 to low-1.
llvm-svn: 37331
2007-05-26 03:43:13 +00:00
Reid Spencer daed139420 Un-brain-dead-ify the lowering of part set for the reverse case.
llvm-svn: 37071
2007-05-15 02:26:52 +00:00
Reid Spencer 764ae2a21b Give names to the final result values of the part_set computations. This
just aids in readability and debugability of the output. No functional change.

llvm-svn: 37037
2007-05-14 17:21:17 +00:00
Reid Spencer bf283708f7 Get the size of auto arrays right, regardless of its changing size.
llvm-svn: 37006
2007-05-12 11:07:40 +00:00
Reid Spencer 58ec791b4c Fix problems in the PartSet lowering having to do with incorrect bit width.
llvm-svn: 36180
2007-04-16 22:21:14 +00:00
Reid Spencer 1b9213730f Make sure intrinsics that are lowered to functions make the function weak
linkage so we only end up with one of them in a program. These are, after
all overloaded and templatish in nature.

llvm-svn: 35956
2007-04-12 21:53:38 +00:00