summaryrefslogtreecommitdiffstats
path: root/llvm/lib
Commit message (Collapse)AuthorAgeFilesLines
* [ARM] Promote small global constants to constant poolsJames Molloy2016-09-154-1/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a constant is unamed_addr and is only used within one function, we can save on the code size and runtime cost of an indirection by changing the global's storage to inside the constant pool. For example, instead of: ldr r0, .CPI0 bl printf bx lr .CPI0: &format_string format_string: .asciz "hello, world!\n" We can emit: adr r0, .CPI0 bl printf bx lr .CPI0: .asciz "hello, world!\n" This can cause significant code size savings when many small strings are used in one function (4 bytes per string). This recommit contains fixes for a nasty bug related to fast-isel fallback - because fast-isel doesn't know about this optimization, if it runs and emits references to a string that we inline (because fast-isel fell back to SDAG) we will end up with an inlined string and also an out-of-line string, and we won't emit the out-of-line string, causing backend failures. llvm-svn: 281604
* GlobalISel: legalize GEP instructions with small offsets.Tim Northover2016-09-152-0/+13
| | | | llvm-svn: 281602
* GlobalISel: relax type constraints on G_ICMP to allow pointers.Tim Northover2016-09-152-3/+2
| | | | llvm-svn: 281600
* GlobalISel: remove "unsized" LLTTim Northover2016-09-158-20/+13
| | | | | | | | It was only really there as a sentinel when instructions had to have precisely one type. Now that registers are typed, each register really has to have a type that is sized. llvm-svn: 281599
* GlobalISel: cache pointer sizes in LLTTim Northover2016-09-155-25/+26
| | | | | | | Otherwise everything that needs to work out what size they are has to keep a DataLayout handy, which is a bit silly and very annoying. llvm-svn: 281597
* Add some shortcuts in LazyValueInfo to reduce compile time of Correlated ↵Wei Mi2016-09-151-0/+29
| | | | | | | | | | | | | | | Value Propagation. The patch is to partially fix PR10584. Correlated Value Propagation queries LVI to check non-null for pointer params of each callsite. If we know the def of param is an alloca instruction, we know it is non-null and can return early from LVI. Similarly, CVP queries LVI to check whether pointer for each mem access is constant. If the def of the pointer is an alloca instruction, we know it is not a constant pointer. These shortcuts can reduce the cost of CVP significantly. Differential Revision: https://reviews.llvm.org/D18066 llvm-svn: 281586
* [libFuzzer] disable test that requires debug info -- it fails on the botKostya Serebryany2016-09-151-5/+0
| | | | llvm-svn: 281584
* [libFuzzer] move the AFL driver build rule test into the uninstrumented dirKostya Serebryany2016-09-152-12/+13
| | | | llvm-svn: 281583
* [libFuzzer] fix print_pcs testKostya Serebryany2016-09-151-2/+2
| | | | llvm-svn: 281580
* [libFuzzer] implement print_pcs with trace-pc-guard. Change the ↵Kostya Serebryany2016-09-155-20/+68
| | | | | | trace-pc-guard heuristic for 8-bit counters to look more like in AFL (not that it's provable better, but the existin test preferes this heuristic) llvm-svn: 281577
* [libFuzzer] add 8-bit counters to trace-pc-guard handlerKostya Serebryany2016-09-155-13/+71
| | | | llvm-svn: 281568
* [InstCombine] refactor eq/ne cases in foldICmpUsingKnownBits() ; NFCISanjay Patel2016-09-141-62/+27
| | | | | | The pattern matching and transforms are identical; the cmp predicate just changes. llvm-svn: 281561
* [pdb] Get rid of Data and RawData in CVType.Zachary Turner2016-09-144-62/+116
| | | | | | | | | | | The `CVType` had two redundant fields which were confusing and error-prone to fill out. By treating member records as a distinct type from leaf records, we are able to simplify this quite a bit. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D24432 llvm-svn: 281556
* [pdb] Write TPI hash values to the TPI stream.Zachary Turner2016-09-148-116/+208
| | | | | | | | | | This completes being able to write all the interesting values of a PDB TPI stream. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D24370 llvm-svn: 281555
* [MC] Handle discardable COFF sections in assemblyReid Kleckner2016-09-142-13/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes a dumpbin warning on objects produced by the MC assembler when starting from text. All .debug$S sections are supposed to be marked IMAGE_SCN_MEM_DISCARDABLE. The main, non-COMDAT .debug$S section had this set, but any comdat ones were not being marked discardable because there was no .section flag for it. This change does two things: - If the section name starts with .debug, implicitly mark the section as discardable. This means we do the same thing as gas on .s files with DWARF from GCC, which is important. - Adds the 'D' flag to the .section directive on COFF to explicitly say a section is discardable. We only emit this flag if the section name does not start with .debug. This allows the user to explicitly tweak their section flags without worrying about magic section names. The only thing you can't do in this scheme is to create a non-discardable section with a name starting with ".debug", but hopefully users don't need that. Reviewers: majnemer, rafael Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24582 llvm-svn: 281554
* Fix auto-upgrade of TBAA tags in Bitcode ReaderMehdi Amini2016-09-143-29/+25
| | | | | | | | | | | | | | | | | | If TBAA is on an intrinsic and it gets upgraded, it'll delete the call instruction that we collected in a vector. Even if we were to use WeakVH, it'll drop the TBAA and we'll hit the assert on the upgrade path. r263673 gave a shot to make sure the TBAA upgrade happens before intrinsics upgrade, but failed to account for all cases. Instead of collecting instructions in a vector, this patch makes it just upgrade the TBAA on the fly, because metadata are always already loaded at this point. Differential Revision: https://reviews.llvm.org/D24533 llvm-svn: 281549
* Fix indentation in codeview codeReid Kleckner2016-09-141-7/+7
| | | | llvm-svn: 281542
* [LTO] Fix commons handlingMehdi Amini2016-09-141-3/+7
| | | | | | | | | | | | | | Previously the prevailing information was not honored, and commons symbols could override a strong definition. This patch fixes it and propose the following semantic for commons: the client should mark as prevailing the commons that it expects the LTO implementation to merge (i.e. take the maximum size and alignment). It implies that commons are allowed to have multiple prevailing definitions. Differential Revision: https://reviews.llvm.org/D24545 llvm-svn: 281538
* Finish renaming remaining analyzeBranch functionsMatt Arsenault2016-09-1446-138/+136
| | | | llvm-svn: 281535
* [Stackmap] Added callsite counts to emitted function information.Sanjoy Das2016-09-141-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It was previously not possible for tools to use solely the stackmap information emitted to reconstruct the return addresses of callsites in the map, which is necessary to use the information to walk a stack. This patch adds per-function callsite counts when emitting the stackmap section in order to resolve the problem. Note that this slightly alters the stackmap format, so external tools parsing these maps will need to be updated. **Problem Details:** Records only store their offset from the beginning of the function they belong to. While these records and the functions are output in program order, it is not possible to determine where the end of one function's records are without the callsite count when processing the records to compute return addresses. Patch by Kavon Farvardin! Reviewers: atrick, ributzka, sanjoy Subscribers: nemanjai Differential Revision: https://reviews.llvm.org/D23487 llvm-svn: 281532
* Revert "[ARM] Promote small global constants to constant pools"Evgeniy Stepanov2016-09-144-145/+1
| | | | | | | | Breaks Android tests by introducing text relocations to ARM binaries. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/25362/steps/run%20asan%20lit%20tests%20%5Barm%2Fbullhead-userdebug%2FMTC20F%5D/logs/stdio llvm-svn: 281526
* [lib/LTO] Fix a typo. NFC.Davide Italiano2016-09-141-1/+1
| | | | llvm-svn: 281517
* Revert "AMDGPU: Use SOPK compare instructions"Matt Arsenault2016-09-146-135/+51
| | | | | | Accidentally committed llvm-svn: 281514
* AMDGPU: Use SOPK compare instructionsMatt Arsenault2016-09-146-51/+135
| | | | llvm-svn: 281513
* Verifier: Mark orphaned DICompileUnits as a debug info failure.Adrian Prantl2016-09-141-10/+10
| | | | | | | | | This is a follow-up to r268778 that adds a couple of missing cases, most notably orphaned compile units. rdar://problem/28193346 llvm-svn: 281508
* Make analyzeBranch family of instruction names consistentMatt Arsenault2016-09-1446-97/+97
| | | | | | | analyzeBranch was renamed to use lowercase first, rename the related set to match. llvm-svn: 281506
* AArch64: Use TTI branch functions in branch relaxationMatt Arsenault2016-09-1435-240/+268
| | | | | | | | | The main change is to return the code size from InsertBranch/RemoveBranch. Patch mostly by Tim Northover llvm-svn: 281505
* [x86] fix formatting; NFCSanjay Patel2016-09-141-28/+20
| | | | llvm-svn: 281504
* [compiler-rt] Avoid instrumenting sanitizer functionsEtienne Bergeron2016-09-141-6/+10
| | | | | | | | | | | | | | | | | | | Summary: Function __asan_default_options is called by __asan_init before the shadow memory got initialized. Instrumenting that function may lead to flaky execution. As the __asan_default_options is provided by users, we cannot expect them to add the appropriate function atttributes to avoid instrumentation. Reviewers: kcc, rnk Subscribers: dberris, chrisha, llvm-commits Differential Revision: https://reviews.llvm.org/D24566 llvm-svn: 281503
* [X86][SSE] Improve recognition of i64 sitofp conversions that can be ↵Simon Pilgrim2016-09-141-0/+17
| | | | | | | | | | | | performed as i32 (PR29078) Until AVX512DQ we only support i64/vXi64 sitofp conversion as scalars. This patch sees if the sign bit extends far enough that we can truncate to a i32 type and then perform sitofp without loss of precision. Differential Revision: https://reviews.llvm.org/D24345 llvm-svn: 281502
* [LoopInterchange] Typo. NFC.Chad Rosier2016-09-141-4/+4
| | | | llvm-svn: 281501
* [LoopInterchange] Add CL option to override cost threshold.Chad Rosier2016-09-141-3/+6
| | | | | | Mostly useful for getting consistent lit testing. llvm-svn: 281500
* [X86][SSE] Don't use PSHUFD directly - lower with generic shuffleSimon Pilgrim2016-09-141-17/+1
| | | | | | Remove the last user of the old getTargetShuffleNode helpers llvm-svn: 281499
* getValueType().getScalarSizeInBits() -> getScalarValueSizeInBits(), round 2 ↵Sanjay Patel2016-09-143-8/+6
| | | | | | ; NFCI llvm-svn: 281498
* [LoopInterchange] Cleanup debug whitespace. NFC.Chad Rosier2016-09-141-4/+4
| | | | llvm-svn: 281497
* getVectorElementType().getSizeInBits() -> getScalarSizeInBits() ; NFCISanjay Patel2016-09-1420-86/+84
| | | | llvm-svn: 281495
* getValueType().getSizeInBits() -> getValueSizeInBits() ; NFCISanjay Patel2016-09-1424-120/+105
| | | | llvm-svn: 281493
* Fix typo in comment [NFC]Etienne Bergeron2016-09-141-1/+1
| | | | llvm-svn: 281492
* AMDGPU: Support folding FrameIndex operandsMatt Arsenault2016-09-141-9/+26
| | | | | | This avoids test regressions in a future commit. llvm-svn: 281491
* getValueType().getScalarSizeInBits() -> getScalarValueSizeInBits() ; NFCISanjay Patel2016-09-147-57/+42
| | | | llvm-svn: 281490
* getScalarType().getSizeInBits() -> getScalarSizeInBits() ; NFCISanjay Patel2016-09-1412-77/+77
| | | | llvm-svn: 281489
* AMDGPU: Improve splitting 64-bit bit ops by constantsMatt Arsenault2016-09-146-88/+272
| | | | | | | | This addresses a TODO to handle operations besides and. This also starts eliminating no-op operations with a constant that can emerge later. llvm-svn: 281488
* [LV] Process pointer IVs with PHINodes in collectLoopUniformsMatthew Simpson2016-09-141-4/+22
| | | | | | | | | | | | | | | This patch moves the processing of pointer induction variables in collectLoopUniforms from the consecutive pointer phase of the analysis to the phi node phase. Previously, if a pointer induction variable was used by both a scalarized non-memory instruction as well as a vectorized memory instruction, we would incorrectly identify the pointer as uniform. Pointer induction variables should be treated the same as other phi nodes. That is, they are uniform if all users of the induction variable and induction variable update are uniform. Differential Revision: https://reviews.llvm.org/D24511 llvm-svn: 281485
* [ARM] Promote small global constants to constant poolsJames Molloy2016-09-144-1/+145
| | | | | | | | | | | | | | | | | | | | | | | | If a constant is unamed_addr and is only used within one function, we can save on the code size and runtime cost of an indirection by changing the global's storage to inside the constant pool. For example, instead of: ldr r0, .CPI0 bl printf bx lr .CPI0: &format_string format_string: .asciz "hello, world!\n" We can emit: adr r0, .CPI0 bl printf bx lr .CPI0: .asciz "hello, world!\n" This can cause significant code size savings when many small strings are used in one function (4 bytes per string). llvm-svn: 281484
* [X86][SSE] Removed unused getTargetShuffleNode functionSimon Pilgrim2016-09-141-17/+0
| | | | llvm-svn: 281481
* Fix code-gen crash on Power9 for insert_vector_elt with variable index (PR30189)Nemanja Ivanovic2016-09-142-2/+16
| | | | | | | | | | | This patch corresponds to review: https://reviews.llvm.org/D24021 In the initial implementation of this instruction, I forgot to account for variable indices. This patch fixes PR30189 and should probably be merged into 3.9.1 (I'll open a bug according to the new instructions). llvm-svn: 281479
* [StackProtector] Use INITIALIZE_TM_PASS instead of INITIALIZE_PASSSilviu Baranga2016-09-141-1/+1
| | | | | | | | | | in order to make sure that its TargetMachine constructor is registered. This allows us to run the PEI machine pass with MIR input (see PR30324). llvm-svn: 281474
* Adding missing directive for Power9.Nemanja Ivanovic2016-09-141-1/+1
| | | | | | | | There is currently no codegen for Power9 that depends on the directive so this is NFC for now but will be important in the future. This was missed in r268950 so I'm adding it now. llvm-svn: 281473
* [X86][SSE] Don't blend vector shifts with MOVSS/MOVSD directly, lower from ↵Simon Pilgrim2016-09-141-10/+10
| | | | | | | | generic shuffle Shuffle lowering will correctly lower to MOVSS/MOVSD/PBLEND, improving commutation opportunities llvm-svn: 281471
* [asan] Enable -asan-use-private-alias on Darwin/Mach-O, add test for ODR ↵Kuba Brecka2016-09-141-1/+2
| | | | | | | | | | false positive with LTO (llvm part) The '-asan-use-private-alias’ option (disabled by default) option is currently only enabled for Linux and ELF, but it also works on Darwin and Mach-O. This option also fixes a known problem with LTO on Darwin (https://github.com/google/sanitizers/issues/647). This patch enables the support for Darwin (but still keeps it off by default) and adds the LTO test case. Differential Revision: https://reviews.llvm.org/D24292 llvm-svn: 281470
OpenPOWER on IntegriCloud