summaryrefslogtreecommitdiff
path: root/lib/CodeGen
Commit message (Collapse)AuthorAge
...
* GNUEABIHF is the same as GNUEABI for anything not float/double related,Joerg Sonnenberger2013-12-16
| | | | | | | so use the same exception size as GNUEABI does. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197404 91177308-0d34-0410-b5e6-96231b3b80d8
* Quick-Fix pointer arithmetic when performing multi-D new-array initialization.Faisal Vali2013-12-14
| | | | | | | | | | | | | | | | | | clang still doesn't emit the right llvm code when initializing multi-D arrays it seems. For e.g. the following code would still crash for me on Windows 7, 64 bit: auto f4 = new int[100][200][300]{{{1,2,3}, {4, 5, 6}}, {{10, 20, 30}}}; It seems that the final new loop that iterates through each outermost array and memsets it to zero gets confused with its final ptr arithmetic. This patch ensures that it converts the pointer to the allocated type (int [200][300]) before incrementing it (instead of using the base type: 'int'). Richard somewhat squeamishly approved the patch (as a quick fix to potentially make it into 3.4) - while exhorting for a more optimized fix in the future. http://llvm-reviews.chandlerc.com/D2398 Thanks Richard! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197294 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate BinaryTypeTraitExprAlp Toker2013-12-13
| | | | | | | | | | | | | | | | | There's nothing special about type traits accepting two arguments. This commit eliminates BinaryTypeTraitExpr and switches all related handling over to TypeTraitExpr. Also fixes a CodeGen failure with variadic type traits appearing in a non-constant expression. The BTT/TT prefix and evaluation code is retained as-is for now but will soon be further cleaned up. This is part of the ongoing work to unify type traits. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197273 91177308-0d34-0410-b5e6-96231b3b80d8
* Move C++ destructor emission into CGCXXABIReid Kleckner2013-12-13
| | | | | | | No functionality change. Only Itanium C++ destructors have implicit VTT parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197194 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove getVTT* in favor of getStructorImplicitParameter*Reid Kleckner2013-12-13
| | | | | | | No functionality change. The only remaining uses were in ItaniumCXXABI, which knows the implicit parameter is a VTT. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197189 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace use of Triple::getEnvironmentName with the simplerJoerg Sonnenberger2013-12-12
| | | | | | | Triple::getEnvironment. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197181 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Refactor NEON floating-point Max/Min/Maxnm/Minnm across vector AArch64Chad Rosier2013-12-11
| | | | | | intrinsics to use f32 types, rather than their vector equivalents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197091 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Add NEON scalar floating-point compare LLVM AArch64 intrinsics thatChad Rosier2013-12-11
| | | | | | use f32/f64 types, rather than their vector equivalents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197071 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Refactor the NEON scalar floating-point reciprocal step andChad Rosier2013-12-11
| | | | | | | floating-point reciprocal square root step LLVM AArch64 intrinsics to use f32/f64 types, rather than their vector equivalents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197070 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Refactor the NEON scalar floating-point reciprocal estimate, floating-Chad Rosier2013-12-11
| | | | | | | | point reciprocal exponent, and floating-point reciprocal square root estimate LLVM AArch64 intrinsics to use f32/f64 types, rather than their vector equivalents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197069 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-cxxabi] Fix linkage of dtor thunks for anonymous classesReid Kleckner2013-12-11
| | | | | | | | | | We were mistakengly giving linkonce_odr linkage instead of internal linkage to the deleting and complete destructor thunks for classes in anonymous namespaces. Fixes PR17273. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197060 91177308-0d34-0410-b5e6-96231b3b80d8
* Add front-end infrastructure now address space casts are in LLVM IR.David Tweed2013-12-11
| | | | | | | | | | | | With the introduction of explicit address space casts into LLVM, there's a need to provide a new cast kind the front-end can create for C/OpenCL/CUDA and code to produce address space casts from those kinds when appropriate. Patch by Michele Scandale! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197036 91177308-0d34-0410-b5e6-96231b3b80d8
* When performing an array new of a multidimensional array with an initializerRichard Smith2013-12-11
| | | | | | | | | list, each element of the initializer list may provide more than one of the base elements of the array. Be sure to initialize the right type and bump the array pointer by the right amount. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196995 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Refactor the NEON floating-point absolute difference LLVM AArch64Chad Rosier2013-12-10
| | | | | | intrinsic to use f32/f64 types, rather than their vector equivalents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196969 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Refactor the NEON signed/unsigned floating-point convert to ↵Chad Rosier2013-12-10
| | | | | | | | fixed-point LLVM AArch64 intrinsics to use f32/f64, rather than their vector equivalents. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196968 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Overload NEON signed/unsigned floating-point convert to fixed-pointChad Rosier2013-12-10
| | | | | | and fixed-point convert to floating-point LLVM AArch64 intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196967 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Overload NEON signed/unsigned integer convert to floating-pointChad Rosier2013-12-10
| | | | | | LLVM AArch64 intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196966 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Refactor the redundant code in the EmitAArch64ScalarBuiltinExpr()Chad Rosier2013-12-10
| | | | | | function. No functional change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196936 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Refactor the Neon vector/scalar floating-point convert intrinsics soChad Rosier2013-12-10
| | | | | | that they use float/double rather than the vector equivalents when appropriate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196931 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Refactor the Neon vector/scalar floating-point convert implementation.Chad Rosier2013-12-10
| | | | | | Specifically, reuse the ARM intrinsics when possible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196927 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64 NEON] Support poly128_t and implement relevant intrinsic.Kevin Qin2013-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196888 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] clang/lib: Prune redundant dependencies.NAKAMURA Takumi2013-12-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196864 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Refactor the NEON scalar reduce pairwise intrinsics so that they useChad Rosier2013-12-09
| | | | | | float/double rather than the vector equivalents when appropriate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196836 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Refactor the NEON scalar reduce pairwise front-end codegen to removeChad Rosier2013-12-09
| | | | | | unnecessary patterns in tablegen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196835 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Remove q and non-q intrinsic definitions from the NEON scalar reduceChad Rosier2013-12-09
| | | | | | pairwise implementation, using an overloaded definition instead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196834 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] clang/lib: Satisfy dependencies to add *actually used* libraries on ↵NAKAMURA Takumi2013-12-09
| | | | | | | | target_link_libraries() and LLVM_LINK_COMPONENTS. I will prune redundant dependencies later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196800 91177308-0d34-0410-b5e6-96231b3b80d8
* Save another call to GetAddrOfFunction.Rafael Espindola2013-12-09
| | | | | | | Thread an optional GV down to EmitGlobalFunctionDefinition so that it can avoid the lookup when we already know the corresponding llvm global value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196789 91177308-0d34-0410-b5e6-96231b3b80d8
* When we decide to output a deferred decl, remember the llvm GlobalValue.Rafael Espindola2013-12-09
| | | | | | | | | We can reuse it to avoid a DenseMap+StringMap lookup to find if it was already emitted or not. This fixes a 2010 TODO. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196785 91177308-0d34-0410-b5e6-96231b3b80d8
* Output destructors and constructors in a more natural order.Rafael Espindola2013-12-09
| | | | | | | | | | | | | | | | With this patch we output the in the order C2 C1 D2 D1 D0 Which means that a destructor or constructor that call another is output after the callee. This is a bit easier to read IHMO and a tiny bit more efficient as we don't put a decl in DeferredDeclsToEmit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196784 91177308-0d34-0410-b5e6-96231b3b80d8
* [-cxx-abi microsoft] Mangle large integral constants correctlyDavid Majnemer2013-12-09
| | | | | | | | | | | | | | | | | | | | Testing has revealed that large integral constants (i.e. > INT64_MAX) are always mangled as-if they are negative, even in places where it would not make sense for them to be negative (like non-type template parameters of type unsigned long long). To address this, we change the way we model number mangling: always mangle as-if our number is an int64_t. This should result in correct results when we have large unsigned numbers. N.B. Bizarrely, things that are 32-bit displacements like vbptr offsets are mangled as-if they are unsigned 32-bit numbers. This is a pretty egregious waste of space, it would be a 4x savings if we could mangle it like a signed 32-bit number. Instead, we explicitly cast these displacements to uint32_t and let the mangler proceed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196771 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid adding some decls to DeferredDeclsToEmit.Rafael Espindola2013-12-09
| | | | | | | | Before this patch GetOrCreateLLVMFunction would add a decl to DeferredDeclsToEmit even when it was being called by the function trying to emit that decl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196753 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64]Add missing pair intrinsics such as:Hao Liu2013-12-09
| | | | | | | | int32_t vminv_s32(int32x2_t a) which should be compiled into SMINP Vd.2S,Vn.2S,Vm.2S git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196750 91177308-0d34-0410-b5e6-96231b3b80d8
* GlobalAlias::isDeclaration is always false. Remove dead code.Rafael Espindola2013-12-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196727 91177308-0d34-0410-b5e6-96231b3b80d8
* CodeGen: Don't emit linkage on thunks that aren't emitted because they're ↵Benjamin Kramer2013-12-07
| | | | | | | | | | | | vararg. This can happen when we're trying to emit a thunk with available_externally linkage with optimization enabled but bail because it doesn't make sense for vararg functions. PR18098. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196658 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-cxxabi] bitcast to i8* to deref a data member pointerReid Kleckner2013-12-05
| | | | | | | | This was causing us to miscompile llvm::SymbolTableListTraits::getListOwner(), which uses data member pointers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196545 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196510 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-05
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196466 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an AdjustedType sugar node for adjusting calling conventionsReid Kleckner2013-12-05
| | | | | | | | | | | | | | | | Summary: In general, this type node can be used to represent any type adjustment that occurs implicitly without losing type sugar. The immediate use of this is to adjust the calling conventions of member function pointer types without breaking template instantiation. Fixes PR17996. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2332 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196451 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the constructor to CodeGenABITypes.Mark Lacey2013-12-05
| | | | | | | | | | | | The CodeGenOptions are not used for ABI type selection, so we will just create one with the default constructor (there is a FloatABI option in CodeGenOptions that is passed on to LLVM, but not used in Clang for LLVM IR type generation). We can use the DiagnosticsEngine on the ASTContext rather than making a client pass one in explicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196450 91177308-0d34-0410-b5e6-96231b3b80d8
* [ms-cxxabi] Construct and destroy call arguments in the correct orderReid Kleckner2013-12-04
| | | | | | | | | | | | | | | | | | | Summary: MSVC destroys arguments in the callee from left to right. Because C++ objects have to be destroyed in the reverse order of construction, Clang has to construct arguments from right to left and destroy arguments from left to right. This patch fixes the ordering by reversing the order of evaluation of all call arguments under the MS C++ ABI. Fixes PR18035. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2275 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196402 91177308-0d34-0410-b5e6-96231b3b80d8
* [SystemZ] Fix handling of pass-by-pointer argumentsRichard Sandiford2013-12-04
| | | | | | | | | | | | | | | | | I'd misunderstood getIndirect() to mean that the argument should be passed as a pointer at the ABI level, with the ByVal argument choosing caller-copy semantics over no-caller-copy (callee-copy-on-write) semantics. But getIndirect(x) actually means that x is passed by pointer at the IR level but (at least on all other targets I looked at) directly at the ABI level. getIndirect(x, false) selects a pointer to a caller-made copy, which is what SystemZ was aiming for. This fixes a miscompilation of c-index-test. Structure arguments were being passed by pointer, but no copy was being made, so a write in the callee stomped over a caller's local variable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196370 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64 NEON] Add ACLE intrinsic vceqz_f64.Kevin Qin2013-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196361 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64 NEON] Add missing compare intrinsics.Kevin Qin2013-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196359 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64]Add missing floating point convert, round and misc intrinsics.Hao Liu2013-12-03
| | | | | | | E.g. int64x1_t vcvt_s64_f64(float64x1_t a) -> FCVTZS Dd, Dn git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196211 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r196152. Hao Liu2013-12-03
| | | | | | | | | | | | | | | This is a duplicate implementation. E.g. this patch defines: float64_t vabd_f64(float64_t a, float64_t b) But there is already a similar intrinsic "vabdd_f64" with the same types. Also, this intrinsic will be conflicted to the vector type intrinsic as following(Which is implemented by me and will be committed to trunk): float64x1_t vabd_f64(float64x1_t a, float64x1_t b). Two functions shouldn't have a same name in arm_neon.h. According to ARM ACLE document, such vabd_f64 with float64_t is not existing. So I revert this commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196205 91177308-0d34-0410-b5e6-96231b3b80d8
* AArch64: Add missing scalar pair intrinsics.Hao Liu2013-12-03
| | | | | | | E.g. "float32_t vaddv_f32(float32x2_t a)" to be matched into "faddp s0, v1.2s". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196199 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Add missing NEON scalar floating-point to integer convert ACLEs.Chad Rosier2013-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196152 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Move the constant for Debug Info Version from Dwarf.h to Metadata.h.Manman Ren2013-12-02
| | | | | | | | Suggested by Eric. Paired commit with r196144. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196145 91177308-0d34-0410-b5e6-96231b3b80d8
* Expand comments for Debug Info Version.Manman Ren2013-12-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196143 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the problem that the range check for scalar narrow shift is too wide.Hao Liu2013-11-29
| | | | | | | E.g. the immediate value of vshrns_n_s16 is [1,16], which should be [1,8]. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195942 91177308-0d34-0410-b5e6-96231b3b80d8