Peter Collingbourne [Tue, 29 May 2012 13:35:35 +0000 (13:35 +0000)]
Define FLOAT in floatn.inc.
llvm-svn: 157614
Peter Collingbourne [Tue, 29 May 2012 13:35:28 +0000 (13:35 +0000)]
Add fma, hypot builtins.
llvm-svn: 157613
Stepan Dyatkovskiy [Tue, 29 May 2012 12:26:47 +0000 (12:26 +0000)]
ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to IntegersSubsetMapping.
llvm-svn: 157612
Kostya Serebryany [Tue, 29 May 2012 12:18:18 +0000 (12:18 +0000)]
[asan,tsan] Add a new directory compiler-rt/lib/sanitizer_common
which will contain code shared between asan and tsan run-times.
Naming is hard. If you can suggest a better name for the directory -- speak up.
llvm-svn: 157611
Alexey Samsonov [Tue, 29 May 2012 09:39:01 +0000 (09:39 +0000)]
Fixing ASan build on Win: don't use __asan_default_options
llvm-svn: 157608
Tobias Grosser [Tue, 29 May 2012 09:29:44 +0000 (09:29 +0000)]
ScopInfo: Store ScopStmt pointer in the domain
Store a pointer to each ScopStmt in the isl_id associated with the space of its
domain. This will later allow us to recover the statement during code
generation with isl.
llvm-svn: 157607
Tobias Grosser [Tue, 29 May 2012 09:11:59 +0000 (09:11 +0000)]
Mark the increments of the generated induction variables 'NSW'
In general, all code that we produce is NSW.
llvm-svn: 157606
Tobias Grosser [Tue, 29 May 2012 09:11:54 +0000 (09:11 +0000)]
Move executeScopConditionally() into its own file
We will reuse this function for the isl code generator.
llvm-svn: 157605
Tobias Grosser [Tue, 29 May 2012 09:11:46 +0000 (09:11 +0000)]
Move CLooG.h into include/polly/CodeGen/
llvm-svn: 157604
Alexander Potapenko [Tue, 29 May 2012 08:26:18 +0000 (08:26 +0000)]
Do not define ___asan_default_options on Windows.
llvm-svn: 157603
Alexey Samsonov [Tue, 29 May 2012 08:10:34 +0000 (08:10 +0000)]
Make Clang driver pass the last option from -g group to the compiler.
Leave a better fixme for different debug info flags
llvm-svn: 157602
Charles Davis [Tue, 29 May 2012 07:01:45 +0000 (07:01 +0000)]
Use fewer temporaries mangling APSInt objects. The performance difference
is negligible, but it makes the code clearer. Based on a suggestion by
Jordy Rose.
llvm-svn: 157601
Alexey Samsonov [Tue, 29 May 2012 06:55:01 +0000 (06:55 +0000)]
Fix atoi stub for linux introduced in r157573. This fixes compiler-rt build on linux.
llvm-svn: 157600
Peter Collingbourne [Tue, 29 May 2012 00:42:38 +0000 (00:42 +0000)]
Implement mad builtin.
llvm-svn: 157599
Peter Collingbourne [Tue, 29 May 2012 00:42:29 +0000 (00:42 +0000)]
Implement exp, exp2, log, log2, native_exp, native_exp2, native_log,
native_log2. Patch by Joshua Cranmer!
llvm-svn: 157598
Peter Collingbourne [Tue, 29 May 2012 00:42:21 +0000 (00:42 +0000)]
Fix typo in double precision case.
llvm-svn: 157597
Peter Collingbourne [Tue, 29 May 2012 00:35:18 +0000 (00:35 +0000)]
OpenCL: Fix vector conditional operator CodeGen for the case where
the operands are vectors of doubles.
llvm-svn: 157596
Peter Collingbourne [Mon, 28 May 2012 22:22:13 +0000 (22:22 +0000)]
Add fabs builtin.
llvm-svn: 157595
Peter Collingbourne [Mon, 28 May 2012 21:48:37 +0000 (21:48 +0000)]
Add llvm.fabs intrinsic.
llvm-svn: 157594
Benjamin Kramer [Mon, 28 May 2012 21:01:59 +0000 (21:01 +0000)]
Fix suspicous isIntegerType() check, found by PVS Studio (PR12357).
llvm-svn: 157593
Benjamin Kramer [Mon, 28 May 2012 20:52:48 +0000 (20:52 +0000)]
Fix suspicous hasOneUse() check, found by PVS Studio (PR12357).
llvm-svn: 157592
Peter Collingbourne [Mon, 28 May 2012 20:42:59 +0000 (20:42 +0000)]
Add some tests which had heretofore evaded 'git add'.
llvm-svn: 157591
Peter Collingbourne [Mon, 28 May 2012 20:42:54 +0000 (20:42 +0000)]
Explicit conversions.
llvm-svn: 157590
Peter Collingbourne [Mon, 28 May 2012 20:42:15 +0000 (20:42 +0000)]
Switch to the NVPTX backend.
llvm-svn: 157589
David Blaikie [Mon, 28 May 2012 19:38:42 +0000 (19:38 +0000)]
Address minor FIXME in RedeclLink to contain a PointerIntPair instead of derive from it.
Use actual factory functions rather than derived classes acting as named constructors/factories.
llvm-svn: 157588
Benjamin Kramer [Mon, 28 May 2012 19:18:16 +0000 (19:18 +0000)]
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
David Blaikie [Mon, 28 May 2012 18:23:36 +0000 (18:23 +0000)]
Remove unused variable.
llvm-svn: 157586
Dmitry Vyukov [Mon, 28 May 2012 17:33:08 +0000 (17:33 +0000)]
tsan: fix compiler warnings
llvm-svn: 157585
Dmitry Vyukov [Mon, 28 May 2012 17:32:50 +0000 (17:32 +0000)]
tsan: fix race during pthread_join/detach
llvm-svn: 157584
Charles Davis [Mon, 28 May 2012 16:53:33 +0000 (16:53 +0000)]
Fix mangling of integral template arguments between 1 and 10. Add a test case
for this. Reported by Timur Iskhodzhanov.
llvm-svn: 157583
Alexander Potapenko [Mon, 28 May 2012 16:21:19 +0000 (16:21 +0000)]
Rework the flags machinery a bit.
Clients may define the __asan_default_options char string containing the default options for the tool now.
llvm-svn: 157582
Meador Inge [Mon, 28 May 2012 15:45:43 +0000 (15:45 +0000)]
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
Alexander Potapenko [Mon, 28 May 2012 15:00:45 +0000 (15:00 +0000)]
More verbose check in AppendString.
llvm-svn: 157580
Dmitry Vyukov [Mon, 28 May 2012 14:15:39 +0000 (14:15 +0000)]
tsan: pass CFLAGS to tests
llvm-svn: 157579
Dmitry Vyukov [Mon, 28 May 2012 14:14:53 +0000 (14:14 +0000)]
tsan: be more conservative wrt symbolizer output
llvm-svn: 157578
Benjamin Kramer [Mon, 28 May 2012 14:10:31 +0000 (14:10 +0000)]
Random BitcodeReader cleanups.
llvm-svn: 157577
Stepan Dyatkovskiy [Mon, 28 May 2012 12:39:09 +0000 (12:39 +0000)]
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
Stepan Dyatkovskiy [Mon, 28 May 2012 10:11:27 +0000 (10:11 +0000)]
SwitchInst: Due to bad readability case iterators definition was moved to the end of SwitchInst.
llvm-svn: 157575
Bill Wendling [Mon, 28 May 2012 10:09:01 +0000 (10:09 +0000)]
Add support for the GCOV_PREFIX_STRIP env variable which tries to strip off the first 'n' directories from the filename.
llvm-svn: 157574
Bill Wendling [Mon, 28 May 2012 09:58:27 +0000 (09:58 +0000)]
Add stub for 'atoi'.
llvm-svn: 157573
Bill Wendling [Mon, 28 May 2012 09:46:43 +0000 (09:46 +0000)]
Simplify the logic that tries to open the GCDA file at all costs. Basically, if
we can't open the file even after creating all of the directories to it, then
just give up.
llvm-svn: 157572
Bill Wendling [Mon, 28 May 2012 09:41:48 +0000 (09:41 +0000)]
* A bit of cleanup of the 'recursive_mkdir'. No functionality change.
* Check for absolute paths before using the GCOV_PREFIX.
* Don't add an ending path separator if there's already one.
llvm-svn: 157571
Dmitry Vyukov [Mon, 28 May 2012 09:24:01 +0000 (09:24 +0000)]
tsan: increase /proc/self/maps max size (1M is far not enough)
llvm-svn: 157570
Dmitry Vyukov [Mon, 28 May 2012 07:47:35 +0000 (07:47 +0000)]
asan/tsan: rename interceptors from __xsan_xxx to __interceptor_xxx
llvm-svn: 157569
Dmitry Vyukov [Mon, 28 May 2012 07:46:42 +0000 (07:46 +0000)]
tsan: more robust detection of stack of main thread
llvm-svn: 157568
Dmitry Vyukov [Mon, 28 May 2012 07:45:35 +0000 (07:45 +0000)]
tsan: use DCHECK_GT/LT instead of plain DCHECK (better diagnostics)
llvm-svn: 157567
Dmitry Vyukov [Mon, 28 May 2012 07:44:34 +0000 (07:44 +0000)]
tsan: do not clean stack/tls for main thread
llvm-svn: 157566
Dmitry Vyukov [Mon, 28 May 2012 07:43:36 +0000 (07:43 +0000)]
asan: remove static libraries on make clean
llvm-svn: 157565
Bill Wendling [Mon, 28 May 2012 06:10:56 +0000 (06:10 +0000)]
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
Filipe Cabecinhas [Mon, 28 May 2012 04:07:56 +0000 (04:07 +0000)]
Remove all written files
llvm-svn: 157562
Charles Davis [Mon, 28 May 2012 03:54:22 +0000 (03:54 +0000)]
Fix Lang's fix. This should fix the tests for +Asserts builds.
llvm-svn: 157561
Bill Wendling [Mon, 28 May 2012 02:50:53 +0000 (02:50 +0000)]
Don't use 'strrchr', which isn't implemented here yet.
llvm-svn: 157560
Bill Wendling [Mon, 28 May 2012 02:34:34 +0000 (02:34 +0000)]
Sync with old GCOV runtime library's file.
llvm-svn: 157559
Chris Lattner [Mon, 28 May 2012 01:47:53 +0000 (01:47 +0000)]
adjust to mainline llvm API change.
llvm-svn: 157557
Chris Lattner [Mon, 28 May 2012 01:47:44 +0000 (01:47 +0000)]
switch AttrListPtr::get to take an ArrayRef, simplifying a lot of clients.
llvm-svn: 157556
Chris Lattner [Mon, 28 May 2012 01:37:08 +0000 (01:37 +0000)]
simplify code.
llvm-svn: 157555
Chris Lattner [Mon, 28 May 2012 01:29:59 +0000 (01:29 +0000)]
add some helper methods to make the type more uniform.
llvm-svn: 157554
David Blaikie [Mon, 28 May 2012 01:26:45 +0000 (01:26 +0000)]
Fix PR12960 by not attempting to correct cases when we're not actually instantiatiating a template.
This comes up in the begin/end calls of a range-for (see the included test
case). Other suggestions are welcome, though this seems to do the trick without
regressing anything.
llvm-svn: 157553
Charles Davis [Mon, 28 May 2012 00:43:56 +0000 (00:43 +0000)]
Test case for 157547. Before that patch, all the digits would be mangled
as zeroes. Now the digits are properly non-zero.
llvm-svn: 157552
Chris Lattner [Sun, 27 May 2012 23:20:41 +0000 (23:20 +0000)]
rdar://
11542750 - llvm.trap should be marked no return.
llvm-svn: 157551
Benjamin Kramer [Sun, 27 May 2012 22:53:10 +0000 (22:53 +0000)]
DenseMap: Use an early exit when there is nothing to do in DestroyAll().
llvm-svn: 157550
Benjamin Kramer [Sun, 27 May 2012 22:41:08 +0000 (22:41 +0000)]
PR12962: Fix a rare use after free when collecting virtual overrides.
The DenseMap reallocates after 64 insertions so this only happened in
large test cases under very specific circumstances.
llvm-svn: 157549
Benjamin Kramer [Sun, 27 May 2012 22:03:32 +0000 (22:03 +0000)]
PR12967: Don't crash when trying to fold a shift that's larger than the type's size.
llvm-svn: 157548
Lang Hames [Sun, 27 May 2012 21:39:49 +0000 (21:39 +0000)]
Fix call to APSInt constructor - it doesn't take an initial value, just a
bitwidth and signedness. Also rename the variable to reflect its purpose.
No test case - discovered during random code exploration.
llvm-svn: 157547
Benjamin Kramer [Sun, 27 May 2012 20:46:04 +0000 (20:46 +0000)]
IntrusiveRefCntPtr: Use the same pattern as the other operator= overloads when using rvalue refs.
llvm-svn: 157546
Chris Lattner [Sun, 27 May 2012 19:37:05 +0000 (19:37 +0000)]
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
Chris Lattner [Sun, 27 May 2012 19:35:41 +0000 (19:35 +0000)]
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
Chris Lattner [Sun, 27 May 2012 19:31:00 +0000 (19:31 +0000)]
remove two (useless) tests that use incorrect intrinsic prototypes, detected by the new intrinsic verifier.
llvm-svn: 157543
Chris Lattner [Sun, 27 May 2012 19:17:16 +0000 (19:17 +0000)]
generalize this to allow any argument.
llvm-svn: 157542
Peter Collingbourne [Sun, 27 May 2012 18:36:44 +0000 (18:36 +0000)]
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
Chris Lattner [Sun, 27 May 2012 18:28:35 +0000 (18:28 +0000)]
move some code around so that Verifier.cpp can get access to the intrinsic info table.
llvm-svn: 157540
Benjamin Kramer [Sun, 27 May 2012 17:38:30 +0000 (17:38 +0000)]
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
Benjamin Kramer [Sun, 27 May 2012 17:38:18 +0000 (17:38 +0000)]
DenseMap: Factor destruction into a common helper method.
llvm-svn: 157538
Fariborz Jahanian [Sun, 27 May 2012 16:59:48 +0000 (16:59 +0000)]
-Wdeprecated warning to include reference (as a note)
to the declaration in this patch. // rdar://
10893232
llvm-svn: 157537
Chris Lattner [Sun, 27 May 2012 16:39:08 +0000 (16:39 +0000)]
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
Benjamin Kramer [Sun, 27 May 2012 16:22:08 +0000 (16:22 +0000)]
Move-enable IntrusiveRefCntPtr.
These tend to be copied around a lot, moving it instead saves a ton of memory
accesses.
llvm-svn: 157535
Benjamin Kramer [Sun, 27 May 2012 15:32:10 +0000 (15:32 +0000)]
Pass ProgramStateRef by reference.
Retain + Release on a ref counted pointer is cheap, but not free (it adds a function call in this case).
llvm-svn: 157534
Dmitri Gribenko [Sun, 27 May 2012 14:08:44 +0000 (14:08 +0000)]
Close HTML tag properly.
llvm-svn: 157533
Benjamin Kramer [Sun, 27 May 2012 13:28:52 +0000 (13:28 +0000)]
Use the SelectorSet typedef more widely throughout Sema.
While there make it a SmallPtrSet.
llvm-svn: 157532
Benjamin Kramer [Sun, 27 May 2012 13:28:44 +0000 (13:28 +0000)]
Replace some custom hash combines with the standard stuff from DenseMapInfo.
llvm-svn: 157531
NAKAMURA Takumi [Sun, 27 May 2012 13:10:14 +0000 (13:10 +0000)]
clang/unittests/Tooling/RewriterTestContext.h: Don't try to remove TemporaryDirectory.
llvm-svn: 157530
NAKAMURA Takumi [Sun, 27 May 2012 13:02:04 +0000 (13:02 +0000)]
Path::GetTemporaryDirectory(): Add an assertion if TempDirectory is alive, to check when someone would remove the tempdir.
llvm-svn: 157529
NAKAMURA Takumi [Sun, 27 May 2012 12:59:58 +0000 (12:59 +0000)]
clang/lib/Rewrite/Rewriter.cpp: Don't try to rename opened files on Win32. Win32 doesn't allow rename/removing opened files.
llvm-svn: 157528
Benjamin Kramer [Sun, 27 May 2012 10:56:55 +0000 (10:56 +0000)]
Missed parens.
llvm-svn: 157527
Benjamin Kramer [Sun, 27 May 2012 10:24:52 +0000 (10:24 +0000)]
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
Benjamin Kramer [Sun, 27 May 2012 09:44:52 +0000 (09:44 +0000)]
SDAGBuilder: Avoid iterator invalidation harder.
vector.begin()-1 is invalid too.
llvm-svn: 157525
Charles Davis [Sat, 26 May 2012 23:12:19 +0000 (23:12 +0000)]
Mangle template instantiations properly (as of VC 7.x) when compiling for
the Microsoft Visual C++ ABI. Currently limited to type and integral
non-type arguments. Based on a patch by Timur Iskhodzhanov!
llvm-svn: 157524
Chris Lattner [Sat, 26 May 2012 23:03:52 +0000 (23:03 +0000)]
rearrange some code, no functionality change.
llvm-svn: 157523
Benjamin Kramer [Sat, 26 May 2012 21:19:12 +0000 (21:19 +0000)]
SDAGBuilder: Don't create an invalid iterator when there is only one switch case.
Found by libstdc++'s debug mode.
llvm-svn: 157522
Benjamin Kramer [Sat, 26 May 2012 20:01:32 +0000 (20:01 +0000)]
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
Benjamin Kramer [Sat, 26 May 2012 19:39:52 +0000 (19:39 +0000)]
Only emit one set of braces for __VERSION__, getClangFullRepositoryVersion already adds some.
No test as the output is highly dependend on the local configuration.
llvm-svn: 157520
Greg Clayton [Sat, 26 May 2012 17:21:14 +0000 (17:21 +0000)]
Fixed memory management issues introduced by revision 157507.
A local std::string was being filled in and then the function would return "s.c_str()".
A local StreamString (which contains a std::string) was being filled in, and essentially also returning the c string from the std::string, though it was in a the StreamString class.
The fix was to not do this by passing a stream object into StringList::Join() and fix the "arch_helper()" function to do what it should: cache the result in a global.
llvm-svn: 157519
Duncan Sands [Sat, 26 May 2012 16:42:52 +0000 (16:42 +0000)]
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
Fariborz Jahanian [Sat, 26 May 2012 16:10:06 +0000 (16:10 +0000)]
Change warning to error when property setter names conflict.
// rdar://
11528439
llvm-svn: 157517
Benjamin Kramer [Sat, 26 May 2012 14:29:37 +0000 (14:29 +0000)]
SimplifyCFG: Turn the ad-hoc std::pair that represents switch cases into an explicit struct.
llvm-svn: 157516
Benjamin Kramer [Sat, 26 May 2012 13:59:43 +0000 (13:59 +0000)]
Add support for branch weight metadata to MDBuilder and use it in various places.
llvm-svn: 157515
Benjamin Kramer [Sat, 26 May 2012 11:37:37 +0000 (11:37 +0000)]
ScoreboardHazardRecognizer: Remove dead conditional in debug code.
Negative cycles are filtered out earlier.
llvm-svn: 157514
Duncan Sands [Sat, 26 May 2012 07:47:48 +0000 (07:47 +0000)]
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
Richard Smith [Sat, 26 May 2012 06:20:46 +0000 (06:20 +0000)]
In response to some discussions on IRC, tweak the wording of the new
-Wsometimes-uninitialized diagnostics to make it clearer that the cause
of the issue may be a condition which must always evaluate to true or
false, rather than an uninitialized variable.
To emphasize this, add a new note with a fixit which removes the
impossible condition or replaces it with a constant.
Also, downgrade the diagnostic from -Wsometimes-uninitialized to
-Wconditional-uninitialized when it applies to a range-based for loop,
since the condition is not written explicitly in the code in that case.
llvm-svn: 157511
David Blaikie [Sat, 26 May 2012 05:35:39 +0000 (05:35 +0000)]
Fix indentation.
llvm-svn: 157510