summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* CodeGen: Reference temporaries inherit visibilityDavid Majnemer2014-04-291-0/+3
| | | | | | | Reference temporaries inherited many properties from the variable that they correspond to but visibility wasn't one of them. llvm-svn: 207496
* Debug info: Improve line table for functions with cleanups an early exitAdrian Prantl2014-04-291-0/+20
| | | | | | | | | | | | | and no return expr at the end of the function. The "function has only simple returns" check in FinishFunction tests whether the number of simple return exprs equals the number of return exprs, but so far a fallthrough at the end of a function was not counted as a return, which would result in cleanup code being associated with the wrong source line. rdar://problem/16733984. llvm-svn: 207480
* CodeGen: Fix linkage of reference temporariesDavid Majnemer2014-04-284-102/+110
| | | | | | | | | | | | | | | Summary: A reference temporary should inherit the linkage of the variable it initializes. Otherwise, we may hit cases where a reference temporary wouldn't have the same value in all translation units. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3515 llvm-svn: 207451
* [ARM64]Fix a bug cannot select UQSHL/SQSHL with constant i64 shift amount.Hao Liu2014-04-281-10/+6
| | | | llvm-svn: 207401
* CodeGen: remove an unused variableSaleem Abdulrasool2014-04-281-3/+0
| | | | llvm-svn: 207390
* remove useless codeSylvestre Ledru2014-04-271-1/+0
| | | | llvm-svn: 207360
* Fixed Assert In CGRecordLoweringWarren Hunt2014-04-251-6/+23
| | | | | | | | | | | Prior to this patch, CGRecordLower assumed that virtual bases could not be placed before the nvsize of an object. This isn't true in Itanium mode, virtual bases are placed at dsize rather than vnsize and in the case of zero sized non-virtual bases nvsize can be larger than dsize. This patch fixes CGRecordLowering to avoid an assert and to clip bitfields properly in this case. A test case is included. llvm-svn: 207280
* CodeGen: add __yield intrinsic for ARMSaleem Abdulrasool2014-04-251-0/+5
| | | | | | | | | The __yield intrinsic generates a hint instruction to indicate that the thread is not performing any useful operations at the moment. This is for compatibility with MSVC, although, the intrinsic is also part of the ACLE, and is enabled globally as a result. llvm-svn: 207275
* CodeGen: replace use of @llvm.arm.sevl with @llvm.arm.hintSaleem Abdulrasool2014-04-251-2/+2
| | | | | | | Use the new generic @llvm.arm.hint hint intrinsic rather than the specialised @llvm.arm.sevl hint instruction. llvm-svn: 207243
* CodeGen: Cleanup variable linkage calculationDavid Majnemer2014-04-251-9/+18
| | | | | | | | | | Almost all linkage calculation for VarDecls occured inside of GetLLVMLinkageVarDefinition except for static data members. Centralize the logic so that it can be more readily reused. No functionality change. llvm-svn: 207241
* CodeGen: Refactor linkage/visibility calculationDavid Majnemer2014-04-251-33/+27
| | | | | | | | | | It turns out that linkage and visibility have rather similar logic for both functions and non-variable globals. Split the calculation out so that both sides may share this code. No functionality change. llvm-svn: 207239
* CodeGen: Avoid instrumenting implicit Decls more effectivelyJustin Bogner2014-04-251-2/+4
| | | | | | | | | | We don't assign counters for implicit Decls, but we were emitting code to increment the (non-existent) counters and adding empty counter lists in the output. This fixes the checks in assignRegionCounters and emitInstrumentationData to do the right thing, and adds an assert for the pathological case of emitting zero counters. llvm-svn: 207203
* MS ABI: Use a different guard variable for each weak globalReid Kleckner2014-04-231-11/+16
| | | | | | | | | | We were using the same guard variable and failing to initialize the second global. Clang is still not MS ABI compatible in this area. Fixing that is PR16959, which will require LLVM changes to @llvm.global_ctors. llvm-svn: 207008
* Objective-C [IRGen]. Fixes a crash in IRGen involving use ofFariborz Jahanian2014-04-231-1/+4
| | | | | | | 'typeof' to extract type of an @encode expression used in an initializer. // rdar://16655340 llvm-svn: 207004
* [ARM64] Add a missed case label for arm64_be, and enable the aarch64-varargs ↵James Molloy2014-04-231-1/+2
| | | | | | | | test for arm64_be. This ensures that r203917 (cpirker "AArch64_be varargs processing for ARM ABI") is ported to ARM64. llvm-svn: 206961
* CodeGen: Unify handling guard variables in the Itanium C++ ABIJustin Bogner2014-04-231-41/+39
| | | | | | | | | | | | | | | We previously treated ARM separately from the generic Itanium ABI for initializing guard variables. This code duplication led to things like the ARM path missing the memory barrier for threadsafe handling, and a highly misleading comment about how we were (mis)using the generic ABI for ARM64 when really it went through the ARM codepath. This unifies the two code paths. Functionally, this changes the ARM and ARM64 codepath to use one byte loads instead of 4 and 8, respectively, and adds the missing atomic acquire to these loads. Other architectures are unchanged. llvm-svn: 206937
* Use a manipulator to add a value to the current diagnostic flag.Diego Novillo2014-04-221-3/+2
| | | | | | | | | | | | | | Summary: This addresses the feedback to http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140421/103598.html Reviewers: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3453 llvm-svn: 206920
* Allow adding a value to a flag in diagnostics.Diego Novillo2014-04-211-1/+2
| | | | | | | | | | | | | | | | | Summary: This allows callers of Diags.Report() to append a value to the name of the flag associated with the diagnostic. This is useful in cases like the -Rpass flag, where we want the diagnostic to show the name of the pass that matched the pattern. Instead of showing "... [-Rpass]", this allows us to show "... [-Rpass=passname]". Reviewers: rsmith CC: cfe-commits Differential Revision: http://reviews.llvm.org/D3441 llvm-svn: 206826
* [Modules] Remove the only use of the DEBUG(...) macro in the compilerChandler Carruth2014-04-211-1/+0
| | | | | | | | parts of Clang. I don't really have any opinion about whether using that macro is good or bad, but its odd that this is the only one, and Eric seemed happy with just nuking it for now. llvm-svn: 206806
* ARM64: Do not expand variadic HFA/HVA arguments with the Darwin ABI.Bob Wilson2014-04-211-6/+24
| | | | | | | | | | | Unlike the standard AAPCS64 ABI, variadic arguments are always passed on the stack with the Darwin ABI, and this was not being considered when deciding whether to expand HFA/HVA arguments in a call. An HFA argument with a "float" base type was being expanded into separate "float" arguments, each of which was then extended to a double, resulting in a serious mismatch from what is expected by the va_arg implementation. <rdar://problem/15777067> llvm-svn: 206729
* Fix a comment typo.Bob Wilson2014-04-211-1/+1
| | | | llvm-svn: 206728
* Remove some empty statementsAlp Toker2014-04-192-2/+2
| | | | | | Cleanup only. llvm-svn: 206709
* When a module completes the definition of a class template specialization ↵Richard Smith2014-04-192-3/+5
| | | | | | imported from another module, emit an update record, rather than using the broken decl rewriting mechanism. If multiple modules do this, merge the definitions together, much as we would if they were separate declarations. llvm-svn: 206680
* CodeGen: Remove an unused includeJustin Bogner2014-04-181-1/+0
| | | | llvm-svn: 206667
* CodeGen: Use LLVM's InstrProfReader in -fprofile-instr-use=Justin Bogner2014-04-185-177/+31
| | | | | | | | | Update clang to use the InstrProfReader from LLVM to read instrumentation based profile data. This also switches us from the naive text format to the binary format, since that's what's implemented in the reader. llvm-svn: 206658
* [Cleanup] Remove a trailing whitespaceJustin Bogner2014-04-181-1/+1
| | | | llvm-svn: 206657
* ARM64: make sure the caller is expected to extend in AAPCS.Tim Northover2014-04-181-2/+3
| | | | | | | This is one of those DarwinPCS differences. It'd been caught in arguments, but not return values. llvm-svn: 206594
* ARM64: make sure HFAs on the stack get properly aligned.Tim Northover2014-04-181-7/+8
| | | | | | Another AAPCS bug, part of PR19432. llvm-svn: 206580
* BackendUtil: Pass through -mdisable-tail-callsDuncan P. N. Exon Smith2014-04-181-0/+1
| | | | | | | | | | | | | | | The frontend option -fno-optimize-sibling-calls resolves to -cc1's -mdisable-tail-calls, which is passed to the TargetMachine in the backend. PassManagerBuilder was adding the -tailcallelim pass anyway. Use a new DisableTailCalls option in PassManagerBuilder to disable tail calls harder. Requires the matching commit in LLVM that adds DisableTailCalls. <rdar://problem/16050591> llvm-svn: 206543
* Bug 18567: Fix constantexpr pointer casts with address spaces.Matt Arsenault2014-04-171-1/+3
| | | | | | | Getting a pointer into a struct at a non-zero offset would try to use the default address space. llvm-svn: 206478
* ARM64: remove holes from *all* HFAs on the stack.Tim Northover2014-04-171-13/+15
| | | | | | | | | | My first attempt to make sure HFAs were contiguous was in the block dealing with padding registers, which meant it only triggered on the first stack-based HFA. This should extend it to the rest as well. Another part of PR19432. llvm-svn: 206456
* Adding type info for f16c floating-point type. This is consistent with theYunzhong Gao2014-04-171-1/+2
| | | | | | | | Itanium ABI in 2.9.2 Place of Emission. Differential Revision: http://reviews.llvm.org/D2750 llvm-svn: 206439
* Further simplify r206430.Adrian Prantl2014-04-171-13/+4
| | | | | | rdar://problem/16636569. llvm-svn: 206434
* Debug info: When collecting the parameters of C++ partial templateAdrian Prantl2014-04-171-4/+10
| | | | | | | | | | | | specializations collect all arguments and not just the ones from the class template partial specialization from which this class template specialization was instantiated. The debug info does not represent the partial specialization otherwise and so specialized parameters would go missing. rdar://problem/16636569. llvm-svn: 206430
* Add support for optimization reports.Diego Novillo2014-04-161-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a new flag -Rpass=. The flag indicates the name of the optimization pass that should emit remarks stating when it made a transformation to the code. This implements the design I proposed in: https://docs.google.com/document/d/1FYUatSjZZO-zmFBxjOiuOzAy9mhHA8hqdvklZv68WuQ/edit?usp=sharing Other changes: - Add DiagnosticIDs::isRemark(). Use it in printDiagnosticOptions to print "-R" instead of "-W" in the diagnostic message. - In BackendConsumer::OptimizationRemarkHandler, get a SourceLocation object out of the file name, line and column number. Use that location in the call to Diags.Report(). - When -Rpass is used without debug info a note is emitted alerting the user that they need to use -gline-tables-only -gcolumn-info to get this information. CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3226 llvm-svn: 206401
* InstrProf: Calculate a better function hashDuncan P. N. Exon Smith2014-04-161-7/+131
| | | | | | | | | | | | | | | | | | The function hash should change when control flow changes. This patch hashes the type of each AST node that affects counters, rather than just counting how many there are. These types are combined into a small enumerator that currently has 16 values. The new hash algorithm packs the enums for consecutively visited types into a `uint64_t`. In order to save space for new types, the types are assumed to be 6-bit values (instead of 4-bit). In order to minimize overhead for functions with little control flow, the `uint64_t` is used directly as a hash if it never fills up; if it does, it's passed through an MD5 context. <rdar://problem/16435801> llvm-svn: 206397
* CodeGen: Emit warnings for out of date profile data during PGOJustin Bogner2014-04-153-2/+25
| | | | | | | | | This adds a warning that triggers when profile data doesn't match for the source that's being compiled with -fprofile-instr-use=. This fires only once per translation unit, as warning on every mismatched function would be quite noisy. llvm-svn: 206322
* CodeGen: Remove a comment that isn't in the right placeJustin Bogner2014-04-151-4/+0
| | | | | | | This comment also appears elsewhere where it actually makes sense, and it's just confusing here. llvm-svn: 206321
* Replace push_back()s by initializer list for shorter and cleaner code.Eli Bendersky2014-04-151-5/+3
| | | | llvm-svn: 206304
* Add support for CUDA __launch_bounds__ attribute to CodeGen.Eli Bendersky2014-04-151-10/+28
| | | | | | | | | | Sema does have a CUDALaunchBoundsAttr, but CodeGen was doing nothing with it. This change translates CUDALaunchBoundsAttr to maxntidx and minctasm metadata, which NVPTX then translates to the correct PTX directives. Patch by Manjunath Kudlur. llvm-svn: 206302
* verify-di: Call debug info verifier from clangDuncan P. N. Exon Smith2014-04-151-0/+2
| | | | | | | | | This is paired with a patch to LLVM that creates a separate pass for verifying debug info. <rdar://problem/15500563> llvm-svn: 206301
* ARM64: track alignment padding registers on AAPCS targetsTim Northover2014-04-151-1/+9
| | | | | | | | | | This implements clause C.8 of the AAPCS in the front-end, so that Clang accurately knows when the registers run out and it has to insert padding before the stack objects begin. PR19432. llvm-svn: 206296
* CodeGen: Handle CapturedStmt in instrumentation based profilingJustin Bogner2014-04-153-0/+19
| | | | | | | | CapturedStmt was being ignored by instrumentation based profiling, and its counters attributed to the containing function. Instead, we need to treat this as a top level entity, like we do with blocks. llvm-svn: 206231
* Ensure we evaluate VLA bounds if a variably-modified type is used as theRichard Smith2014-04-141-0/+4
| | | | | | | argument to __builtin_va_arg. Patch by Rahul Jain, some test massaging and IR emission order changes by me. llvm-svn: 206223
* Follow-up to r205999: Emit an artificial location (valid scope, line 0)Adrian Prantl2014-04-111-43/+54
| | | | | | | | | for CXXGlobalInit/Dtor helper functions. This makes _GLOBAL__I_a regain its DW_AT_high/low_pc in the debug info. Thanks to echristo for catching this! llvm-svn: 206088
* CodeGen: Fix handling of C++11 lambdas in profilingJustin Bogner2014-04-111-3/+9
| | | | | | | | | Until now we were generating duplicate counters for lambdas: one set in the function where the lambda was declared and another for the lambda itself. Instead, we should skip over the bodies of lambdas in their containing contexts. llvm-svn: 206081
* [PGO] Change MapRegionCounters to be a RecursiveASTVisitor.Bob Wilson2014-04-111-132/+75
| | | | | | | This avoids the overhead of specifying all the traversal code when using ConstStmtVisitor and makes it a lot easier to maintain this. llvm-svn: 206039
* CodeGen: Handle binary conditional operators in PGO instrumentationJustin Bogner2014-04-111-2/+4
| | | | | | | This treats binary conditional operators in the same way as ternary conditional operators for instrumentation based profiling. llvm-svn: 206021
* Cleanup: Add default arguments to CodeGenFunction::StartFunction.Adrian Prantl2014-04-114-16/+12
| | | | | | Thanks dblaikie for the suggestion! llvm-svn: 206012
* Switch from constexpr to const char *constDuncan P. N. Exon Smith2014-04-111-2/+2
| | | | | | Responding to Richard Smith's review of r205037. llvm-svn: 206008
OpenPOWER on IntegriCloud