summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix another case where the linkage was not set.Rafael Espindola2015-12-101-1/+1
| | | | llvm-svn: 255272
* Verifier: Avoid quadratic checking of aggregates for bad bitcastsDuncan P. N. Exon Smith2015-12-101-38/+37
| | | | | | | | | | | | | | | | | | | | | | | Avoid O(N^2) behaviour when checking for bad bitcasts in `ConstantExpr`s buried inside of aggregate initializers to `GlobalVariable`s. I've: - centralized the "visited" set for recursing through `ConstantExpr`s so that expressions are only visited once per Verifier run, - removed the duplicate logic for the stack visit, and - avoided recursing into other `GlobalValue`s. This recovers roughly a 100x time difference in clang compiles of a particular input file (filled with large cross-referencing tables) that depends on whether `-disable-llvm-verifier` is on. This slowdown was caused by r187506, which introduced these checks. Now, avoiding `-disable-llvm-verifier` only causes a 2x slowdown for this case. (Interestingly, dumping the textual IR for this file starts at least 50GB of global variable initializers (I don't know the total, since I killed the dump)...) llvm-svn: 255269
* [DeadStoreElimination] Use range-based loops. NFC.Chad Rosier2015-12-101-9/+6
| | | | llvm-svn: 255265
* [ProfileData] Add unit test infrastructure for sample profile reader/writerNathan Slingerland2015-12-102-12/+54
| | | | | | | | | | | | | | | Summary: Adds support for in-memory round-trip of sample profile data along with basic round trip unit tests. This will also make it easier to include unit tests for future changes to sample profiling. Reviewers: davidxl, dnovillo, silvas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15211 llvm-svn: 255264
* Fix fptosi, fptoui from f16 vectors to i8, i16 vectorsPirama Arumuga Nainar2015-12-101-0/+10
| | | | | | | | | | | | | | | | Summary: Convert f16 vectors to corresponding f32 vectors before doing the conversion to int. Add tests for v4f16, v8f16. Reviewers: ab, jmolloy Subscribers: llvm-commits, srhines Differential Revision: http://reviews.llvm.org/D14936 llvm-svn: 255263
* [InstCombine] fold bitcasts around an extractelement (3rd try)Sanjay Patel2015-12-101-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a redo of r255137 (reverted at r255227) which was a redo of r255124 (reverted at r255126) with a fixed check for a scalar source type and an added test for the failure that caused the revert. Original commit message: Example: bitcast (extractelement (bitcast <2 x float> %X to <2 x i32>), 1) to float ---> extractelement <2 x float> %X, i32 1 This is part of fixing PR25543: https://llvm.org/bugs/show_bug.cgi?id=25543 The next step will be to generalize this fold: trunc ( lshr ( bitcast X) ) -> extractelement (X) Ie, I'm hoping to replace the existing transform of: bitcast ( trunc ( lshr ( bitcast X))) added by: http://reviews.llvm.org/rL112232 with 2 less specific transforms to catch the case in the bug report. Differential Revision: http://reviews.llvm.org/D14879 llvm-svn: 255261
* [ThinLTO] Debug message cleanup (NFC)Teresa Johnson2015-12-101-8/+8
| | | | | | | | Added some missing spaces between the module identifier and the start of the debug message. Also added a ":" after the module identifier to make this look a little nicer. llvm-svn: 255259
* Avoid undefined behavior when vector is empty.Rafael Espindola2015-12-101-2/+1
| | | | | | Found by ubsan. llvm-svn: 255258
* remove duplicated comments and don't repeat function names in comments; NFCSanjay Patel2015-12-101-142/+83
| | | | llvm-svn: 255257
* Slit lib/Linker in two.Rafael Espindola2015-12-104-1273/+1510
| | | | | | | | | | | | | | | | A linker normally has two stages: symbol resolution and "moving stuff". In lib/Linker there is the complication of lazy linking some globals, but it was still far more mixed than it needed to. This splits the linker into a lower level IRMover and the linker proper. The IRMover just takes a list of globals to move and a callback that lets the user control what is lazy linked. The main motivation is that now tools/gold (and soon lld) can use their own symbol resolution to instruct IRMover what to do. llvm-svn: 255254
* [WebAssembly] Make WebAssemblyStoreResults only return true when it has a ↵Dan Gohman2015-12-101-1/+3
| | | | | | change. llvm-svn: 255253
* [WebAssembly] Fix WebAssemblyPeephole to set Changed to true when making ↵Dan Gohman2015-12-101-0/+1
| | | | | | changes. llvm-svn: 255252
* [WebAssembly] Declare that WebAssemblyPeephole does not modify the CFG.Dan Gohman2015-12-101-0/+5
| | | | llvm-svn: 255251
* [WebAssembly] Remove an unneeded getAnalysisUsage override.Dan Gohman2015-12-101-4/+0
| | | | llvm-svn: 255250
* [DeadStoreElimination] Add support for non-local DSE.Chad Rosier2015-12-101-90/+242
| | | | | | | | | | | | We extend the search for redundant stores to predecessor blocks that unconditionally lead to the block BB with the current store instruction. That also includes single-block loops that unconditionally lead to BB, and if-then-else blocks where then- and else-blocks unconditionally lead to BB. http://reviews.llvm.org/D13363 Patch by Ivan Baev <ibaev@codeaurora.org>! llvm-svn: 255247
* Bitcasts between FP and INT values using direct movesNemanja Ivanovic2015-12-101-90/+218
| | | | | | | | | | | | This patch corresponds to review: http://reviews.llvm.org/D15286 LLVM IR frequently contains bitcast operations between floating point and integer values of the same width. Doing this through memory operations is quite expensive on PPC. This patch allows the use of direct register moves between FPRs and GPRs for lowering bitcasts. llvm-svn: 255246
* Macro debug info support in LLVM IRAmjad Aboud2015-12-1011-10/+256
| | | | | | | | Introduced DIMacro and DIMacroFile debug info metadata in the LLVM IR to support macros. Differential Revision: http://reviews.llvm.org/D14687 llvm-svn: 255245
* [LLE] Use the PredicatedScalarEvolution interface to query SCEVs for dependencesSilviu Baranga2015-12-101-16/+15
| | | | | | | | | | | | | | | | | Summary: LAA uses the PredicatedScalarEvolution interface, so it can produce forward/backward dependences having SCEVs that are AddRecExprs only after being transformed by PredicatedScalarEvolution. Use PredicatedScalarEvolution to get the expected expressions. Reviewers: anemet Subscribers: llvm-commits, sanjoy Differential Revision: http://reviews.llvm.org/D15382 llvm-svn: 255241
* [PostRA scheduling] Allow a target to do scheduling when it wants post RA.Jonas Paulsson2015-12-103-5/+22
| | | | | | | | | | | | | | SystemZ needs to do its scheduling after branch relaxation, which can only happen after block placement, and therefore the standard PostRAScheduler point in the pass sequence is too early. TargetMachine::targetSchedulesPostRAScheduling() is a new method that signals on returning true that target will insert the final scheduling pass on its own. Reviewed by Hal Finkel llvm-svn: 255234
* Revert r255137.Akira Hatanaka2015-12-101-39/+0
| | | | | | This commit broke apple's internal bot. llvm-svn: 255227
* Add arg_begin() and arg_end() to CallInst and InvokeInst; NFCISanjoy Das2015-12-104-11/+6
| | | | | | | | | | - This simplifies the CallSite class, arg_begin / arg_end are now simple wrapper getters. - In several places, we were creating CallSite instances solely to call arg_begin and arg_end. With this change, that's no longer required. llvm-svn: 255226
* [X86] Fix a couple cases were bitwise and logical operations were being ↵Craig Topper2015-12-102-2/+2
| | | | | | mixed. NFC llvm-svn: 255224
* [WebAssembly] Implement mixed-type ISD::FCOPYSIGN.Dan Gohman2015-12-102-1/+7
| | | | | | | | ISD::FCOPYSIGN permits its operands to have differing types, and DAGCombiner uses this. Add some def : Pat rules to expand this out into an explicit conversion and a normal copysign operation. llvm-svn: 255220
* [WebAssembly] Implement fma.Dan Gohman2015-12-101-1/+1
| | | | | | It is lowered to a libcall for now, but this is expected to change in the future. llvm-svn: 255219
* AMDGPU/SI: Fix warning introduced by r255204Tom Stellard2015-12-101-2/+1
| | | | llvm-svn: 255205
* AMDGPU/SI: Emit constant arrays in the .text sectionTom Stellard2015-12-1015-90/+88
| | | | | | | | | | | | | | | Summary: This allows us to remove the END_OF_TEXT_LABEL hack we had been using and simplifies the fixups used to compute the address of constant arrays. Reviewers: arsenm Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D15257 llvm-svn: 255204
* AMDGPU/SI: Add support for sgpr and vgpr inline assembly constraintsTom Stellard2015-12-102-6/+48
| | | | | | | | | | | | Summary: The 's' constraint represents sgprs and the 'v' constraint represents vgprs. Reviewers: arsenm, echristo Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D15342 llvm-svn: 255203
* [WebAssembly] Fix legalization of f32->f64 EXTLOAD.Dan Gohman2015-12-101-1/+1
| | | | llvm-svn: 255202
* [WebAssembly] Update known test failuresDerek Schuff2015-12-101-10/+1
| | | | | | We can now select sign_extend_inreg llvm-svn: 255197
* RegisterPressure: Factor out liveness dead-def detection logic; NFCIMatthias Braun2015-12-101-40/+43
| | | | | | | | Detecting additional dead-defs without a dead flag that are only visible through liveness information should be part of the register operand collection not intertwined with the register pressure update logic. llvm-svn: 255192
* [WebAssembly] Also legalize sign_extend_inreg of i32->i64.Dan Gohman2015-12-101-1/+1
| | | | llvm-svn: 255191
* [WebAssembly] Update test failure expectationsDerek Schuff2015-12-101-28/+10
| | | | llvm-svn: 255190
* PeepholeOptimizer: Ignore dead implicit defsDan Gohman2015-12-101-0/+6
| | | | | | | | Target-specific instructions may have uninteresting physreg clobbers, for target-specific reasons. The peephole pass doesn't need to concern itself with such defs, as long as they're implicit and marked as dead. llvm-svn: 255182
* [WebAssembly] Fix legalization of shift operators with illegal types.Dan Gohman2015-12-101-1/+7
| | | | llvm-svn: 255181
* [WebAssembly] Fix copy+pastos.Dan Gohman2015-12-101-12/+12
| | | | llvm-svn: 255180
* [WebAssembly] Implement anyext.Dan Gohman2015-12-101-0/+9
| | | | llvm-svn: 255179
* [X86] Enable shrink-wrapping by default, but keep it disabled for stack framesQuentin Colombet2015-12-092-0/+9
| | | | | | | | without a frame pointer when unwind may happen. This is a workaround for a bug in the way we emit the CFI directives for frameless unwind information. See PR25614. llvm-svn: 255175
* use range-based for loops; NFCISanjay Patel2015-12-091-6/+4
| | | | llvm-svn: 255171
* Synchronize the logic for deciding to link a gv.Rafael Espindola2015-12-091-1/+6
| | | | | | | We were deciding to not link an available_externally gv over a declaration, but then copying over the body anyway. llvm-svn: 255169
* IR: Make ConstantDataArray::getFP actually return a ConstantDataArrayJustin Bogner2015-12-091-1/+1
| | | | | | | | | | The ConstantDataArray::getFP(LLVMContext &, ArrayRef<uint16_t>) overload has had a typo in it since it was written, where it will create a Vector instead of an Array. This obviously doesn't work at all, but it turns out that until r254991 there weren't actually any callers of this overload. Fix the typo and add some test coverage. llvm-svn: 255157
* [Float2Int] Don't operate on vector instructionsReid Kleckner2015-12-091-0/+2
| | | | | | | This fixes a crash bug. It's also not clear if we'd want to do this transform for vectors. llvm-svn: 255155
* Don't assign a temporary string to a StringRef.Rafael Espindola2015-12-091-1/+1
| | | | | | Should fix the windows debug and asan bots. llvm-svn: 255149
* Use WeakVH to keep track of calls with operand bundles in CloneCodeInfoSanjoy Das2015-12-091-1/+3
| | | | | | | | `CloneAndPruneIntoFromInst` can DCE instructions after cloning them into the new function, and so an AssertingVH is too strong. This change switches CloneCodeInfo to use a std::vector<WeakVH>. llvm-svn: 255148
* Delete trailing whitespace; NFCSanjoy Das2015-12-091-1/+1
| | | | llvm-svn: 255147
* [ThinLTO] FunctionImport pass can take a const index pointer (NFC)Teresa Johnson2015-12-091-3/+3
| | | | llvm-svn: 255140
* [InstCombine] fold bitcasts around an extractelement (2nd try)Sanjay Patel2015-12-091-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a redo of r255124 (reverted at r255126) with an added check for a scalar destination type and an added test for the failure seen in Clang's test/CodeGen/vector.c. The extra test shows a different missing optimization. Original commit message: Example: bitcast (extractelement (bitcast <2 x float> %X to <2 x i32>), 1) to float ---> extractelement <2 x float> %X, i32 1 This is part of fixing PR25543: https://llvm.org/bugs/show_bug.cgi?id=25543 The next step will be to generalize this fold: trunc ( lshr ( bitcast X) ) -> extractelement (X) Ie, I'm hoping to replace the existing transform of: bitcast ( trunc ( lshr ( bitcast X))) added by: http://reviews.llvm.org/rL112232 with 2 less specific transforms to catch the case in the bug report. Differential Revision: http://reviews.llvm.org/D14879 llvm-svn: 255137
* Revert "Revert r253253 and r253126: "Don't recompute LCSSA after ↵Michael Zolotukhin2015-12-091-2/+12
| | | | | | | | | | | loop-unrolling when possible."" The bug in IndVarSimplify was fixed in r254976, r254977, so I'm reapplying the original patch for avoiding redundant LCSSA recomputation. This reverts commit ffe3b434e505e403146aff00be0c177bb6d13466. llvm-svn: 255133
* [PGO] Resubmit "MST based PGO instrumentation infrastructure" (r254021)Rong Xu2015-12-096-1/+945
| | | | | | | | | | | | | | | This new patch fixes a few bugs that exposed in last submit. It also improves the test cases. --Original Commit Message-- This patch implements a minimum spanning tree (MST) based instrumentation for PGO. The use of MST guarantees minimum number of CFG edges getting instrumented. An addition optimization is to instrument the less executed edges to further reduce the instrumentation overhead. The patch contains both the instrumentation and the use of the profile to set the branch weights. Differential Revision: http://reviews.llvm.org/D12781 llvm-svn: 255132
* Revert "[InstCombine] fold bitcasts around an extractelement"Mehdi Amini2015-12-091-37/+0
| | | | | | | | | This reverts commit r255124. Broke http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/4193/steps/test/logs/stdio From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 255126
* [WebAssembly] Reintroduce ARGUMENT moving logicDan Gohman2015-12-094-0/+116
| | | | | | | | | | | | | | | | | | | Reinteroduce the code for moving ARGUMENTS back to the top of the basic block. While the ARGUMENTS physical register prevents sinking and scheduling from moving them, it does not appear to be sufficient to prevent SelectionDAG from moving them down in the initial schedule. This patch introduces a patch that moves them back to the top immediately after SelectionDAG runs. This is still hopefully a temporary solution. http://reviews.llvm.org/D14750 is one alternative, though the review has not been favorable, and proposed alternatives are longer-term and have other downsides. This fixes the main outstanding -verify-machineinstrs failures, so it adds -verify-machineinstrs to several tests. Differential Revision: http://reviews.llvm.org/D15377 llvm-svn: 255125
OpenPOWER on IntegriCloud