1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

82612 Commits

Author SHA1 Message Date
Stepan Dyatkovskiy
23fa9fd605 ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to IntegersSubsetMapping.
llvm-svn: 157612
2012-05-29 12:26:47 +00:00
Peter Collingbourne
b5121f5f06 Add llvm.fabs intrinsic.
llvm-svn: 157594
2012-05-28 21:48:37 +00:00
Benjamin Kramer
790d8456b5 Fix suspicous hasOneUse() check, found by PVS Studio (PR12357).
llvm-svn: 157592
2012-05-28 20:52:48 +00:00
Benjamin Kramer
f5a7a0dcf1 InstCombine: Fix infinite loop when encountering switch on trivial icmp.
The test case feeds the following into InstCombine's visitSelect:
%tobool8 = icmp ne i32 0, 0
%phitmp = select i1 %tobool8, i32 3, i32 0
Then instcombine replaces the right side of the switch with 0, doesn't notice
that nothing changes and tries again indefinitely.

This fixes PR12897.

llvm-svn: 157587
2012-05-28 19:18:16 +00:00
David Blaikie
060a688430 Remove unused variable.
llvm-svn: 157586
2012-05-28 18:23:36 +00:00
Meador Inge
af8619b4de PR12696: Attribute bits above 1<<30 are not encoded in bitcode
Attribute bits above 1<<30 are now encoded correctly.  Additionally,
the encoding/decoding functionality has been hoisted to helper functions
in Attributes.h in an effort to help the encoding/decoding to stay in
sync with the Attribute bitcode definitions.

llvm-svn: 157581
2012-05-28 15:45:43 +00:00
Benjamin Kramer
c0524cbf07 Random BitcodeReader cleanups.
llvm-svn: 157577
2012-05-28 14:10:31 +00:00
Stepan Dyatkovskiy
d534e24968 PR1255: Case Ranges
Implemented IntItem - the wrapper around APInt. Why not to use APInt item directly right now?
1. It will very difficult to implement case ranges as series of small patches. We got several large and heavy patches. Each patch will about 90-120 kb. If you replace ConstantInt with APInt in SwitchInst you will need to changes at the same time all Readers,Writers and absolutely all passes that uses SwitchInst.
2. We can implement APInt pool inside and save memory space. E.g. we use several switches that works with 256 bit items (switch on signatures, or strings). We can avoid value duplicates in this case.
3. IntItem can be easyly easily replaced with APInt.
4. Currenly we can interpret IntItem both as ConstantInt and as APInt. It allows to provide SwitchInst methods that works with ConstantInt for non-updated passes.

Why I need it right now? Currently I need to update SimplifyCFG pass (EqualityComparisons). I need to work with APInts directly a lot, so peaces of code
ConstantInt *V = ...;
if (V->getValue().ugt(AnotherV->getValue()) {
  ...
}
will look awful. Much more better this way:
IntItem V = ConstantIntVal->getValue();
if (AnotherV < V) {
}

Of course any reviews are welcome.

P.S.: I'm also going to rename ConstantRangesSet to IntegersSubset, and CRSBuilder to IntegersSubsetMapping (allows to map individual subsets of integers to the BasicBlocks).
Since in future these classes will founded on APInt, it will possible to use them in more generic ways.

llvm-svn: 157576
2012-05-28 12:39:09 +00:00
Stepan Dyatkovskiy
3f34a2e3a1 SwitchInst: Due to bad readability case iterators definition was moved to the end of SwitchInst.
llvm-svn: 157575
2012-05-28 10:11:27 +00:00
Bill Wendling
9c2fb60e3d Implement the indirect counter increment code in a better way. Instead of
replicating the code for every place it's needed, we instead generate a function
that does that for us. This function is local to the executable, so there
shouldn't be any writing violations.

llvm-svn: 157564
2012-05-28 06:10:56 +00:00
Chris Lattner
afebb9fced switch AttrListPtr::get to take an ArrayRef, simplifying a lot of clients.
llvm-svn: 157556
2012-05-28 01:47:44 +00:00
Chris Lattner
8467ec2e35 simplify code.
llvm-svn: 157555
2012-05-28 01:37:08 +00:00
Chris Lattner
6cdc78cdf4 add some helper methods to make the type more uniform.
llvm-svn: 157554
2012-05-28 01:29:59 +00:00
Chris Lattner
b051169784 rdar://11542750 - llvm.trap should be marked no return.
llvm-svn: 157551
2012-05-27 23:20:41 +00:00
Benjamin Kramer
fb377a947e DenseMap: Use an early exit when there is nothing to do in DestroyAll().
llvm-svn: 157550
2012-05-27 22:53:10 +00:00
Benjamin Kramer
1e46062a2b PR12967: Don't crash when trying to fold a shift that's larger than the type's size.
llvm-svn: 157548
2012-05-27 22:03:32 +00:00
Benjamin Kramer
5144cce317 IntrusiveRefCntPtr: Use the same pattern as the other operator= overloads when using rvalue refs.
llvm-svn: 157546
2012-05-27 20:46:04 +00:00
Chris Lattner
b787e2914f Reimplement the intrinsic verifier to use the same table as Intrinsic::getDefinition,
making it stronger and more sane.

Delete the code from tblgen that produced the old code.

Besides being a path forward in intrinsic sanity, this also eliminates a bunch of
machine generated code that was compiled into Function.o

llvm-svn: 157545
2012-05-27 19:37:05 +00:00
Chris Lattner
3ae033bbe9 These tests used intrinsics with the wrong prototype. They weren't caught because
the old verifier just checked that something "was a pointer", but not that the pointee
was correct.

llvm-svn: 157544
2012-05-27 19:35:41 +00:00
Chris Lattner
b2793e10c0 remove two (useless) tests that use incorrect intrinsic prototypes, detected by the new intrinsic verifier.
llvm-svn: 157543
2012-05-27 19:31:00 +00:00
Chris Lattner
66230fbd9c generalize this to allow any argument.
llvm-svn: 157542
2012-05-27 19:17:16 +00:00
Peter Collingbourne
740b217134 Have getOrCreateSubprogramDIE store the DIE for a subprogram
definition in the map before calling itself to retrieve the
DIE for the declaration.  Without this change, if this causes
getOrCreateSubprogramDIE to be recursively called on the definition,
it will create multiple DIEs for that definition.  Fixes PR12831.

llvm-svn: 157541
2012-05-27 18:36:44 +00:00
Chris Lattner
073117cd52 move some code around so that Verifier.cpp can get access to the intrinsic info table.
llvm-svn: 157540
2012-05-27 18:28:35 +00:00
Benjamin Kramer
895da0f01a DenseMap: Provide a move ctor and move semantics for operator[] and FindAndConstruct.
The only missing part is insert(), which uses a pair of parameters and I haven't
figured out how to convert it to rvalue references. It's now possible to use a
DenseMap with std::unique_ptr values :)

llvm-svn: 157539
2012-05-27 17:38:30 +00:00
Benjamin Kramer
ceee3e117e DenseMap: Factor destruction into a common helper method.
llvm-svn: 157538
2012-05-27 17:38:18 +00:00
Chris Lattner
f5861a2e42 enhance the intrinsic info table to encode what *kind* of Any argument
it is (at the cost of 45 bytes of extra table space) so that the verifier can
start using it.

llvm-svn: 157536
2012-05-27 16:39:08 +00:00
Benjamin Kramer
c529ae7728 Move-enable IntrusiveRefCntPtr.
These tend to be copied around a lot, moving it instead saves a ton of memory
accesses.

llvm-svn: 157535
2012-05-27 16:22:08 +00:00
NAKAMURA Takumi
ec2a9415cc Path::GetTemporaryDirectory(): Add an assertion if TempDirectory is alive, to check when someone would remove the tempdir.
llvm-svn: 157529
2012-05-27 13:02:04 +00:00
Benjamin Kramer
c04cf943e2 Missed parens.
llvm-svn: 157527
2012-05-27 10:56:55 +00:00
Benjamin Kramer
204b63bf81 r157525 didn't work, just disable iterator checking.
This is obviosly right but I don't see how to do this with proper vector
iterators without building a horrible mess of workarounds.

llvm-svn: 157526
2012-05-27 10:24:52 +00:00
Benjamin Kramer
509bda0f05 SDAGBuilder: Avoid iterator invalidation harder.
vector.begin()-1 is invalid too.

llvm-svn: 157525
2012-05-27 09:44:52 +00:00
Chris Lattner
95d61a8294 rearrange some code, no functionality change.
llvm-svn: 157523
2012-05-26 23:03:52 +00:00
Benjamin Kramer
f4041e8936 SDAGBuilder: Don't create an invalid iterator when there is only one switch case.
Found by libstdc++'s debug mode.

llvm-svn: 157522
2012-05-26 21:19:12 +00:00
Benjamin Kramer
07f18e78ba SelectionDAGBuilder: When emitting small compare chains for switches order them by using edge weights.
SimplifyCFG tends to form a lot of 2-3 case switches when merging branches. Move
the most likely condition to the front so it is checked first and the others can
be skipped. This is currently not as effective as it could be because SimplifyCFG
destroys profiling metadata when merging branches and switches. Merging branch
weight metadata is tricky though.

This code touches at most 3 cases so I didn't use a proper sorting algorithm.

llvm-svn: 157521
2012-05-26 20:01:32 +00:00
Duncan Sands
a0e08bf0d4 Since commit 157467, if reassociate isn't actually going to change an expression
then it doesn't alter the instructions composing it, however it would continue
to move the instructions to just before the expression root.  Ensure it doesn't
move them either, so now it really does nothing if there is nothing to do.  That
commit also ensured that nsw etc flags weren't cleared if the expression was not
being changed.  Tweak this a bit so that it doesn't clear flags on the initial
part of a computation either if that part didn't change but later bits did.

llvm-svn: 157518
2012-05-26 16:42:52 +00:00
Benjamin Kramer
37f59f7507 SimplifyCFG: Turn the ad-hoc std::pair that represents switch cases into an explicit struct.
llvm-svn: 157516
2012-05-26 14:29:37 +00:00
Benjamin Kramer
0284253cb3 Add support for branch weight metadata to MDBuilder and use it in various places.
llvm-svn: 157515
2012-05-26 13:59:43 +00:00
Benjamin Kramer
35427d9cab ScoreboardHazardRecognizer: Remove dead conditional in debug code.
Negative cycles are filtered out earlier.

llvm-svn: 157514
2012-05-26 11:37:37 +00:00
Duncan Sands
ac716e0801 Move this debug statement earlier so it is easy to see the order in
which operands come flying out of the linearization stage.

llvm-svn: 157512
2012-05-26 07:47:48 +00:00
Bill Wendling
c2a0abf91f The llvm_gcda_increment_indirect_counter function writes to the arguments that
are passed in. However, those arguments may be in a write-protected area, as far
as the runtime library is concerned. For instance, the data could be placed into
a 'linkedit' section, which isn't writable. Emit the code from
llvm_gcda_increment_indirect_counter directly into the function instead.

Note: The code for this is ugly, and can lead to bloat. We should look into
simplifying this code instead of having all of these branches.

<rdar://problem/11181370>

llvm-svn: 157505
2012-05-25 23:55:00 +00:00
Akira Hatanaka
0a61e3a69b Fix predicate HasStandardEncoding in MipsInstrInfo.td per suggestion of
Benjamin Kramer.

llvm-svn: 157504
2012-05-25 22:15:15 +00:00
Bill Wendling
a909ffb08b Small code cleanup. No functionality change.
llvm-svn: 157502
2012-05-25 21:57:59 +00:00
Bill Wendling
3651e385d6 Open in read/write mode, creating the file if it doesn't exist.
llvm-svn: 157501
2012-05-25 21:55:06 +00:00
Nuno Lopes
eadb471c54 bounds checking: add support for byval arguments
llvm-svn: 157498
2012-05-25 21:15:17 +00:00
Akira Hatanaka
2be7cb0794 Delete MipsExpandPseudo.cpp.
llvm-svn: 157496
2012-05-25 20:54:48 +00:00
Akira Hatanaka
2d05968e4e Move the code in MipsExpandPseudo to MipsInstrInfo::expandPostRAPseudo.
Delete MipsExpandPseudo.

llvm-svn: 157495
2012-05-25 20:52:52 +00:00
Akira Hatanaka
6af9e8ba7d Remove the code that expands MIPS' .cpload directive.
llvm-svn: 157494
2012-05-25 20:46:52 +00:00
Akira Hatanaka
3514125a37 Remove the code that emits MIPS' .cprestore directive.
llvm-svn: 157493
2012-05-25 20:42:55 +00:00
Akira Hatanaka
40236c8d6c Remove pseudo instructions that are no longer used.
llvm-svn: 157492
2012-05-25 20:37:40 +00:00
Justin Holewinski
5ce4efde1e [NVPTX] Add a new test case for the newly-enabled call handling
NV_CONTRIB

llvm-svn: 157485
2012-05-25 17:20:38 +00:00