- Mar 10, 2014
-
-
Evan Cheng authored
optimize a call to a llvm intrinsic to something that invovles a call to a C library call, make sure it sets the right calling convention on the call. e.g. extern double pow(double, double); double t(double x) { return pow(10, x); } Compiles to something like this for AAPCS-VFP: define arm_aapcs_vfpcc double @t(double %x) #0 { entry: %0 = call double @llvm.pow.f64(double 1.000000e+01, double %x) ret double %0 } declare double @llvm.pow.f64(double, double) #1 Simplify libcall (part of instcombine) will turn the above into: define arm_aapcs_vfpcc double @t(double %x) #0 { entry: %__exp10 = call double @__exp10(double %x) #1 ret double %__exp10 } declare double @__exp10(double) The pre-instcombine code works because calls to LLVM builtins are special. Instruction selection will chose the right calling convention for the call. However, the code after instcombine is wrong. The call to __exp10 will use the C calling convention. I can think of 3 options to fix this. 1. Make "C" calling convention just work since the target should know what CC is being used. This doesn't work because each function can use different CC with the "pcs" attribute. 2. Have Clang add the right CC keyword on the calls to LLVM builtin. This will work but it doesn't match the LLVM IR specification which states these are "Standard C Library Intrinsics". 3. Fix simplify libcall so the resulting calls to the C routines will have the proper CC keyword. e.g. %__exp10 = call arm_aapcs_vfpcc double @__exp10(double %x) #1 This works and is the solution I implemented here. Both solutions #2 and #3 would work. After carefully considering the pros and cons, I decided to implement #3 for the following reasons. 1. It doesn't change the "spec" of the intrinsics. 2. It's a self-contained fix. There are a couple of potential downsides. 1. There could be other places in the optimizer that is broken in the same way that's not addressed by this. 2. There could be other calling conventions that need to be propagated by simplify-libcall that's not handled. But for now, this is the fix that I'm most comfortable with. llvm-svn: 203488
-
Ed Maste authored
llvm-svn: 203487
-
Sebastian Pop authored
llvm-svn: 203486
-
Eli Bendersky authored
[forgot to 'svn add' before committing r203483] llvm-svn: 203485
-
Sasa Stankovic authored
* Add masking instructions before loads and stores (in MC layer). * Add masking instructions after SP changes (in MC layer). * Forbid loads, stores and SP changes in delay slots (in MI layer). Differential Revision: http://llvm-reviews.chandlerc.com/D2904 llvm-svn: 203484
-
Eli Bendersky authored
NVPTX, like the other backends, relies on generic symbol name sanitizing done by MCSymbol. However, the ptxas assembler is more stringent and disallows some additional characters in symbol names. See PR19099 for more details. llvm-svn: 203483
-
Tim Northover authored
Patch by Manuel Jacob. llvm-svn: 203482
-
Tim Northover authored
There's now a normal UI for that, apparently. Patch by Manuel Jacob. llvm-svn: 203481
-
Marshall Clow authored
More tests for LWG Issue #2263; this time to the associative and unordered containers. Still no changes to libc++ llvm-svn: 203480
-
Marshall Clow authored
Added tests to the sequence containers for for LWG Issue #2263. Comparing iterators and allocator pointers with different const-character. No changes to libc++ llvm-svn: 203479
-
Marshall Clow authored
Mark issues #2357 (wording changes in the standard, no functionality change) and #2132 (libc++ already does this) as complete. llvm-svn: 203478
-
Benjamin Kramer authored
[C++11] Avoid implicit conversion of ArrayRef to std::vector and use move semantics where appropriate. llvm-svn: 203477
-
Tobias Grosser authored
This is necessary to avoid test failures in the CLooG test suite due to the recent isl update. We also need to update two polly test cases which rely on a certain order in the textual description that isl chooses for its sets and maps. Changes here are not often, but we should probably switch to a check that verifies such maps are semantically equivalent instead of represented identically. llvm-svn: 203476
-
Ed Maste authored
What was use_iterator is now user_iterator. Also switch to range-based APIs, as in Clang r203365. (This part of the change was missed in r203463) Differential Revision: http://llvm-reviews.chandlerc.com/D3030 llvm-svn: 203475
-
Aaron Ballman authored
[C++11] Replacing DeclBase iterators specific_attr_begin() and specific_attr_end() with iterator_range specific_attrs(). Updating all of the usages of the iterators with range-based for loops. llvm-svn: 203474
-
Rafael Espindola authored
llvm-svn: 203473
-
Adam Nemet authored
llvm-svn: 203472
-
Rafael Espindola authored
This will replace the now badly named CLANG_IS_PRODUCTION. llvm-svn: 203471
-
Viktor Kutuzov authored
A fix for platform-dependent types in sanitizers' profiling support lib on x64 FreeBSD in 32-bit mode llvm-svn: 203470
-
Reed Kotler authored
llvm-svn: 203469
-
JF Bastien authored
llvm-svn: 203468
-
Samuel Benzaquen authored
Summary: Add loc() to the dynamic registry. Other fixes: - Fix the polymorphic variant value to accept an exact match, even if there are other possible conversions. - Fix specifiesTypeLoc() to not crash on an empty NestedNameSpecifierLoc. Reviewers: klimek CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2928 llvm-svn: 203467
-
Daniel Jasper authored
Before: void f() { bar([]() {}// Does not respect SpacesBeforeTrailingComments ); } After: void f() { bar([]() {} // Does not respect SpacesBeforeTrailingComments ); } This fixes llvm.org/PR19017. llvm-svn: 203466
-
Benjamin Kramer authored
No functionality change. llvm-svn: 203465
-
Daniel Sanders authored
Summary: This is a white lie to workaround a widespread bug in the -mfp64 implementation. The problem is that none of the 32-bit fpu ops mention the fact that they clobber the upper 32-bits of the 64-bit FPR. This allows MFHC1 to be scheduled on the wrong side of most 32-bit FPU ops. Fixing that requires a major overhaul of the FPU implementation which can't be done right now due to time constraints. MFHC1 is one of two affected instructions. These instructions are the only FPU instructions that don't read or write the lower 32-bits. We therefore pretend that it reads the bottom 32-bits to artificially create a dependency and prevent the scheduler changing the behaviour of the code. The other instruction is MTHC1 which will be fixed once I've have found a failing test case for it. The testcase is test-suite/SingleSource/UnitTests/Vector/simple.c when given TARGET_CFLAGS="-mips32r2 -mfp64 -mmsa". Reviewers: jacksprat, matheusalmeida Reviewed By: jacksprat Differential Revision: http://llvm-reviews.chandlerc.com/D2966 llvm-svn: 203464
-
Ed Maste authored
What was use_iterator is now user_iterator. Also switch to range-based APIs, as in Clang r203365. llvm-svn: 203463
-
Tobias Grosser authored
Older isl versions did not properly guard all function declarations for the use in C++. Specifically, the isl/val_gmp.h header was not properly guarded. This patch ensures we have the proper guards in place and do not accidentally link to name-mangled C++ versions of those functions that are not available in libisl.so. llvm-svn: 203462
-
Aaron Ballman authored
Reverting llvm::distance changes to use std::distance with iterators instead, per post-commit review feedback. Replacing llvm::copy changes with SmallVector range-based construction which is a considerably cleaner approach. llvm-svn: 203461
-
Aaron Ballman authored
Removing llvm::distance and llvm::copy for iterator_range based on post-commit review feedback. Adding an explicit range-based constructor to SmallVector, which supersedes the llvm::copy functionality. llvm-svn: 203460
-
Matheus Almeida authored
llvm-svn: 203459
-
Alexander Kornienko authored
Summary: If we need to break the second line here: // something: aaaaa aaaaa aaaaaa aaaaa aaaaa // aaaaa aaaaa aaaaaa aaaaa aaaaa aaaaa with the patch it will be turned to // something: aaaaa aaaaa aaaaaa aaaaa aaaaa // aaaaa aaaaa aaaaaa aaaaa aaaaa // aaaaa instead of // something: aaaaa aaaaa aaaaaa aaaaa aaaaa // aaaaa aaaaa aaaaaa aaaaa aaaaa // aaaaa Reviewers: djasper, klimek Reviewed By: klimek CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2988 llvm-svn: 203458
-
Alexander Kornienko authored
Summary: This is immediately useful for generating macro expansion notes, and may be useful for other things later on. Reviewers: klimek, djasper Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2950 llvm-svn: 203457
-
Tobias Grosser authored
llvm-svn: 203456
-
Robert Lytton authored
llvm-svn: 203455
-
Daniel Jasper authored
Before: int c = []()->int { return 2; }(); After: int c = []() -> int { return 2; }(); llvm-svn: 203452
-
Alexander Kornienko authored
Summary: Peter, I guess, this can help you in testing your check. Reviewers: djasper, pcc, klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2989 llvm-svn: 203451
-
Tim Northover authored
The function was making too many assumptions about its input: 1. The NEON_VDUP optimisation was far too aggressive, assuming (I think) that the input would always be BUILD_VECTOR. 2. We were treating most unknown concats as legal (by returning Op rather than SDValue()). I think only concats of pairs of vectors are actually legal. http://llvm.org/PR19094 llvm-svn: 203450
-
Jason Molenda authored
Seed the QueueItem objects with the item_refs and addresses when they are fetched in one batch. If additional information is needed from the QueueItem, fetch it lazily one pending item per function call. <rdar://problem/16270007>, <rdar://problem/16032150> llvm-svn: 203449
-
Chandler Carruth authored
as well. I don't see any particular need but it imposes no cost to support it and it makes the API cleaner. llvm-svn: 203448
-
Chandler Carruth authored
now that there is essentially no cost to doing so. Yay C++11. llvm-svn: 203447
-