summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* [MCDwarf] Fix encoding of line tables with weird custom parametersFrederic Riss2016-01-311-2/+5
| | | | | | | | | | | | | | | | With poorly chosen custom parameters, the line table encoding logic would sometimes end up generating a special opcode bigger than 255, which is wrong. The set of default parameters that LLVM uses isn't subject to this bug. When carefully chosing the line table parameters, it's impossible to fall into the corner case that this patch fixes. The standard however doesn't require that these parameters be carefully chosen. And even if it did, we shouldn't generate broken encoding. Add a unittest for this specific encoding bug, and while at it, create some unit tests for the encoding logic using different sets of parameters. llvm-svn: 259334
* Replace usages of llvm::utostr_32 with just llvm::utostr. While this is less ↵Craig Topper2016-01-311-20/+20
| | | | | | efficient, its unclear the few places that were using the _32 version were doing so for efficiency. llvm-svn: 259330
* add helper function for minnum/maxnum ; NFCSanjay Patel2016-01-311-74/+80
| | | | llvm-svn: 259326
* use range-based for loop; NFCSanjay Patel2016-01-311-3/+3
| | | | llvm-svn: 259325
* fix formatting; NFCSanjay Patel2016-01-311-13/+13
| | | | llvm-svn: 259324
* simplify; NFCSanjay Patel2016-01-311-8/+5
| | | | llvm-svn: 259323
* clean up; NFCSanjay Patel2016-01-311-57/+60
| | | | | | function names, comments, formatting, typos llvm-svn: 259322
* WebAssembly: more failures are goneJF Bastien2016-01-311-24/+0
| | | | llvm-svn: 259321
* WebAssembly: update expected failuresJF Bastien2016-01-311-16/+0
| | | | | | r259305 fixed a few assertions around FrameIndex, and I forgot to update these failures despite having run the torture tests. llvm-svn: 259320
* [SelectionDAG] Eliminate exponential behavior in WalkChainUsersTim Shen2016-01-311-5/+20
| | | | llvm-svn: 259315
* Shrink character buffer size in raw_ostream::write_hex to 16 characters ↵Craig Topper2016-01-311-1/+1
| | | | | | intead of 20 as that's the largest string a 64-bit hex value can be. llvm-svn: 259313
* Use std::end instead of repeating buffer sizes.Craig Topper2016-01-311-2/+2
| | | | llvm-svn: 259312
* Convert int to Twine instead of using utostr since it was already being ↵Craig Topper2016-01-311-1/+1
| | | | | | added to a Twine. NFC llvm-svn: 259308
* [WebAssembly] Fix uses of FrameIndex as store valuesDerek Schuff2016-01-302-3/+5
| | | | | | | | Previously the code assumed all uses of FI on loads and stores were as addresses. This checks whether the use is the address or a value and handles the latter case as it does for non-memory instructions. llvm-svn: 259306
* WebAssembly: don't optimize frameindex storeJF Bastien2016-01-302-6/+14
| | | | | | | | The previous code was incorrect (can't getReg a frameindex). We could instead optimize it to reduce tree height, but I'm not sure that's worthwhile yet because we then try to eliminate the frameindex. This patch also fixes frame index elimination for operations which may load or store: it used to assume the base was operand 2 and immediate offset operand 1. That's not true for stores, where they're 4 and 3. llvm-svn: 259305
* WebAssembly NFC: fix build warningJF Bastien2016-01-301-3/+3
| | | | | | WebAssemblyFrameLowering.cpp:158:44: warning: enumeral and non-enumeral type in conditional expression [enabled by default] llvm-svn: 259303
* [BasicAA] NFC - revised comment for function adjustToPointerSize()Gerolf Hoflehner2016-01-301-1/+1
| | | | llvm-svn: 259300
* [BasicAA] Fix for missing must alias (D16343)Gerolf Hoflehner2016-01-301-0/+3
| | | | llvm-svn: 259299
* [BasicAA] Update on r259290 - added missing castGerolf Hoflehner2016-01-301-1/+1
| | | | llvm-svn: 259298
* AMDGPU: Fix emitting invalid workitem intrinsics for HSAMatt Arsenault2016-01-304-34/+219
| | | | | | | | | | | | | | | | | | The AMDGPUPromoteAlloca pass was emitting the read.local.size calls, which with HSA was incorrectly selected to reading from the offset mesa uses off of the kernarg pointer. Error on intrinsics which aren't supported by HSA, and start emitting the correct IR to read the workgroup size out of the dispatch pointer. Also initialize the pass so it can be tested with opt, and start moving towards not depending on the subtarget as an argument. Start emitting errors for the intrinsics not handled with HSA. llvm-svn: 259297
* AMDGPU: Stop checking intrinsics not used by HSA for dispatch-ptrMatt Arsenault2016-01-301-9/+4
| | | | | | | | Only the dispatch.ptr intrinsic is supposed to be used now to get the workgroup size, and the read.local.size intrinsics do not work correctly. llvm-svn: 259296
* InstCombine: fabs(x) * fabs(x) -> x * xMatt Arsenault2016-01-301-4/+15
| | | | llvm-svn: 259295
* [WebAssembly] Refine block placement to insert blocks between trees.Dan Gohman2016-01-301-5/+22
| | | | | | | | | Refine the test for whether an instruction is in an expression tree so that it detects when one tree ends and another begins, so we can place a block at that point, rather than continuing to find the first instruction not in a tree at all. llvm-svn: 259294
* AMDGPU: Add new amdgcn workitem intrinsicsMatt Arsenault2016-01-302-0/+12
| | | | | | | These use the correct prefix and follow the HSA naming convention rather than the config register option names. llvm-svn: 259293
* [BasicAA] NFC - utility function for two's complement wrap-aroundGerolf Hoflehner2016-01-301-7/+15
| | | | llvm-svn: 259290
* Avoid overly large SmallPtrSet/SmallSetMatthias Braun2016-01-3018-20/+20
| | | | | | | These sets perform linear searching in small mode so it is never a good idea to use SmallSize/N bigger than 32. llvm-svn: 259283
* Use Support/DataTypes.h instead of cstdintMatthias Braun2016-01-301-1/+1
| | | | llvm-svn: 259282
* [CUDA] Die if we ask the NVPTX backend to emit a global ctor/dtor.Justin Lebar2016-01-301-0/+17
| | | | | | | | | | | | Summary: Previously we'd just silently skip these. Reviewers: tra, jholewinski Subscribers: llvm-commits, jhen, echristo, Differential Revision: http://reviews.llvm.org/D16739 llvm-svn: 259279
* [Objective-C] Support a new special module flag.Manman Ren2016-01-291-0/+1
| | | | | | | | "Objective-C Class Properties" will be put into the objc_imageinfo struct. rdar://23891898 llvm-svn: 259270
* [libFuzzer] add -timeout_exitcode optionKostya Serebryany2016-01-295-1/+6
| | | | llvm-svn: 259265
* function names start with a lower case letter ; NFCSanjay Patel2016-01-291-25/+25
| | | | llvm-svn: 259264
* [libFuzzer] re-enable test for -abort_on_timeout=1, this time protecting ↵Kostya Serebryany2016-01-291-1/+1
| | | | | | from ASAN_OPTIONS set outside llvm-svn: 259263
* fix formatting; NFCSanjay Patel2016-01-291-4/+8
| | | | llvm-svn: 259262
* Fix typo in LoopSimplifyCFGFiona Glaser2016-01-291-1/+1
| | | | llvm-svn: 259261
* [Profiling] Add a -sparse mode to llvm-profdata mergeVedant Kumar2016-01-291-6/+24
| | | | | | | | | | Add an option to llvm-profdata merge for writing out sparse indexed profiles. These profiles omit InstrProfRecords for functions which are never executed. Differential Revision: http://reviews.llvm.org/D16727 llvm-svn: 259258
* Fix the MSVC build by moving static asserts into constructorsReid Kleckner2016-01-291-5/+5
| | | | | | | Apparently MSVC won't allow you to ask for the sizeof() a data member at class scope. llvm-svn: 259257
* Add LoopSimplifyCFG passFiona Glaser2016-01-293-0/+117
| | | | | | | | | | | | | | | | | | | | | Loop transformations can sometimes fail because the loop, while in valid rotated LCSSA form, is not in a canonical CFG form. This is an extremely simple pass that just merges obviously redundant blocks, which can be used to fix some known failure cases. In the future, it may be enhanced with more cases (and have code shared with SimplifyCFG). This allows us to run LoopSimplifyCFG -> LoopRotate -> LoopUnroll, so that SimplifyCFG cleans up the loop before Rotate tries to run. Not currently used in the pass manager, since this pass doesn't do anything unless you can hook it up in an LPM with other loop passes. It'll be added once Chandler cleans up things to allow this. Tested in a custom pipeline out of tree to confirm it works in practice (in addition to the included trivial test). llvm-svn: 259256
* Need #include <cstdint> for uint64_tMatthias Braun2016-01-291-1/+2
| | | | llvm-svn: 259255
* Need #include <climit> for CHAR_BITMatthias Braun2016-01-291-0/+1
| | | | llvm-svn: 259254
* AttributeSetImpl: Summarize existing function attributes in a bitset.Matthias Braun2016-01-292-1/+31
| | | | | | | | | | | The majority of attribute queries checks for the existence of an enum attribute in the FunctionIndex slot. We only have 48 of those and can therefore summarize them in an uint64_t bitset which measurably improves compile time. Differential Revision: http://reviews.llvm.org/D16618 llvm-svn: 259252
* AttributeSetNode: Summarize existing attributes in a bitset.Matthias Braun2016-01-292-12/+20
| | | | | | | | | | | The majority of queries just checks for the existince of an enum attribute. We only have 48 of those and can summaryiz them in an uint64_t bitfield so we can avoid searching the list. This improves "opt" compile time by 1-4% in my measurements. Differential Revision: http://reviews.llvm.org/D16617 llvm-svn: 259251
* Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith ↵Yaron Keren2016-01-2951-72/+71
| | | | | | | | r259192 post commit comment. clang part in r259232, this is the LLVM part of the patch. llvm-svn: 259240
* [InstCombine] avoid an insertelement transformation that induces the ↵Sanjay Patel2016-01-291-1/+17
| | | | | | | | | | | opposite extractelement fold (PR26354) We would infinite loop because we created a shufflevector that was wider than needed and then failed to combine that with the insertelement. When subsequently visiting the extractelement from that shuffle, we see that it's unnecessary, delete it, and trigger another visit to the insertelement. llvm-svn: 259236
* [CodeView] Implement .cv_inline_linetableDavid Majnemer2016-01-295-6/+155
| | | | | | | | | | | This support is _very_ rudimentary, just enough to get some basic data into the CodeView debug section. Left to do is: - Use the combined opcodes to save space. - Do something about code offsets. llvm-svn: 259230
* ARM: don't mangle DAG constant if it has more than one useTim Northover2016-01-291-2/+2
| | | | | | | | | | | | | | | | The basic optimisation was to convert (mul $LHS, $complex_constant) into roughly "(shl (mul $LHS, $simple_constant), $simple_amt)" when it was expected to be cheaper. The original logic checks that the mul only has one use (since we're mangling $complex_constant), but when used in even more complex addressing modes there may be an outer addition that can pick up the wrong value too. I *think* the ARM addressing-mode problem is actually unreachable at the moment, but that depends on complex assessments of the profitability of pre-increment addressing modes so I've put a real check in there instead of an assertion. llvm-svn: 259228
* [WebAssembly] Update test expectationsDerek Schuff2016-01-291-63/+1
| | | | llvm-svn: 259223
* [WebAssembly] Support frame pointerDerek Schuff2016-01-293-17/+82
| | | | | | | | | Add support for frame pointer use in prolog/epilog. Supports dynamic allocas but not yet over-aligned locals. Target-independend CG generates SP updates, but we still need to write back the SP value to memory when necessary. llvm-svn: 259220
* [codeview] Begin to add support for inlined call sitesReid Kleckner2016-01-293-5/+177
| | | | | | | | | | | | | | | | | | | | | Summary: There are three parts to inlined call frames: 1. The inlinee line subsection 2. The inline site symbol record 3. The function ids referenced by both This change starts by emitting function ids (3) for all subprograms and emitting the base inline site symbol record (2). The actual line numbers in (2) use an encoded format that will come next, along with the inlinee line subsection. Reviewers: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16333 llvm-svn: 259217
* Fix the buildDavid Majnemer2016-01-291-1/+1
| | | | llvm-svn: 259215
* Temporarily revert "[ScheduleDAGInstrs::buildSchedGraph()] Handling of ↵Jonas Paulsson2016-01-291-376/+347
| | | | | | | | memory dependecies rewritten." Some buildbot failures needs to be debugged. llvm-svn: 259213
OpenPOWER on IntegriCloud