summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Linker: Copy over function metadata attachmentsDuncan P. N. Exon Smith2015-04-241-0/+7
| | | | | | | Update `lib/Linker` to handle `Function` metadata attachments. The attachments stick with the function body. llvm-svn: 235786
* IR: Add assembly/bitcode support for function metadata attachmentsDuncan P. N. Exon Smith2015-04-246-9/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add serialization support for function metadata attachments (added in r235783). The syntax is: define @foo() !attach !0 { Metadata attachments are only allowed on functions with bodies. Since they come before the `{`, they're not really part of the body; since they require a body, they're not really part of the header. In `LLParser` I gave them a separate function called from `ParseDefine()`, `ParseOptionalFunctionMetadata()`. In bitcode, I'm using the same `METADATA_ATTACHMENT` record used by instructions. Instruction metadata attachments are included in a special "attachment" block at the end of a `Function`. The attachment records are laid out like this: InstID (KindID MetadataID)+ Note that these records always have an odd number of fields. The new code takes advantage of this to recognize function attachments (which don't need an instruction ID): (KindID MetadataID)+ This means we can use the same attachment block already used for instructions. This is part of PR23340. llvm-svn: 235785
* Verifier: Function metadata attachments require a bodyDuncan P. N. Exon Smith2015-04-241-0/+13
| | | | | | | | Add a verifier check that only functions with bodies have metadata attachments. This should help catch bugs in frontends and transformation passes. Part of PR23340. llvm-svn: 235784
* IR: Add Function metadata attachmentsDuncan P. N. Exon Smith2015-04-243-0/+82
| | | | | | | | Add IR support for `Metadata` attachments. Assembly and bitcode support will follow shortly, but for now we just have unit tests. This is part of PR23340. llvm-svn: 235783
* LLParser: Simplify ParseInstructionMetadata(), NFCDuncan P. N. Exon Smith2015-04-242-7/+6
| | | | | | | | Remove unused `PFS` variable and take the `Instruction` by reference. (Not really related to PR23340, but might as well clean this up while I'm here.) llvm-svn: 235782
* [DAGCombiner] Fix the type used in canFoldInAddressingMode to account for theQuentin Colombet2015-04-241-2/+2
| | | | | | | | | | | | | | | | | | right scaling. In the function canFoldInAddressingMode, VT is computed as the type of the destination/source of a LOAD/STORE operations, instead of the memory type of the operation. On targets with a scaling factor on the offset of the LOAD/STORE operations, the function may return false for actually valid cases. This may then prevent the selection of profitable pre or post indexed load/store operations, and instead select pre or post indexed load/store for unprofitable cases. Patch by Francois de Ferriere <francois.de-ferriere@st.com>! Differential Revision: http://reviews.llvm.org/D9146 llvm-svn: 235780
* LLParser: Split out ParseMetadataAttachment(), NFCDuncan P. N. Exon Smith2015-04-242-5/+15
| | | | | | Make the code reusable for `Function` metadata attachments (PR23340). llvm-svn: 235778
* [opaque pointer type] Verifier/AutoUpgrade: Remove a few uses of ↵David Blaikie2015-04-242-17/+11
| | | | | | PointerType::getElementType llvm-svn: 235777
* AsmWriter: Parameterize the syntactic separator for attachmentsDuncan P. N. Exon Smith2015-04-241-8/+10
| | | | | | | | Parameterize the separator for attachments, since `Function` metadata attachments (PR23340) aren't going to use a `,` (comma). No real functionality change. llvm-svn: 235775
* AsmWriter: Only collect attachment names once per moduleDuncan P. N. Exon Smith2015-04-241-2/+4
| | | | | | | | Collect metadata names once per `AssemblyWriter` instead of every time we need to print some attachments. Just a drive-by; this caught my eye while I was refactoring the code in r235772. llvm-svn: 235774
* Remove an unused variable to prevent -Werror build failures.Kaelyn Takata2015-04-241-1/+0
| | | | llvm-svn: 235773
* AsmWriter: Split out code for printing Metadata attachments, NFCDuncan P. N. Exon Smith2015-04-241-14/+25
| | | | | | | Refactor the code for printing `Instruction` metadata attachments so it can be reused for `Function`. llvm-svn: 235772
* SimplifyCFG: Correctly handle switch lookup tables which fully cover the ↵Hans Wennborg2015-04-241-4/+9
| | | | | | | | | | | | | input type and use bit tests to check for holes When using bit tests for hole checks, we call AddPredecessorToBlock to give the phi node a value from the bit test block. This would break if we've previously called removePredecessor on the default destination because the switch is fully covered. Test case by Mark Lacey. llvm-svn: 235771
* IR: Use a bitmask to access GlobalObject subclass dataDuncan P. N. Exon Smith2015-04-241-3/+5
| | | | | | | | Make room for more than just `Function::isMaterializable()` in the `GlobalObject` subclass data bitfield. Since we're treating it like a bitfield, change `Function::Function()` to zero-out the whole thing. llvm-svn: 235770
* IR: Extract set logic from Instruction attachments, NFCDuncan P. N. Exon Smith2015-04-242-57/+99
| | | | | | | | | | | Extract the set logic for metadata attachments from `Instruction` so it can be reused for `Function` (PR23340). This data structure makes a `SmallVector<>` look (a little) like a map, just doing the bare minimum to support the `Instruction` (and soon, `Function`) metadata API. llvm-svn: 235769
* [SEH] Implement GetExceptionCode in __except blocksReid Kleckner2015-04-244-26/+89
| | | | | | | | | This introduces an intrinsic called llvm.eh.exceptioncode. It is lowered by copying the EAX value live into whatever basic block it is called from. Obviously, this only works if you insert it late during codegen, because otherwise mid-level passes might reschedule it. llvm-svn: 235768
* IR: Use remove_if for Instruction::dropUnknownMetadata()Duncan P. N. Exon Smith2015-04-241-16/+8
| | | | | | | | | | Technically the operations are different -- the old logic moved items from the back into the opened-up slots, instead of the usual `remove_if()` logic of a slow and a fast iterator -- but unless a profile tells us otherwise I prefer the simpler logic here. Regardless, there shouldn't be an observable function change. llvm-svn: 235767
* IR: Remove MDMapTy and MDPairTy typedefs, NFCDuncan P. N. Exon Smith2015-04-242-17/+10
| | | | | | | Remove some typedefs in preparation for factoring out attachment logic from `Instruction`. llvm-svn: 235764
* IR: Rename LLVMContextImpl::MetadataStore to InstructionMetadataDuncan P. N. Exon Smith2015-04-242-21/+23
| | | | | | | Rename `MetadataStore` to the more explicit `InstructionMetadata`. This will make room for `FunctionMetadata` (start of PR23340). llvm-svn: 235763
* [opaque pointer type] Add textual IR support for explicit type parameter to ↵David Blaikie2015-04-242-17/+8
| | | | | | | | | | the invoke instruction Same as r235145 for the call instruction - the justification, tradeoffs, etc are all the same. The conversion script worked the same without any false negatives (after replacing 'call' with 'invoke'). llvm-svn: 235755
* [AsmPrinter] Make AsmPrinter's OutStreamer member a unique_ptr.Lang Hames2015-04-2435-954/+959
| | | | | | | AsmPrinter owns the OutStreamer, so an owning pointer makes sense here. Using a reference for this is crufty. llvm-svn: 235752
* [opaque pointer type] bitcode: add explicit callee type to invoke instructionsDavid Blaikie2015-04-242-18/+27
| | | | llvm-svn: 235735
* Fix LoopInterchange/reductions.ll test for debug buildsAndrew Kaylor2015-04-241-2/+2
| | | | llvm-svn: 235734
* Switch lowering: fix APInt overflow causing infinite loop / OOMHans Wennborg2015-04-241-1/+2
| | | | llvm-svn: 235729
* [WinEH] Split the landingpad BB instead of cloning itReid Kleckner2015-04-241-21/+9
| | | | | | | This means we don't have to RAUW the landingpad instruction and landingpad BB, which is a nice win. llvm-svn: 235725
* Fix typo in comment.Diego Novillo2015-04-241-1/+1
| | | | llvm-svn: 235723
* Use the cleaner syntx value initialization to zero initialize POD structs.Yaron Keren2015-04-241-6/+3
| | | | | | Suggestion from David Blaikie! llvm-svn: 235721
* Silence clang warning: missing field 'Dr0' initializer.Yaron Keren2015-04-241-1/+2
| | | | llvm-svn: 235719
* [mips][FastISel] Specify which types we handle for integer extension.Vasileios Kalintiris2015-04-241-0/+7
| | | | | | | | | | | | | | | | | | Summary: Perform integer extension only when the destination type is one of i8, i16 & i32 and when the source type is i1, i8 or i16. For other combinations we fall back to SelectionDAG. This fixes the test MultiSource/Benchmarks/7zip that was failing in our out-of-tree MIPS buildbots. Reviewers: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9243 llvm-svn: 235718
* Removing dead code; NFC. This code was triggering a C4718 warning (recursive ↵Aaron Ballman2015-04-241-18/+0
| | | | | | call has no side effects, deleting) with MSVC. llvm-svn: 235717
* [BitcodeReader] Fix asserts when we read a non-vector type for ↵Filipe Cabecinhas2015-04-241-2/+9
| | | | | | | | | | insert/extract/shuffle Added some additional checking for vector types + tests. Bug found with AFL fuzz. llvm-svn: 235710
* Correct extractelement constant foldingPawel Bylica2015-04-241-3/+2
| | | | | | | | | | | | | | | | Summary: Constant folding of extractelement with out-of-bound index produces undef also for indexes bigger than 64bit (instead of crash assert failure as before) Test Plan: Unit tests included. Reviewers: majnemer Reviewed By: majnemer Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9225 llvm-svn: 235700
* Fix APInt long division algorithmPawel Bylica2015-04-241-19/+9
| | | | | | | | | | | | | | | | Summary: This patch fixes step D4 of Knuth's division algorithm implementation. Negative sign of the step result was not always detected due to incorrect "borrow" handling. Test Plan: Unit test that reveals the bug included. Reviewers: chandlerc, yaron.keren Reviewed By: yaron.keren Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9196 llvm-svn: 235699
* [TableGen] Don't leak Expanders and Operators in SetTheory.Craig Topper2015-04-241-20/+21
| | | | llvm-svn: 235697
* [TableGen] Fix all remaining memory leaks of Init and RecTy objects.Craig Topper2015-04-241-34/+33
| | | | llvm-svn: 235696
* Resurrect r235688Jingyue Wu2015-04-242-1/+4
| | | | | | | | We should skip vector types which are not SCEVable. test/CodeGen/NVPTX/sched2.ll passes llvm-svn: 235695
* Revert r235688Jingyue Wu2015-04-241-2/+0
| | | | | | Seems breaking builds llvm-svn: 235690
* [NVPTX] Emits "generic()" depending on the original address spaceJingyue Wu2015-04-242-8/+18
| | | | | | | | | | | | | | | | | | Summary: Fixes a bug in the NVPTX codegen. The code used to miss necessary "generic()" on aggregates of addrspacecasts. Test Plan: addrspacecast-gvar.ll Reviewers: eliben, jholewinski Reviewed By: jholewinski Subscribers: jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D9130 llvm-svn: 235689
* [NVPTX] enable NaryReassociate in NVPTXJingyue Wu2015-04-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We run NaryReassociate right after SLSR because SLSR enables many opportunities for NaryReassociate. For example, in nary-slsr.ll foo((a + b) + c); foo((a + b * 2) + c); foo((a + b * 3) + c); // 2 muls and 6 adds after SLSR: ab = a + b; foo(ab + c); ab2 = ab + b; foo(ab2 + c); ab3 = ab2 + b; foo(ab3 + c); // 6 adds after NaryReassociate: abc = (a + b) + c; foo(abc); ab2c = abc + b; foo(ab2c); ab3c = ab2c + b; foo(ab3c); // 4 adds Test Plan: nary-slsr.ll Reviewers: jholewinski, eliben Reviewed By: eliben Subscribers: jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D9066 llvm-svn: 235688
* R600/SI: Fix verifier error when producing v_madmk_f32Matt Arsenault2015-04-241-0/+3
| | | | | | Copy the kill flags when swapping the operands. llvm-svn: 235687
* R600/RegisterCoalescer: Enable more rematerialization/add missing testcaseMatthias Braun2015-04-241-2/+2
| | | | | | | This enables the rematerialization of some R600 MOV instructions in the RegisterCoalescer and adds a testcase for r235668. llvm-svn: 235675
* Fix a couple of typos in comments.Michael Zolotukhin2015-04-241-3/+3
| | | | llvm-svn: 235674
* RegisterCoalescer: implicit phsreg uses are fine when rematerializingMatthias Braun2015-04-241-2/+2
| | | | | | | The target hooks should have already checked them. This change is necessary to enable the remateriailzation on R600. llvm-svn: 235673
* Revert accidentally committed "MC: Allow targets to stop symbol name quoting"Matt Arsenault2015-04-233-6/+3
| | | | llvm-svn: 235672
* R600/SI: Special case v_mov_b32 as really rematerializableMatt Arsenault2015-04-232-0/+17
| | | | | | | This should be fixed to properly understand all rematerializable instructions while ignoring implicit reads of exec. llvm-svn: 235671
* MC: Allow targets to stop symbol name quotingMatt Arsenault2015-04-233-3/+6
| | | | | | | | | Currently symbol names are printed in quotes if it contains something outside of the arbitrary set of characters that isAcceptableChar tests for. On somem targets, it is never OK to print a symbol name in quotes so allow targets to opt out of this behavior. llvm-svn: 235670
* RegisterCoalescer: Avoid unnecessary register class widening for some ↵Matthias Braun2015-04-231-3/+25
| | | | | | | | | | | rematerializations I couldn't provide a testcase as none of the public targets has wide register classes with alot of subregisters and at the same time an instruction which "ReMaterializable" and "AsCheapAsAMove" (could probably be added for R600). llvm-svn: 235668
* Re-commit "[SEH] Remove the old __C_specific_handler code now that ↵Reid Kleckner2015-04-234-121/+2
| | | | | | | | | | WinEHPrepare works" This reverts commit r235617. r235649 should have addressed the problems. llvm-svn: 235667
* [PowerPC] Support register name prefixes for vector registersHal Finkel2015-04-231-0/+8
| | | | | | | Match binutils by supporting the optional register name prefix for new vector registers ("vs" for VSX registers and "q" for QPX registers). llvm-svn: 235665
* [PowerPC] Use sync inst alias when printingHal Finkel2015-04-231-1/+1
| | | | | | | So long as the choice between printing msync and sync is not ambiguous, we can print 'sync 0' and just 'sync'. llvm-svn: 235663
OpenPOWER on IntegriCloud