summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Reduce dependence on pointee types when deducing dereferenceabilitySanjoy Das2016-06-011-72/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Change some of the internal interfaces in Loads.cpp to keep track of the number of bytes we're trying to prove dereferenceable using an explicit `Size` parameter. Before this, the `Size` parameter was implicitly inferred from the pointee type of the pointer whose dereferenceability we were trying to prove, causing us to be conservative around bitcasts. This was unfortunate since bitcast instructions are no-ops and should never break optimizations. With an explicit `Size` parameter, we're more precise (as shown in the test cases), and the code is simpler. We should eventually move towards a `DerefQuery` struct that groups together a base pointer, an offset, a size and an alignment; but this patch is a first step. Reviewers: apilipenko, dblaikie, hfinkel, reames Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D20764 llvm-svn: 271406
* [libFuzzer] when an invalid flag is given, warn, but don't crashKostya Serebryany2016-06-012-2/+7
| | | | llvm-svn: 271404
* [IR] Disallow loading and storing unsized typesSanjoy Das2016-06-011-0/+2
| | | | | | | | | | | | | | | | Summary: It isn't clear what is the operational meaning of loading or storing an unsized types, since it cannot be lowered into something meaningful. Since there does not seem to be any practical need for it either, make such loads and stores illegal IR. Reviewers: majnemer, chandlerc Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D20846 llvm-svn: 271402
* Adding back-end support to two bit scanning intrinsicsMichael Zuckerman2016-06-011-0/+2
| | | | | | | | | | | | | | Adding LLVM back-end support to two intrinsics dealing with bit scan: _bit_scan_forward and _bit_scan_reverse. Their functionality is as described in Intel intrinsics guide: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_bit_scan_forward&expand=371,370 https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_bit_scan_reverse&expand=371,370 Commit on behalf of Omer Paparo Bivas Differential Revision: http://reviews.llvm.org/D19915 llvm-svn: 271386
* [ARM] Add additional matching for UBFX instructionsOliver Stannard2016-06-011-0/+21
| | | | | | | | | | | This adds an additional matcher to select UBFX(..) from SRL(AND(..)) in ARMISelDAGToDAG to help with code size. Patch by David Green. Differential Revision: http://reviews.llvm.org/D20667 llvm-svn: 271384
* [Sparc] Allow passing of empty structs.Chris Dewhurst2016-06-011-11/+21
| | | | | | | | Passing an empty struct as a function call argument is now supported. unit tests for various scenarios added. llvm-svn: 271374
* Revert r271362 "[AVX512] Remove masked load intrinsics. Clang now emits ↵Craig Topper2016-06-012-62/+32
| | | | | | | | generic masked load intrinsics instead." Looks like something isn't quite right still. Also forgot to move the test cases to an autoupgrade test. llvm-svn: 271363
* [AVX512] Remove masked load intrinsics. Clang now emits generic masked load ↵Craig Topper2016-06-012-32/+62
| | | | | | | | intrinsics instead. The intrinsics will be autoupgraded to the same generic masked loads. llvm-svn: 271362
* DwarfDebug: Simplify. NFC.Peter Collingbourne2016-06-011-6/+2
| | | | llvm-svn: 271360
* [MC] Rename EmitFill to emitFillPetr Hosek2016-06-016-14/+14
| | | | | | | | This is to match the overloaded variants as well as the new style. Differential Revision: http://reviews.llvm.org/D20690 llvm-svn: 271359
* IR: Allow multiple global metadata attachments with the same type.Peter Collingbourne2016-06-018-48/+118
| | | | | | | | | | This will be necessary to allow the global merge pass to attach multiple debug info metadata nodes to global variables once we reverse the edge from DIGlobalVariable to GlobalVariable. Differential Revision: http://reviews.llvm.org/D20414 llvm-svn: 271358
* DAGCombiner: Fix broken size check in isAliasMatt Arsenault2016-06-011-1/+1
| | | | | | | | | | | | | | | This should have been converting the size to bytes, but wasn't really. These should probably all be using getStoreSize instead. I haven't been able to come up with a meaningful testcase for this. I can trigger it using combinations of struct loads and stores, but can't observe a difference in non-broken testcases. isAlias is only really used during store merging, so I'm not sure how to get into the vector splitting situation the comment describes since store merging is only done before type legalization. llvm-svn: 271356
* [Orc] Add conversion to/from RuntimeDyld::SymbolInfo for JITSymbol.Lang Hames2016-05-312-4/+4
| | | | | | | | | | This tidies up some code that was manually constructing RuntimeDyld::SymbolInfo instances from JITSymbols. It will save more mess in the future when JITSymbol::getAddress is extended to return an Expected<TargetAddress> rather than just a TargetAddress, since we'll be able to embed the error checking in the conversion. llvm-svn: 271350
* Add support for metadata attachments for global variables.Peter Collingbourne2016-05-3111-57/+130
| | | | | | | | | | This patch adds an IR, assembly and bitcode representation for metadata attachments for globals. Future patches will port existing features to use these new attachments. Differential Revision: http://reviews.llvm.org/D20074 llvm-svn: 271348
* [pdb] Add unit tests for PDB MappedBlockStream and zero copyZachary Turner2016-05-315-1/+10
| | | | | | | Differential Revision: http://reviews.llvm.org/D20837 Reviewed By: ruiu llvm-svn: 271346
* CodeGen: Refactor renameDisconnectedComponents() as a passMatthias Braun2016-05-318-292/+460
| | | | | | | | | | | | | | | | | | Refactor LiveIntervals::renameDisconnectedComponents() to be a pass. Also change the name to "RenameIndependentSubregs": - renameDisconnectedComponents() worked on a MachineFunction at a time so it is a natural candidate for a machine function pass. - The algorithm is testable with a .mir test now. - This also fixes a problem where the lazy renaming as part of the MachineScheduler introduced IMPLICIT_DEF instructions after the number of a nodes in a region were counted leading to a mismatch. Differential Revision: http://reviews.llvm.org/D20507 llvm-svn: 271345
* [X86]: Add a pattern that uses GR16_ABCD rather than GR32_ABCD to avoid ↵Kevin B. Smith2016-05-311-0/+4
| | | | | | | | falsely marking whole 32 bit register as live. Differential Revision: http://reviews.llvm.org/D20649 llvm-svn: 271341
* ARM: Do not attempt to modify register class of physregs.Matthias Braun2016-05-311-4/+9
| | | | | | | Physregs have no associated register class, do not attempt to modify it in Thumb2InstrInfo::storeRegToStackSlot()/loadFromStackSlot(). llvm-svn: 271339
* [SLP] Pass in correct alignment when query memory access costGuozhi Wei2016-05-311-4/+8
| | | | | | | | | | This patch fixes bug https://llvm.org/bugs/show_bug.cgi?id=27897. When query memory access cost, current SLP always passes in alignment value of 1 (unaligned), so it gets a very high cost of scalar memory access, and wrongly vectorize memory loads in the test case. It can be fixed by simply giving correct alignment. llvm-svn: 271333
* Change llvm-objdump, llvm-nm and llvm-size when reporting an object file errorKevin Enderby2016-05-313-10/+11
| | | | | | | | | | | | | | | | | | | when the object is from a slice of a Mach-O Universal Binary use something like "foo.o (for architecture i386)" as part of the error message when expected. Also fixed places in these tools that were ignoring object file errors from MachOUniversalBinary::getAsObjectFile() when the code moved on to see if the slice was an archive. To do this MachOUniversalBinary::getAsObjectFile() and MachOUniversalBinary::getObjectForArch() were changed from returning ErrorOr<...> to Expected<...> then that was threaded up to its users. Converting these interfaces to Expected<> from ErrorOr<> does involve touching a number of places. To contain the changes for now the use of errorToErrorCode() is still used in two places yet to be fully converted. llvm-svn: 271332
* [CFLAA] Don't link GEP pointers to GEP indices.George Burgess IV2016-05-311-2/+0
| | | | | | | | | | | | | | | | | Code like the following is considered broken, and doesn't need to be supported by our AA magicks: void getFoo(int *P) { int *PAlias = (int *)((char *)NULL + (uintptr_t)P); } This patch makes CFLAA drop support for code like this. Patch by Jia Chen. Differential Revision: http://reviews.llvm.org/D20775 llvm-svn: 271322
* [CodeGen] Promote FMINNAN/FMAXNAN like other binops.Ahmed Bougacha2016-05-311-0/+2
| | | | | | | | We think it's OK to generate half fminnan because it's legal for the transform-to type (f32; r245196). However, PromoteFloatRes was missing the case; simply promote like the other binops, including minnum. llvm-svn: 271317
* [CodeGen] Don't mark FMINNUM/FMAXNUM Expand twice. NFC.Ahmed Bougacha2016-05-311-2/+0
| | | | | | They're already in the all_valuetypes() loop above. llvm-svn: 271316
* [codeview] Improve readability of type record assemblyReid Kleckner2016-05-314-23/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the method MCStreamer::EmitBinaryData, which is usually an alias for EmitBytes. In the MCAsmStreamer case, it is overridden to emit hex dump output like this: .byte 0x0e, 0x00, 0x08, 0x10 .byte 0x03, 0x00, 0x00, 0x00 .byte 0x00, 0x00, 0x00, 0x00 .byte 0x00, 0x10, 0x00, 0x00 Also, when verbose asm comments are enabled, this patch prints the dump output for each comment before its record, like this: # ArgList (0x1000) { # TypeLeafKind: LF_ARGLIST (0x1201) # NumArgs: 0 # Arguments [ # ] # } .byte 0x06, 0x00, 0x01, 0x12 .byte 0x00, 0x00, 0x00, 0x00 This should make debugging easier and testing more convenient. Reviewers: aaboud Subscribers: majnemer, zturner, amccarth, aaboud, llvm-commits Differential Revision: http://reviews.llvm.org/D20711 llvm-svn: 271313
* Delete AArch64II::MO_CONSTPOOL.Rafael Espindola2016-05-315-38/+4
| | | | | | | | A constant pool holding the address of a variable in equivalent to a got entry. It produces exactly the same instruction sequence as a got use and unlike a got use this is not uniqued by the linker. llvm-svn: 271311
* [codeview] Add a CVTypeDumper::dump(ArrayRef<uint8_t>) overloadReid Kleckner2016-05-311-0/+13
| | | | | | | This is a convenient wrapper when the type record is already laid out as bytes in memory. llvm-svn: 271309
* [PM] BDCE: Fix caching of analyses.Davide Italiano2016-05-311-3/+8
| | | | | | | Another chapter in the story. GlobalsAA should be preserved, as well as the CFG. llvm-svn: 271307
* [PM] ADCE: Fix caching of analyses.Davide Italiano2016-05-311-3/+8
| | | | | | | When this pass was originally ported, AA wasn't available for the new PM. Now it is, so we can cache properly. llvm-svn: 271303
* [mips] Enforce compact branch register restrictionsSimon Dardis2016-05-312-14/+66
| | | | | | | | | | | | | | | Enforce compact branch register restrictions such as the use of the zero register, both operands being the same register. Emit clear error in such cases as the issue is subtle. For bovc and bnvc, silently fixup such cases when emitting objects directly, like LLVM started doing in rL269899. Reviewers: vkalintiris, dsanders Differential Review: http://reviews.llvm.org/D20475 llvm-svn: 271301
* [obj2yaml][yaml2obj] Support for reading and dumping the MachO export trieChris Bieneman2016-05-311-0/+19
| | | | | | The MachO export trie is a serially encoded trie keyed by symbol name. This code parses the trie and preserves the structure so that it can be dumped again. llvm-svn: 271300
* Fix a crash in MergeFunctions related to ordering of weak/strong functionsErik Eckstein2016-05-311-32/+12
| | | | | | | | | | | The assumption, made in insert() that weak functions are always inserted after strong functions, is only true in the first round of adding functions. In subsequent rounds this is no longer guaranteed , because we might remove a strong function from the tree (because it's modified) and add it later, where an equivalent weak function already exists in the tree. This change removes the assert in insert() and explicitly enforces a weak->strong order. This also removes the need of two separate loops in runOnModule(). llvm-svn: 271299
* [esan|cfrag] Create the skeleton of cfrag variable for the runtimeQin Zhao2016-05-311-19/+90
| | | | | | | | | | | | | | | | | Summary: Creates a global variable containing preliminary information for the cache-fragmentation tool runtime. Passes a pointer to the variable (null if no variable is created) to the compilation unit init and exit routines in the runtime. Reviewers: aizatsky, bruening Subscribers: filcab, kubabrecka, bruening, kcc, vitalybuka, eugenis, llvm-commits, zhaoqin Differential Revision: http://reviews.llvm.org/D20541 llvm-svn: 271298
* AMDGPU: Remove unused address spaceMatt Arsenault2016-05-312-12/+10
| | | | | | Also return a single StringRef instead of building a string. llvm-svn: 271296
* Add a use of shouldAssumeDSOLocal to ARM.Rafael Espindola2016-05-311-2/+6
| | | | | | Now this code path knows about position independent executables. llvm-svn: 271290
* [Hexagon] Disable expanding MUX instructions that define a subregisterKrzysztof Parzyszek2016-05-311-0/+5
| | | | | | | The code in HexagonExpandCondsets.cpp does not handle those cases at the moment. llvm-svn: 271281
* Do not modify a std::vector while looping it. Yaron Keren2016-05-311-2/+6
| | | | | | | | | | Introduced in r271244, this is probably undefined behaviour and asserts when compiled with Visual C++ debug mode. On further note, the loop is quadratic with regard to the number of successors since removeSuccessor is linear and could probably be modified to linear time. llvm-svn: 271278
* [ARM] Add backend support for load/store intrinsics.Ranjeet Singh2016-05-312-37/+39
| | | | | | | | | | Added support to map intrinsics __builtin_arm_{ldc,ldcl,ldc2,ldc2l,stc,stcl,stc2,stc2l} to their ARM instructions. Differential Revision: http://reviews.llvm.org/D20564 llvm-svn: 271271
* [X86][SSE] Add load-folding patterns for (V)CVTDQ2PD (PR27291)Simon Pilgrim2016-05-311-0/+4
| | | | | | Added patterns for (V)CVTDQ2PD -> 2f64 loading from a 64-bit source. llvm-svn: 271269
* [mips] bnec/beqc register constraint fixSimon Dardis2016-05-311-4/+6
| | | | | | | | | | | beqc and bnec cannot have $rs == $rt. Inhibit compact branch creation if that would occur. Reviewers: vkalintiris, dsanders Differential Revision: http://reviews.llvm.org/D20624 llvm-svn: 271260
* [AVX512] Fix intrinsic vcvtps2ph lowering.Igor Breger2016-05-312-8/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D20788 llvm-svn: 271255
* Fix intrinsic vbroadcast{i32|f32}x2 lowering.Igor Breger2016-05-313-37/+46
| | | | | | Differential Revision: http://reviews.llvm.org/D20780 llvm-svn: 271254
* [AVX512] Remove masked store intrinsics. Clang now emits generic masked ↵Craig Topper2016-05-312-30/+66
| | | | | | | | store intrinsics instead. The intrinsics will be autoupgraded to the same generic masked stores. llvm-svn: 271245
* X86: permit using SjLj EH on x86 targets as an optionSaleem Abdulrasool2016-05-316-1/+284
| | | | | | | | | | | This adds support to the backed to actually support SjLj EH as an exception model. This is *NOT* the default model, and requires explicitly opting into it from the frontend. GCC supports this model and for MinGW can still be enabled via the `--using-sjlj-exceptions` options. Addresses PR27749! llvm-svn: 271244
* [X86] Remove SSE/AVX unaligned store intrinsics as clang no longer uses ↵Craig Topper2016-05-304-75/+17
| | | | | | them. Auto upgrade to native unaligned store instructions. llvm-svn: 271236
* [X86] Simplify and remove some unnecessary auto-upgrade code.Craig Topper2016-05-301-10/+2
| | | | llvm-svn: 271233
* [X86] Reduce the number of string compares in the autoupgrade logic by ↵Craig Topper2016-05-301-41/+17
| | | | | | checking more prefixes instead of complete matches. llvm-svn: 271232
* Fix a crash when producing COFF.Rafael Espindola2016-05-301-0/+2
| | | | llvm-svn: 271229
* [BPF] Remove exit-on-error from tests (PR27768, PR27769)Diana Picus2016-05-301-1/+5
| | | | | | | | | | | The exit-on-error flag is necessary to avoid some assertions/unreachables. We can get past them by creating a few dummy nodes. Fixes PR27768, PR27769. Differential Revision: http://reviews.llvm.org/D20726 llvm-svn: 271200
* [IndVars] Assert that the incoming IR is in LCSSASanjoy Das2016-05-301-0/+3
| | | | | | | | | | | Since we already assert that the outgoing IR is in LCSSA, it is easy to get misled into thinking that -indvars broke LCSSA if the incoming IR is non-LCSSA. Checking this pre-condition will make such cases break in more obvious ways. Inspired by (but does _not_ fix) PR26682. llvm-svn: 271196
* [IndVarSimplify] Extract the logic of `-indvars` out into a class; NFCSanjoy Das2016-05-292-52/+58
| | | | | | This will be used later to port IndVarSimplify to the new pass manager. llvm-svn: 271190
OpenPOWER on IntegriCloud