1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 13:02:52 +02:00
Commit Graph

1071 Commits

Author SHA1 Message Date
Benjamin Kramer
49b3c58272 Fix odd declaration.
llvm-svn: 90138
2009-11-30 15:52:29 +00:00
Tobias Grosser
74c7605daf Remove ShortNames from getNodeLabel in DOTGraphTraits
llvm-svn: 90134
2009-11-30 12:38:47 +00:00
Tobias Grosser
48d8ba7043 Instantiate DefaultDOTGraphTraits
llvm-svn: 90133
2009-11-30 12:38:13 +00:00
Tobias Grosser
4b6d3d58f6 Do not point edge heads to source labels
If no destination label is available, just point to the node itself
instead of pointing to some source label. Source and destination labels are
not related in any way.

llvm-svn: 90132
2009-11-30 12:37:39 +00:00
Tobias Grosser
72a78e2a22 Only print edgeSourceLabels if they are not empty
Graphviz can layout the graphs better if a node does not contain source
ports. Therefore only print the ports if the source ports are useful,
that means are not labeled with the empty string "".
This patch also simplifies graphs without any edgeSourceLabels e.g. the
dominance trees.

llvm-svn: 90131
2009-11-30 12:24:40 +00:00
Daniel Dunbar
11a4dce179 SourceMgr: Add ShowLine argument to PrintMessage, to allow suppressing the source line output.
llvm-svn: 89627
2009-11-22 22:08:00 +00:00
Daniel Dunbar
d4a7e3e760 Use ExtractElementInst::Create instead of new; patch by Artur Pietrek!
llvm-svn: 89606
2009-11-22 18:27:43 +00:00
Jeffrey Yasskin
eaf0187422 Remove spurious @verbatim. Patch by Timo Juhani Lindfors!
llvm-svn: 89252
2009-11-18 22:04:44 +00:00
Duncan Sands
bebe645914 Following a suggestion of Daniel Dunbar, stop people passing the name
as the isSigned bool to CreateIntCast by having this resolve to a call
to a private method, rather than by using a gcc attribute.

llvm-svn: 89067
2009-11-17 08:34:52 +00:00
Douglas Gregor
a92bd85bea Make ERROR_IF_USED macro work with GCC <= 4.2, Apple GCCs
llvm-svn: 88916
2009-11-16 16:56:48 +00:00
Duncan Sands
d67a1e3fa8 Make sure that if anyone passes a name by accident for the isSigned
parameter of CreateIntCast then they get an error from the compiler
(or from the linker with a non-gcc compiler).  Another possibility
is to flip the order of the DestTy and isSigned parameters, since you
should then get a compiler warning if you try to use a char* for a
Type*.

llvm-svn: 88913
2009-11-16 15:28:17 +00:00
Chris Lattner
5bbbe72be5 add attributes for readnone/readonly functions.
llvm-svn: 88862
2009-11-15 19:54:31 +00:00
Benjamin Kramer
e9ba686ab8 Implement DISABLE_INLINE for MSVC. This required changing the position in all
forward declaration and patching tblgen to emit it right. Patch by Amine Khaldi!

llvm-svn: 88798
2009-11-14 16:37:18 +00:00
Benjamin Kramer
521985553a Make NORETURN working with MSVC. MSVC only accepts NORETURN in front of the
decl so move it there. GCC accepts it both in front and after decls.

llvm-svn: 88791
2009-11-14 14:14:58 +00:00
Nuno Lopes
aa4a883855 implement shl, ashr, and lshr methods. shl is not fully implemented as it is quite tricky.
llvm-svn: 86986
2009-11-12 14:53:53 +00:00
Devang Patel
304b516363 Add SetDebugLocation() variant to
add debug info location to an instruction.

llvm-svn: 86859
2009-11-11 19:06:06 +00:00
Chris Lattner
1f7f78ea94 jump threading does everything that condprop does any more. This passes
bootstrap on darwin i386.

llvm-svn: 86758
2009-11-10 23:54:10 +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
Nuno Lopes
5b15b50af4 add zextOrTrunc and sextOrTrunc methods, that are similar to the ones in APInt
llvm-svn: 86549
2009-11-09 15:36:28 +00:00
Daniel Dunbar
4daaf9d3f4 Pass StringRef by value.
llvm-svn: 86251
2009-11-06 10:58:06 +00:00
Chris Lattner
6a31c1141c remove some more Context arguments.
llvm-svn: 86235
2009-11-06 05:59:53 +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
Dan Gohman
8d72615df7 InstrTypes.h includes Instruction.h, so it's not necessary to include both.
llvm-svn: 86162
2009-11-05 19:42:20 +00:00
Douglas Gregor
2272ca3d44 Move llvm:🆑:opt's conversion function into the base classes that
actually need that conversion function. Silences a Clang++ warning.

llvm-svn: 86148
2009-11-05 18:30:50 +00:00
Chris Lattner
d04294d7b8 Declare classes with matched tags, pointed out by a clang++ warning.
llvm-svn: 86144
2009-11-05 17:51:44 +00:00
Douglas Gregor
eff068fbcb Make two more LLVM headers standalone
llvm-svn: 86131
2009-11-05 13:39:23 +00:00
Douglas Gregor
4f2fc40ae8 Make a few headers standalone. Plus, add a missing "template" keyword
that Clang diagnoses but GCC does not.

llvm-svn: 86130
2009-11-05 13:30:28 +00:00
Chris Lattner
dddec653f1 make IRBuilder zap "X|0" and "X&-1" when building IR, this happens
during bitfield codegen and slows down -O0 compile times by making
useless IR.  rdar://7362516

llvm-svn: 86006
2009-11-04 05:00:12 +00:00
Chris Lattner
3ea71a58aa turn IPSCCP back on by default, try #3 or 4? Woo.
llvm-svn: 85929
2009-11-03 19:35:13 +00:00
Duncan Sands
531ed64b09 Run the functionattrs pass after the inliner, and not before.
This makes both logical sense (see below) and increases the
number of functions marked readnone/readonly by about 1-2%
in practice.  The number of functions marked nocapture goes
up by about 5-10%.  The reason it makes sense is shown by
the following example: if you run -functionattrs -inline on
it, then no attributes are assigned.  But if you instead run
-inline -functionattrs then @f is marked readnone because the
simplifications produced by the inliner eliminate the store.

@x = external global i32

define void @w(i1 %b) {
        br i1 %b, label %write, label %return
write:
        store i32 1, i32 *@x
        br label %return
return:
        ret void
}

define void @f() {
        call void @w(i1 0)
        ret void
}

llvm-svn: 85893
2009-11-03 09:40:08 +00:00
Daniel Dunbar
b5c7546aaf Speculatively redisable IPSCCP, I think its still breaking things.
llvm-svn: 85884
2009-11-03 07:49:22 +00:00
Chris Lattner
b1dfdadabd turn IPSCCP back on now that the iterator invalidation bug is fixed.
llvm-svn: 85858
2009-11-03 03:42:51 +00:00
Chris Lattner
6f515d4ba8 revert r8579[56], which are causing unhappiness in buildbot land.
llvm-svn: 85818
2009-11-02 19:31:10 +00:00
Chris Lattner
8243ac1abf now that ip sccp *really* subsumes ipcp, remove ipcp again.
llvm-svn: 85796
2009-11-02 07:34:29 +00:00
Chris Lattner
dc9cf48396 fix two strange things in the default passmgr:
1. we'd run simplifycfg at the very start, even though
the per function passes have already cleaned this up.

2. In the main per-function pipeline that is interlaced with inlining 
   etc, we would do instcombine, jump threading, simplifycfg *before*
   doing SROA.  SROA is much more likely to expose opportunities for
   these passes than they are for SROA, so move SRoA up earlier.

also add some comments.

llvm-svn: 85742
2009-11-01 20:41:59 +00:00
Chris Lattner
2db49d0a22 IPSCCP apparently is not a superset of IPCP, this is bad,
but I'll investigate it separately.  This unbreaks 
test/FrontendC/weak_constant.c

llvm-svn: 85735
2009-11-01 19:29:12 +00:00
Chris Lattner
73fa16be5d only run GlobalDCE at -O3 and run it late instead of early.
GlobalOpt already deletes trivially dead functions/globals,
so GlobalDCE only adds values for cycles of dead things.

llvm-svn: 85731
2009-11-01 19:09:12 +00:00
Chris Lattner
69549467e3 We currently only run ipsccp at LTO time, which is silly. It subsumes
ipconstprop and doesn't take much time.  Just run it in its place.

This adds a testcase for it, which I plan to expand to cover other
"integration" cases, where we expect the optimizer to be able to
eliminate various things.  Due to phase order issues we've regressed
in a number of areas and integration tests are the only way I see to
prevent this.

llvm-svn: 85729
2009-11-01 18:57:49 +00:00
Evan Cheng
eb9c268ba0 Rather than having llvm-gcc changing the meaning of OptimizeSize, just make sure loop unswitch is conservative when optimization level is < 3.
llvm-svn: 85581
2009-10-30 07:23:49 +00:00
Chris Lattner
64ba3671c9 add IRBuilder support for IndirectBr
llvm-svn: 85445
2009-10-28 23:25:00 +00:00
Chris Lattner
a77d439989 add a new 'SetCurrentDebugType' API (requested by Andrew Haley for JIT
stuff) to programmatically control the current debug flavor.  While 
I'm at it, doxygenate Debug.h and clean it up.

llvm-svn: 85395
2009-10-28 15:32:19 +00:00
Chris Lattner
2bc8002f4c rename indbr -> indirectbr to appease the residents of #llvm.
llvm-svn: 85351
2009-10-28 00:19:10 +00:00
Chris Lattner
fdda543cea add enough support for indirect branch for the feature test to pass
(assembler,asmprinter, bc reader+writer) and document it.  Codegen
currently aborts on it.

llvm-svn: 85274
2009-10-27 19:13:16 +00:00
Chris Lattner
71d02f1af8 lang points out that the comment is out of date with the code.
llvm-svn: 85203
2009-10-27 04:58:10 +00:00
Victor Hernandez
673c036bc7 Remove FreeInst.
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.

llvm-svn: 85176
2009-10-26 23:43:48 +00:00
Dan Gohman
7c0dc4ab00 Add CreateZExtOrBitCast and CreateSExtOrBitCast to TargetFolder
for consistency with ConstantFolder.

llvm-svn: 85137
2009-10-26 18:36:40 +00:00
Chandler Carruth
766362c707 Move DataTypes.h to include/llvm/System, update all users. This breaks the last
direct inclusion edge from System to Support.

llvm-svn: 85086
2009-10-26 01:35:46 +00:00
Victor Hernandez
e8998896f5 Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.

llvm-svn: 84987
2009-10-24 04:23:03 +00:00
Victor Hernandez
8428eb5720 Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
llvm-svn: 84969
2009-10-23 21:09:37 +00:00
Jeffrey Yasskin
e90afea0ba Try r84890 again (adding ValueMap<>), now that I've tested the compile on
gcc-4.4.

llvm-svn: 84902
2009-10-22 22:11:22 +00:00
Jeffrey Yasskin
7555ed8cdc Revert r84890, which broke the linux build.
llvm-svn: 84892
2009-10-22 20:23:43 +00:00
Jeffrey Yasskin
ad8692124f Add a ValueMap<ValueOrSubclass*, T> type. ValueMap<Value*, T> is safe to use
even when keys get RAUWed and deleted during its lifetime. By default the keys
act like WeakVHs, but users can pass a third template parameter to configure
how updates work and whether to do anything beyond updating the map on each
action.

It's also possible to automatically acquire a lock around ValueMap updates
triggered by RAUWs and deletes, to support the ExecutionEngine.

llvm-svn: 84890
2009-10-22 20:10:20 +00:00
Devang Patel
7edc7aa34d Cosmetic changes.
s/validName/isValidName/g
s/with an Instruction/to an Instruction/g
s/RegisterMDKind/registerMDKind/g

llvm-svn: 84689
2009-10-20 22:50:27 +00:00
Jeffrey Yasskin
fdb36c1a29 Clean up the JITResolver stub/callsite<->function maps.
The JITResolver maps Functions to their canonical stubs and all callsites for
lazily-compiled functions to their target Functions. To make Function
destruction work, I'm going to need to remove all callsites on destruction, so
this patch also adds the reverse mapping for that.

There was an incorrect assumption in here that the only stub for a function
would be the one caused by needing to lazily compile it, while x86-64 far calls
and dlsym-stubs could also cause such stubs, but I didn't look for a test case
that the assumption broke.

This also adds DenseMapInfo<AssertingVH> so I can use DenseMaps instead of
std::maps.

llvm-svn: 84522
2009-10-19 18:49:59 +00:00
Eric Christopher
41d8dc960b More warnings patrol: Another unused argument and more implicit
conversions.

llvm-svn: 84382
2009-10-17 23:56:18 +00:00
Daniel Dunbar
5aa3eebc5d Add raw_ostream::write_escaped, for writing escaped strings.
llvm-svn: 84355
2009-10-17 20:43:08 +00:00
Victor Hernandez
a25a2890fa Remove MallocInst from LLVM Instructions.
llvm-svn: 84299
2009-10-17 01:18:07 +00:00
Eric Christopher
fd8bbb9270 One more iteration here and a yet better way to solve it.
llvm-svn: 84150
2009-10-14 22:14:18 +00:00
Eric Christopher
11e07e9ef1 Fix the unused argument problem here a different way - cast to void.
llvm-svn: 84147
2009-10-14 21:45:49 +00:00
Dan Gohman
ae76dc48d6 Delete bogus semicolons.
llvm-svn: 84132
2009-10-14 20:39:01 +00:00
Eric Christopher
a7407c0921 Remove a bunch of unused arguments from functions, silencing a
warning.

llvm-svn: 84130
2009-10-14 20:28:33 +00:00
Devang Patel
72f708ec2f s/DebugLoc.CompileUnit/DebugLoc.Scope/g
s/DebugLoc.InlinedLoc/DebugLoc.InlinedAtLoc/g

llvm-svn: 84054
2009-10-13 23:28:53 +00:00
Douglas Gregor
1fd6052176 Add is_same type trait
llvm-svn: 84029
2009-10-13 21:17:00 +00:00
Jeffrey Yasskin
7d85d5a366 Fix http://llvm.org/PR5160, to let CallbackVHs modify other ValueHandles on the
same Value without breaking things.

llvm-svn: 83861
2009-10-12 17:43:32 +00:00
Chris Lattner
2a0366af9e add a helper for matching "1".
llvm-svn: 83760
2009-10-11 07:51:25 +00:00
Chris Lattner
a9bbfdf699 there is no need to run mem2reg after jump threading at LTO time now.
llvm-svn: 83753
2009-10-11 04:17:33 +00:00
Chris Lattner
54621efc37 add some WeakVH::operator='s. Without these, assigning
a Value* to a WeakVH was constructing a temporary WeakVH
(due to the implicit assignment operator).  This avoids
that cost.

llvm-svn: 83704
2009-10-10 08:27:29 +00:00
Evan Cheng
1a5c370be3 Rename enum NumOccurrences to NumOccurrencesFlag since there is a member named NumOccurrences.
llvm-svn: 83273
2009-10-04 05:25:42 +00:00
Douglas Gregor
a3fb17c280 Teach CMake to look for bidirectional_iterator, iterator, forward_iterator, uint64_t, and u_int64_t, from Yonggang Luo
llvm-svn: 83203
2009-10-01 17:25:36 +00:00
Devang Patel
4f1147e386 Add another MDNode into DebugLocTuple. This will be used to keep track of inlined functions.
llvm-svn: 83190
2009-10-01 01:15:28 +00:00
Devang Patel
292bcd8ca1 Only one custom meadata of each kind can be attached with an instruction.
llvm-svn: 83105
2009-09-29 20:30:57 +00:00
Devang Patel
d836a7d651 Do not use global typedef for MDKindID.
llvm-svn: 83016
2009-09-28 21:14:55 +00:00
Chris Lattner
b47463f436 remove support for "NoSub" from regex. It seems like a minor optimization
and makes the API more annoying.  Add a Regex::getNumMatches() method.

llvm-svn: 82877
2009-09-26 21:27:04 +00:00
Duncan Sands
ec5d64fdd5 For the NSWSub support in the builder to actually be useable,
there need to be corresponding changes to the constant folders,
done in this patch.

llvm-svn: 82862
2009-09-26 15:35:35 +00:00
Duncan Sands
64511993cb Add methods for creating NSW subtraction, as already exists
for addition.

llvm-svn: 82860
2009-09-26 15:21:48 +00:00
Chris Lattner
af2ce37cb3 add and document regex support for FileCheck. You can now do stuff like:
; CHECK: movl {{%e[a-z][xi]}}, %eax

or whatever.

llvm-svn: 82717
2009-09-24 21:47:32 +00:00
Chris Lattner
b1ee14d64b tidy up, fix a memory leak in Regex::isValid
llvm-svn: 82707
2009-09-24 20:15:51 +00:00
Dan Gohman
2967c534f7 Correct a comment.
llvm-svn: 82648
2009-09-23 20:40:16 +00:00
Devang Patel
9253538963 s/*Location/*DebugLocation/g
llvm-svn: 82635
2009-09-23 17:20:43 +00:00
John McCall
24a3aba8b8 Make the type traits for a const pointer defer to those for a unqualified
pointer, instead of providing independent values modelled on the default
implementation.

llvm-svn: 82620
2009-09-23 06:53:51 +00:00
Devang Patel
d3d28d0f25 Add SetLocation() to allow IRBuilder user to set location info for an instruction already created.
llvm-svn: 82570
2009-09-22 20:56:31 +00:00
Devang Patel
d785fbf971 Check exisiting dbg MDKind first.
llvm-svn: 82568
2009-09-22 20:54:13 +00:00
Daniel Dunbar
595fbf539a Revert "Don't allow formatted_ostream to be unbuffered, even if its underlying
buffer", while we work out a solution.

Dan convinced me that making debugging annoying for him is worse than 10x being
slower for me. :)

llvm-svn: 82553
2009-09-22 16:33:42 +00:00
Daniel Dunbar
6d5513977b Add a TrackingVH value handle.
This is designed for tracking a value even when it might move (like WeakVH), but it is an error to delete the referenced value (unlike WeakVH0. TrackingVH is templated like AssertingVH on the tracked Value subclass, it is an error to RAUW a tracked value to an incompatible type.

For implementation reasons the latter error is only diagnosed on accesses to a mis-RAUWed TrackingVH, because we don't want a virtual interface in a templated class.

The former error is also only diagnosed on access, so that clients are allowed to delete a tracked value, as long as they don't use it. This makes it easier for the client to reason about destruction.

llvm-svn: 82506
2009-09-22 02:02:33 +00:00
Daniel Dunbar
84e383fc42 Don't allow formatted_ostream to be unbuffered, even if its underlying buffer
is.
 - The problem is that formatted_ostream forces its underlying buffer to be
   unbuffered, so if some client happens to wrap a formatted_ostream around
   something, but still use the underlying stream, then we can end up writing on
   a fully unbuffered output (which was never intended to be unbuffered).

 - This makes clang (and presumably llvm-gcc) -emit-llvm -S a mere 10x faster.

llvm-svn: 82434
2009-09-21 03:56:00 +00:00
Chris Lattner
acb70ff251 smallvectorize getExtraOptionNames
llvm-svn: 82377
2009-09-20 06:21:43 +00:00
Daniel Dunbar
27de063176 A few more tabs -> spaces.
llvm-svn: 82358
2009-09-20 04:03:25 +00:00
Chris Lattner
85478e8cd1 convert a bunch more stuff to use StringRef. The ArgName arguments are now
stringref because they may not be nul terminated.  For options like -Lfoo
this now avoids a O(n)  temporary std::strings where N is the length of 
the string after -L.

llvm-svn: 82345
2009-09-20 00:40:49 +00:00
Daniel Dunbar
39c0d90339 Strip trailing whitespace.
llvm-svn: 82332
2009-09-19 20:40:05 +00:00
Daniel Dunbar
1cc4f6eb9e RHS of assignment should be const reference.
llvm-svn: 82331
2009-09-19 20:39:50 +00:00
Chris Lattner
86c1fbbc0a convert a bunch of std::strings to use StringRef. This should eliminate
a massive number of temporary strings created when parsing a command line.
More still left to eliminate.

llvm-svn: 82318
2009-09-19 18:55:05 +00:00
Chris Lattner
084409a543 remove an extraneous mem2reg pass early in the pipe. Since
this is run after the 'standard function passes', SRoA was
recently run.  This saves a domfrontier construction. Thanks
to Eli for noticing this.

llvm-svn: 82291
2009-09-18 22:03:29 +00:00
Chris Lattner
8deb752897 reduce indentation by using an early exit, and add a comment,
no functionality change.

llvm-svn: 82290
2009-09-18 22:01:30 +00:00
Anton Korobeynikov
fb7ac49d96 Allow symbols to start from the digit if target requests it. This allows, e.g. pinning
variables to specified absolute address. Make use of this feature for MSP430.
This unbreaks PR4776.

llvm-svn: 82227
2009-09-18 16:57:42 +00:00
Julien Lerouge
2f6ea4ae21 Use __attribute__((__used__)) if GCC >= 3.1 (seems to be the oldest GCC
supporting this attribute).

llvm-svn: 82177
2009-09-17 23:27:10 +00:00
Devang Patel
ae097e977b Add an interface to attach debugging information with an instruction.
llvm-svn: 82062
2009-09-16 18:16:11 +00:00
Daniel Dunbar
f1b6d523e4 Drop the raw_ostream required buffer size to 1.
- As best I can tell, we have eliminated all the code which used to require a
   larger buffer size.

llvm-svn: 81912
2009-09-15 20:31:46 +00:00
Dan Gohman
4e86738fa7 Fix apostrophos.
llvm-svn: 81856
2009-09-15 15:08:33 +00:00
Dan Gohman
149ac38d37 Fix llvm-extract's "writing bitcode to a terminal" warning, which wasn't
working. To support this, add an is_displayed() function to raw_ostream,
and generalize Process::StandardOutIsDisplayed and friends in order to
support it.

Also, call RemoveFileOnSignal before creating a file instead of after, so
that the file isn't left behind if the program is interrupted between when
the file is created and RemoveFileOnSignal is called.

While here, add a -S to llvm-extract and port it to IRReader so that it
supports assembly input.

llvm-svn: 81568
2009-09-11 20:46:33 +00:00