1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 22:42:46 +02:00
Commit Graph

3184 Commits

Author SHA1 Message Date
John McCall
57eaeeca78 Qualify a bunch of explicit template instantiations to satisfy clang++.
llvm-svn: 91736
2009-12-19 00:55:12 +00:00
John McCall
fdae393452 Put TypesEqual and TypeHasCycleThroughItself in namespace llvm so ADL from
the templates in TypesContext.h can find them.  Caught by clang++.

llvm-svn: 91735
2009-12-19 00:51:42 +00:00
Eli Friedman
a5dba5246a Fix gcc warning.
llvm-svn: 91715
2009-12-18 21:07:18 +00:00
Rafael Espindola
c58aaaf793 Catch more cases of a pointer being marked garbage twice. This helps when
debugging some leaks (PR5770 in particular).

llvm-svn: 91713
2009-12-18 20:35:38 +00:00
Victor Hernandez
44652ca549 Formalize MDNode's function-localness:
- an MDNode is designated as function-local when created, and continues to be even if its operands are modified not to refer to function-local IR
- function-localness is designated via lowest bit in SubclassData
- getLocalFunction() descends MDNode tree to see if it is consistently function-local

Add verification of MDNodes to checks that MDNodes are consistently function-local.
Update AsmWriter to use isFunctionLocal().

llvm-svn: 91708
2009-12-18 20:09:14 +00:00
Dan Gohman
3ceb7c0c47 Add utility routines for NSW multiply.
llvm-svn: 91664
2009-12-18 03:10:26 +00:00
Dan Gohman
6bb50740f4 Add utility routines for creating integer negation operators with NSW set.
Integer negation only overflows with INT_MIN, but that's an important case.

llvm-svn: 91662
2009-12-18 02:58:50 +00:00
Jeffrey Yasskin
9afe974318 This fixes a memory leak in OpaqueType found by Google's internal heapchecker.
llvm-svn: 91611
2009-12-17 19:55:06 +00:00
Eli Friedman
5c7e38b936 Aggressively flip compare constant expressions where appropriate; constant
folding in particular expects null to be on the RHS.

llvm-svn: 91587
2009-12-17 06:07:04 +00:00
Victor Hernandez
f6bcc2747e Use different name for argument and field
llvm-svn: 91524
2009-12-16 08:10:57 +00:00
Victor Hernandez
e91192950c MDNodes that refer to an instruction are local to a function; in that case, explicitly keep track of the function they are local to
llvm-svn: 91497
2009-12-16 02:52:09 +00:00
Chris Lattner
587962c667 Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait.  This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.

llvm-svn: 91421
2009-12-15 07:26:43 +00:00
Dan Gohman
d16b19ff3e Move several function bodies which are rarely inlined out of line.
llvm-svn: 91319
2009-12-14 19:43:09 +00:00
Duncan Sands
d73da0fbb9 Add utility method for determining whether a function argument
has the 'nest' attribute.

llvm-svn: 91109
2009-12-11 08:36:17 +00:00
Benjamin Kramer
2d6d1651cf Remove useless calls to c_str().
llvm-svn: 90855
2009-12-08 13:07:38 +00:00
Chris Lattner
acc9c4f542 whitespace cleanup
llvm-svn: 90834
2009-12-08 05:31:46 +00:00
Anton Korobeynikov
fadc276b81 Add MSP430 interrupt calling conv. No functionality change yet.
llvm-svn: 90738
2009-12-07 02:27:35 +00:00
Victor Hernandez
e865bc76ad Avoid creating a metadata slot for all metadata that contains an instruction
llvm-svn: 90581
2009-12-04 20:07:10 +00:00
Victor Hernandez
aae1944c56 Fix crasher when N->getElement(n) is NULL
llvm-svn: 90572
2009-12-04 18:29:23 +00:00
Andreas Neustifter
c427ec12c0 Added debug output for inherited passes that are invalidated.
llvm-svn: 90553
2009-12-04 06:58:24 +00:00
Victor Hernandez
8baca1a2de Teach AsmWriter to write inline (not via a global metadata slot) metadata that contains an instruction
llvm-svn: 90512
2009-12-04 01:35:02 +00:00
Chris Lattner
9ce833945e improve portability to avoid conflicting with std::next in c++'0x.
Patch by Howard Hinnant!

llvm-svn: 90365
2009-12-03 00:50:42 +00:00
Nick Lewycky
44573bb42b Oops! Fix bug introduced in my recent cleanup change. Thanks to Tobias Grosser
for pointing this out.

llvm-svn: 90015
2009-11-27 19:57:53 +00:00
Nick Lewycky
c0a516186a Fix typo spotted by Gabor Greif.
llvm-svn: 89976
2009-11-26 23:19:05 +00:00
Nick Lewycky
07c3eb54a4 Clean up file, no functionality change.
llvm-svn: 89974
2009-11-26 22:54:26 +00:00
Dan Gohman
29dbc79996 Move FunctionPassManagerImpl's dumpArguments and dumpPasses calls
out of its run function and into its doInitialization method, so
that it does the dump once instead of once per function.

llvm-svn: 89660
2009-11-23 16:24:18 +00:00
Duncan Sands
efd23f129e I forgot to update the prototype for LLVMBuildIntCast when correcting
the body to not pass the name for the isSigned parameter.  However it
seems that changing prototypes is a big-no-no, so here I revert the
previous change and pass "true" for isSigned, meaning this always does
a signed cast, which was the previous behaviour assuming the name was
not NULL!  Some other C function needs to be introduced for the general
case of signed or unsigned casts.  This hopefully unbreaks the ocaml
binding.

llvm-svn: 89648
2009-11-23 10:49:03 +00:00
Nick Lewycky
deb3d7dfbc Start catching LLVMContext misuse in the verifier.
llvm-svn: 89646
2009-11-23 04:52:00 +00:00
Jeffrey Yasskin
135f2adcbb In GlobalVariable::setInitializer, assert that the initializer has the
right type.

llvm-svn: 89014
2009-11-17 00:43:13 +00:00
Duncan Sands
0503912f83 BuildIntCast takes an additional parameter, isSigned.
llvm-svn: 88910
2009-11-16 13:15:28 +00:00
Evan Cheng
9b306a1e32 Special case FixedStackPseudoSourceValueVal as well. Do we really need to differentiate PseudoSourceValueVal from FixedStackPseudoSourceValueVal at this level?
llvm-svn: 88902
2009-11-16 07:10:36 +00:00
Eric Christopher
9b6ef0d374 Remove extraneous commit.
llvm-svn: 88716
2009-11-13 23:08:47 +00:00
Eric Christopher
14bf8d4de6 Print out something, even if it's non-parseable later when we've
got ghost linkage. It's better than aborting.

llvm-svn: 88715
2009-11-13 23:00:14 +00:00
Devang Patel
c70b8eefb7 Do not use StringRef in DebugInfo interface.
This allows StringRef to skip controversial if(str) check in constructor.
Buildbots, wait for corresponding clang and llvm-gcc FE check-ins!

llvm-svn: 86914
2009-11-12 00:50:58 +00:00
Chris Lattner
a3457e6bae Reject duplicate case values in a switch, PR5450.
llvm-svn: 86846
2009-11-11 17:37:02 +00:00
Victor Hernandez
70963992b8 make this handle redefinition of malloc function with different prototype correctly
llvm-svn: 86712
2009-11-10 19:53:28 +00:00
Jeffrey Yasskin
23ac706aab Fix DenseMap iterator constness.
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.

The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.

Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.

Patch by Victor Zverovich!

llvm-svn: 86636
2009-11-10 01:02:17 +00:00
Daniel Dunbar
886e51b5c1 Fix MemoryBuffer::getSTDIN to *not* return null if stdin is empty, this is a lame API.
Also, Stringrefify some more MemoryBuffer functions, and add two performance FIXMEs.

llvm-svn: 86630
2009-11-10 00:43:58 +00:00
Chris Lattner
91fe2102eb make this handle redefinition of malloc with different prototype correctly.
llvm-svn: 86525
2009-11-09 07:12:01 +00:00
Chris Lattner
f8b7276e30 prune #include / layering violation
llvm-svn: 86365
2009-11-07 09:07:01 +00:00
Victor Hernandez
8275ebb927 Fit in 80 columns
llvm-svn: 86316
2009-11-07 00:36:50 +00:00
Victor Hernandez
8736a8fca4 Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.
Here is the original commit message:

This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments.

Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.

Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.

Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses.  The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.

Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses.  The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.

Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.

Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.

llvm-svn: 86311
2009-11-07 00:16:28 +00:00
Victor Hernandez
fe6fe378ce CallInst::CreateMalloc() and CallInst::CreateFree() need to create calls with correct calling convention
llvm-svn: 86290
2009-11-06 21:43:21 +00:00
Daniel Dunbar
4daaf9d3f4 Pass StringRef by value.
llvm-svn: 86251
2009-11-06 10:58:06 +00:00
Chris Lattner
903ae55e1c remove a bunch of extraneous LLVMContext arguments
from various APIs, addressing PR5325.

llvm-svn: 86231
2009-11-06 04:27:31 +00:00
Victor Hernandez
a5a12cd62e Revert r86077 because it caused crashes in 179.art and 175.vpr on ARM
llvm-svn: 86213
2009-11-06 01:33:24 +00:00
Victor Hernandez
21ec158c23 Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.

Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.

Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses.  The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.

Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses.  The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.

Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.

Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.

llvm-svn: 86077
2009-11-05 00:03:03 +00:00
Victor Hernandez
628b65ea6e Changes requested (avoid getFunction(), avoid Type creation via isVoidTy(), and avoid redundant isFreeCall cases) in feedback to r85176
llvm-svn: 85936
2009-11-03 20:39:35 +00:00
Chris Lattner
ad2926bbb4 remove a bunch of locking from LLVMContextImpl. Since only one thread
can be banging on a context at a time, this isn't needed.  Owen, please
review.

llvm-svn: 85728
2009-11-01 18:42:03 +00:00
Chris Lattner
55a53e4e79 the verifier shouldn't modify the IR.
llvm-svn: 85722
2009-11-01 18:11:50 +00:00