summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* PECOFF: adjust the entry point on ARM NTSaleem Abdulrasool2015-01-044-3/+61
| | | | | | | | | ARM NT assumes a purely THUMB execution, and as such requires that the address of entry point is adjusted to indicate a thumb entry point. Unconditionally adjust the AddressOfEntryPoint in the PE header for PE/COFF ARM as we only support ARM NT at the moment. llvm-svn: 225139
* [X86][SSE] Added vector packing test for pr12412Simon Pilgrim2015-01-041-0/+34
| | | | llvm-svn: 225138
* [X86][SSE] Added vector integer truncation tests - based off pr15524Simon Pilgrim2015-01-041-0/+90
| | | | llvm-svn: 225137
* Typo.Joerg Sonnenberger2015-01-041-1/+1
| | | | llvm-svn: 225136
* [PowerPC] Materialize i64 constants using rotationHal Finkel2015-01-043-33/+77
| | | | | | | | | | | | | | | | Materializing full 64-bit constants on PPC64 can be expensive, requiring up to 5 instructions depending on the locations of the non-zero bits. Sometimes materializing a rotated constant, and then applying the inverse rotation, requires fewer instructions than the direct method. If so, do that instead. In r225132, I added support for forming constants using bit inversion. In effect, this reverts that commit and replaces it with rotation support. The bit inversion is useful for turning constants that are mostly ones into ones that are mostly zeros (thus enabling a more-efficient shift-based materialization), but the same effect can be obtained by using negative constants and a rotate, and that is at least as efficient, if not more. llvm-svn: 225135
* Fix default image name to 'a.exe' on Windows, instead 'a.out'.Yaron Keren2015-01-043-2/+4
| | | | | | This applies to mingw as clang-cl already has its own logic for the filename. llvm-svn: 225134
* Fix unused variable warning for non-asserts builds. NFC.Michael Kuperstein2015-01-041-2/+2
| | | | llvm-svn: 225133
* [PowerPC] Materialize i64 constants using bit inversionHal Finkel2015-01-042-2/+50
| | | | | | | | | Materializing full 64-bit constants on PPC64 can be expensive, requiring up to 5 instructions depending on the locations of the non-zero bits. Sometimes materializing the bit-reversed constant, and then flipping the bits, requires fewer instructions than the direct method. If so, do that instead. llvm-svn: 225132
* [PM] Split the AssumptionTracker immutable pass into two separate APIs:Chandler Carruth2015-01-0465-943/+992
| | | | | | | | | | | | | | | | | | | | | | | | | | | | a cache of assumptions for a single function, and an immutable pass that manages those caches. The motivation for this change is two fold. Immutable analyses are really hacks around the current pass manager design and don't exist in the new design. This is usually OK, but it requires that the core logic of an immutable pass be reasonably partitioned off from the pass logic. This change does precisely that. As a consequence it also paves the way for the *many* utility functions that deal in the assumptions to live in both pass manager worlds by creating an separate non-pass object with its own independent API that they all rely on. Now, the only bits of the system that deal with the actual pass mechanics are those that actually need to deal with the pass mechanics. Once this separation is made, several simplifications become pretty obvious in the assumption cache itself. Rather than using a set and callback value handles, it can just be a vector of weak value handles. The callers can easily skip the handles that are null, and eventually we can wrap all of this up behind a filter iterator. For now, this adds boiler plate to the various passes, but this kind of boiler plate will end up making it possible to port these passes to the new pass manager, and so it will end up factored away pretty reasonably. llvm-svn: 225131
* clang-format: Re-enable comment re-indentation for Java/JS.Daniel Jasper2015-01-042-6/+19
| | | | | | This was broken by r224120. llvm-svn: 225130
* Fix indentation. No behavior change.Nico Weber2015-01-041-1/+1
| | | | llvm-svn: 225129
* Wrap to 80 columns, no behavior change.Nico Weber2015-01-041-4/+7
| | | | llvm-svn: 225128
* InstCombine: match can find ConstantExprs, don't assume we have a ValueDavid Majnemer2015-01-042-2/+11
| | | | | | | | | | We assumed the output of a match was a Value, this would cause us to assert because we would fail a cast<>. Instead, use a helper in the Operator family to hide the distinction between Value and Constant. This fixes PR22087. llvm-svn: 225127
* ValueTracking: ComputeNumSignBits should tolerate misshapen phi nodesDavid Majnemer2015-01-042-2/+33
| | | | | | | | | | | | PHI nodes can have zero operands in the middle of a transform. It is expected that utilities in Analysis don't freak out when this happens. Note that it is considered invalid to allow these misshapen phi nodes to make it to another pass. This fixes PR22086. llvm-svn: 225126
* Document that GetTypeForDeclarator() cannot return a null type.Nico Weber2015-01-043-18/+13
| | | | | | | | | | | | | Also add a few asserts for this. The existing code assumes this in a bunch of places already (see e.g. the assert at the top of ParseTypedefDecl(), and there are many unchecked calls on the result of GetTypeForDeclarator()), and from looking through the code this should always be true from what I can tell. This allows removing ASTContext::getNullTypeSourceInfo() too as that's now unused. No behavior change intended. llvm-svn: 225125
* Crash less enthusiasticially on _Atomic or __restrict__ on invalid types.Nico Weber2015-01-042-4/+14
| | | | | | | | | | Many places in Sema cannot handle isNull() types. This is fine, because in most places the type building code recovers by falling back to IntTy. In GetFullTypeForDeclarator(), this is done at the end of the getNumTypeObjects() loop body. This function calls BuildQualifiedType() before this fallback is done though, so it explicitly needs to check for isNull() types. llvm-svn: 225124
* [APFloat][ADT] Fix sign handling logic for FMA results that truncate to zero.Lang Hames2015-01-042-1/+42
| | | | | | | | | | | | | | This patch adds a check for underflow when truncating results back to lower precision at the end of an FMA. The additional sign handling logic in APFloat::fusedMultiplyAdd should only be performed when the result of the addition step of the FMA (in full precision) is exactly zero, not when the result underflows to zero. Unit tests for this case and related signed zero FMA results are included. Fixes <rdar://problem/18925551>. llvm-svn: 225123
* Wrap to 80 columns, no behavior change.Nico Weber2015-01-041-4/+5
| | | | llvm-svn: 225122
* AST: Remove overzealous assertion from IsModifiableDavid Majnemer2015-01-042-6/+4
| | | | | | It's reasonable to ask if an l-value with class type is modifiable. llvm-svn: 225121
* llvm-readobj: add support to dump COFF export tablesSaleem Abdulrasool2015-01-037-0/+39
| | | | | | | This enhances llvm-readobj to print out the COFF export table, similar to the -coff-import option. This is useful for testing in lld. llvm-svn: 225120
* ARM: permit tail calls to weak externals on COFFSaleem Abdulrasool2015-01-033-2/+25
| | | | | | | | | | | Weak externals are resolved statically, so we can actually generate the tail call on PE/COFF targets without breaking the requirements. It is questionable whether we want to propagate the current behaviour for MachO as the requirements are part of the ARM ELF specifications, and it seems that prior to the SVN r215890, we would have tail'ed the call. For now, be conservative and only permit it on PE/COFF where the call will always be fully resolved. llvm-svn: 225119
* Parse: __attribute__((keyword)) shouldn't errorDavid Majnemer2015-01-033-5/+6
| | | | | | | Weird constructs like __attribute__((inline)) or __attibute__((typename)) should result in warnings, not errors. llvm-svn: 225118
* [PowerPC/BlockPlacement] Allow target to provide a per-loop alignment preferenceHal Finkel2015-01-035-13/+92
| | | | | | | | | | | | | | | | | The existing code provided for specifying a global loop alignment preference. However, the preferred loop alignment might depend on the loop itself. For recent POWER cores, loops between 5 and 8 instructions should have 32-byte alignment (while the others are better with 16-byte alignment) so that the entire loop will fit in one i-cache line. To support this, getPrefLoopAlignment has been made virtual, and can be provided with an optional MachineLoop* so the target can inspect the loop before answering the query. The default behavior, as before, is to return the value set with setPrefLoopAlignment. MachineBlockPlacement now queries the target for each loop instead of only once per function. There should be no functional change for other targets. llvm-svn: 225117
* Volatile reads are side-effecting operations, but in the general case of ↵Aaron Ballman2015-01-032-3/+11
| | | | | | | | | | | access through a volatile-qualified type, we're not certain of the underlying object's side-effects on access. Treat volatile accesses as "maybe" instead of "definite" side effects for the purposes of warning on evaluations in an unevaluated context. No longer diagnose on idiomatic code like: int * volatile v; (void)sizeof(*v); llvm-svn: 225116
* [PowerPC] Use 16-byte alignment for modern cores for functions/loopsHal Finkel2015-01-033-4/+110
| | | | | | | | | | | | Most modern PowerPC cores prefer that functions and loops start on 16-byte-aligned boundaries (*), so instruct block placement, etc. to make this happen. The branch selector has also been adjusted so account for the extra nops that might now be inserted before loop headers. (*) Some cores actually prefer other alignments for small loops, but that will be addressed in a follow-up commit. llvm-svn: 225115
* Minor cleanup to all the switches after MatchInstructionImpl in all the ↵Craig Topper2015-01-038-29/+20
| | | | | | | | AsmParsers. Make sure they all have llvm_unreachable on the default path out of the switch. Remove unnecessary "default: break". Remove a 'return' after unreachable. Fix some indentation. llvm-svn: 225114
* Fix some formatting in tablegen output.Craig Topper2015-01-031-7/+4
| | | | llvm-svn: 225113
* Replace some 'unreachable' comments with llvm_unreachable.Craig Topper2015-01-031-2/+2
| | | | llvm-svn: 225112
* Remove TSAN_DEBUG in favor of SANITIZER_DEBUG.Alexey Samsonov2015-01-0318-38/+54
| | | | llvm-svn: 225111
* Replace DCHECK with DCHECK_LE where appropriate.Alexey Samsonov2015-01-031-4/+4
| | | | llvm-svn: 225110
* ValueTracking: Make computeKnownBits for Arguments a little more clearDavid Majnemer2015-01-031-0/+3
| | | | | | | | | | | We would sometimes leave the out-param APInts untouched while going through computeKnownBits. While I don't know of a way to trigger a bug involving this in practice, it goes against the overall design of computeKnownBits. Found via code inspection. llvm-svn: 225109
* [asan/tracing] extend the test a bit more, simplify the tracing code, add a ↵Kostya Serebryany2015-01-032-20/+33
| | | | | | guard page to trace array, fix the trace IDs before dumping llvm-svn: 225108
* [asan] extend coverage-tracing.cc testKostya Serebryany2015-01-031-11/+35
| | | | llvm-svn: 225107
* [PowerPC] Add support for the CMPB instructionHal Finkel2015-01-0312-9/+538
| | | | | | | | | | | | | | Newer POWER cores, and the A2, support the cmpb instruction. This instruction compares its operands, treating each of the 8 bytes in the GPRs separately, returning a 'mask' result of 0 (for false) or -1 (for true) in each byte. Code generation support is added, in the form of a PPCISelDAGToDAG DAG-preprocessing routine, that recognizes patterns close to what the instruction computes (either exactly, or related by a constant masking operation), and generates the cmpb instruction (along with any necessary constant masking operation). This can be expanded if use cases arise. llvm-svn: 225106
* test: correct PE/COFF tests to build under MSVC modeSaleem Abdulrasool2015-01-033-13/+9
| | | | | | | This adjusts the inputs to be compatible with armv7-windows-msvc as well as armv7-windows-itanium. NFC. llvm-svn: 225105
* ReaderWriter: adjust ARM target addresses for execSaleem Abdulrasool2015-01-037-1/+186
| | | | | | | | | | | | ARM NT assumes a THUMB only environment. As such, any address that is detected as residing in an executable section is adjusted to have its bottom bit set to indicate THUMB in case of a mode exchange. Although the testing here seems insufficient (missing the negative cases) the existing test cases for the IMAGE_REL_ARM_{ADDR32,MOV32T} are relevant as they ensure that we do not incorrectly set the bit. llvm-svn: 225104
* [asan] simplify the tracing code, make it use the same guard variables as ↵Kostya Serebryany2015-01-034-70/+31
| | | | | | coverage llvm-svn: 225103
* Remove -Werror from test.Rafael Espindola2015-01-031-2/+2
| | | | | | | It is not needed since we FileCheck for the warning and -Werror itself can end up unused. llvm-svn: 225102
* Really don't warn about -flto/fno-lto :-(Rafael Espindola2015-01-032-8/+28
| | | | | | This should fix the last bots. llvm-svn: 225100
* [X86] Disassembler support for move to/from %rax with a 32-bit memory offset ↵Craig Topper2015-01-037-4/+48
| | | | | | is REX.W and AdSize prefix are both present. llvm-svn: 225099
* [X86] Use 32-bit sign extended immediate for 64-bit LOCK_ArithBinOp with ↵Craig Topper2015-01-031-6/+6
| | | | | | sign extended immediate. llvm-svn: 225098
* [PM] Add proper documentation for the ModulePassManager andChandler Carruth2015-01-021-0/+40
| | | | | | | | | | | | | | FunctionPassManager. These never got documented, likely due to the clutter of this header file. This fixes another problem people noticed when they started trying to use the new pass manager. I've also used this to document the aspirational constraints I would like to hold passes to. I don't really have a better place to document such things at this point, but eventually will probably create a proper .rst file and page for the LLVM pass infrastructure that carries such high-level concerns. llvm-svn: 225097
* [PM] Actually include the correct file name. Sorry for the breakage.Chandler Carruth2015-01-021-1/+1
| | | | llvm-svn: 225096
* Also avoid warning on -flto/-fno-lto on linux.Rafael Espindola2015-01-021-2/+7
| | | | | | | On OS X a .s file is preprocessed, it is not on linux, which is why the warning was still showing up on linux but not OS X. llvm-svn: 225095
* [PM] Lift the majority of the template boilerplate used to implement theChandler Carruth2015-01-022-306/+343
| | | | | | | | | | | | | | | concept-based polymorphism in the pass manager to a separate header. I got feedback from someone reading the code and trying to use it that this was really making it hard to dive in and start using these APIs and that makes a lot of sense. This only requires a moderate amount of gymnastics to separate in this way, namely rinsing the PreservedAnalysis object through a template argument in a few places so that it is dependent and we only examine it on instantiation. llvm-svn: 225094
* Don't warn on unused -fno-lto.Rafael Espindola2015-01-022-2/+6
| | | | | | | It is somewhat common for CFLAGS to be used with .s files. We were already ignoring -flto. This patch just does the same for -fno-lto. llvm-svn: 225093
* [PM] Fix some formatting where clang-format has improved recently.Chandler Carruth2015-01-022-6/+7
| | | | llvm-svn: 225092
* DebugInfo: Provide a less subtle way to set the debug location of simple ret ↵David Blaikie2015-01-025-17/+23
| | | | | | | | instructions un-XFAILing the test XFAIL'd in r225086 after it regressed in r225083. llvm-svn: 225090
* Driver: honour the clang-cl behaviour on ARM as wellSaleem Abdulrasool2015-01-021-3/+4
| | | | | | | | | | Unfortunately, MSVC does not indicate to the driver what target is being used. This means that we cannot correctly select the target architecture for the clang_rt component. This breaks down when targeting windows with the clang driver as opposed to the clang-cl driver. This should fix the native ARM buildbot tests. llvm-svn: 225089
* Revert "Revert r224736: "[Sanitizer] Make CommonFlags immutable after ↵Alexey Samsonov2015-01-028-33/+69
| | | | | | | | | | | | | | | | initialization."" Fix test failures by introducing CommonFlags::CopyFrom() to make sure compiler doesn't insert memcpy() calls into runtime code. Original commit message: Protect CommonFlags singleton by adding const qualifier to common_flags() accessor. The only ways to modify the flags are SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and OverrideCommonFlags() functions, which are only supposed to be called during initialization. llvm-svn: 225088
OpenPOWER on IntegriCloud