summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [Legalizer] Use SmallSetVector instead of SetVector.Quentin Colombet2017-10-131-1/+1
| | | | | | NFC llvm-svn: 315758
* [LegalizerInfo] Don't evaluate end boundary every time through the loopQuentin Colombet2017-10-131-3/+4
| | | | | | | | Match the LLVM coding standard for loop conditions. NFC. llvm-svn: 315757
* [Legalizer] Only allocate the SetVectors once per function.Quentin Colombet2017-10-131-3/+5
| | | | | | | | | | | | Prior to this patch we used to create SetVectors in temporaries that were created and destroyed for each instruction. Now, instead we create and destroyed them only once, but clear the content for each instruction. This speeds up the pass by ~25%. NFC. llvm-svn: 315756
* Fix -Woverloaded-virtual warning in clang-refactorAlex Lorenz2017-10-131-0/+4
| | | | llvm-svn: 315755
* AMDGPU: Implement hasBitPreservingFPLogicMatt Arsenault2017-10-134-1/+31
| | | | llvm-svn: 315754
* LowerTypeTests: Give imported symbols a type with size 0 so that they are ↵Peter Collingbourne2017-10-134-64/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | not assumed not to alias. It is possible for both a base and a derived class to be satisfied with a unique vtable. If a program contains casts of the same pointer to both of those types, the CFI checks will be lowered to this (with ThinLTO): if (p != &__typeid_base_global_addr) trap(); if (p != &__typeid_derived_global_addr) trap(); The optimizer may then use the first condition combined with the assumption that __typeid_base_global_addr and __typeid_derived_global_addr may not alias to optimize away the second comparison, resulting in an unconditional trap. This patch fixes the bug by giving imported globals the type [0 x i8]*, which prevents the optimizer from assuming that they do not alias. Differential Revision: https://reviews.llvm.org/D38873 llvm-svn: 315753
* [Reassociate] auto-generate better checks; NFCSanjay Patel2017-10-132-20/+23
| | | | | | These would fail if the created variable names changed. llvm-svn: 315752
* [scudo] Allow for non-Android Shared TSD platforms, part 2Kostya Kortchinsky2017-10-133-12/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Follow up to D38826. We introduce `pthread_{get,set}specific` versions of `{get,set}CurrentTSD` to allow for non Android platforms to use the Shared TSD model. We now allow `SCUDO_TSD_EXCLUSIVE` to be defined at compile time. A couple of things: - I know that `#if SANITIZER_ANDROID` is not ideal within a function, but in the end I feel it looks more compact and clean than going the .inc route; I am open to an alternative if anyone has one; - `SCUDO_TSD_EXCLUSIVE=1` requires ELF TLS support (and not emutls as this uses malloc). I haven't found anything to enforce that, so it's currently not checked. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: srhines, llvm-commits Differential Revision: https://reviews.llvm.org/D38854 llvm-svn: 315751
* [analyzer] pr28449: Fix support for various array initializers.Artem Dergachev2017-10-133-8/+23
| | | | | | | | | | | | | | | | | | In some cases the analyzer didn't expect an array-type variable to be initialized with anything other than a string literal. The patch essentially removes the assertion, and ensures relatively sane behavior. There is a bigger problem with these initializers. Currently our memory model (RegionStore) is being ordered to initialize the array with a region that is assumed to be storing the initializer rvalue, and it guesses to copy the contents of that region to the array variable. However, it would make more sense for RegionStore to receive the correct initializer in the first place. This problem isn't addressed with this patch. rdar://problem/27248428 Differential Revision: https://reviews.llvm.org/D23963 llvm-svn: 315750
* [Hexagon] Avoid unused variable warnings in release builds.Benjamin Kramer2017-10-131-0/+4
| | | | | | No functionality change intended. llvm-svn: 315749
* AMDGPU: Look for src mods before fp_extendMatt Arsenault2017-10-133-7/+119
| | | | | | | When selecting modifiers for mad_mix instructions, look at fneg/fabs that occur before the conversion. llvm-svn: 315748
* [aarch64] Support APInt and APFloat in ImmLeaf subclasses and make AArch64 ↵Daniel Sanders2017-10-137-51/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | use them. Summary: The purpose of this patch is to expose more information about ImmLeaf-like PatLeaf's so that GlobalISel can learn to import them. Previously, ImmLeaf could only be used to test int64_t's produced by sign-extending an APInt. Other tests on immediates had to use the generic PatLeaf and extract the constant using C++. With this patch, tablegen will know how to generate predicates for APInt, and APFloat. This will allow it to 'do the right thing' for both SelectionDAG and GlobalISel which require different methods of extracting the immediate from the IR. This is NFC for SelectionDAG since the new code is equivalent to the previous code. It's also NFC for FastISel because FastIselShouldIgnore is 1 for the ImmLeaf subclasses. Enabling FastIselShouldIgnore == 0 for these new subclasses will require a significant re-factor of FastISel. For GlobalISel, it's currently NFC because the relevant code to import the affected rules is not yet present. This will be added in a later patch. Depends on D36086 Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar Reviewed By: qcolombet Subscribers: bjope, aemerson, rengolin, javed.absar, igorb, llvm-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D36534 llvm-svn: 315747
* [SmallPtrSet] Add iterator epoch tracking.Benjamin Kramer2017-10-132-7/+16
| | | | | | This will detect invalid iterators when ABI breaking checks are enabled. llvm-svn: 315746
* [InstCombine] move code to remove repeated constant check; NFCISanjay Patel2017-10-133-19/+17
| | | | | | Also, consolidate tests for this fold in one place. llvm-svn: 315745
* AMDGPU: Implement isFPExtFoldableMatt Arsenault2017-10-133-0/+400
| | | | | | This helps match v_mad_mix* in some cases. llvm-svn: 315744
* [InstCombine] recycle adds for better efficiencySanjay Patel2017-10-131-26/+21
| | | | | | Also, clean up unnecessary matcher capture variable initializations. llvm-svn: 315743
* [analyzer] CStringChecker: pr34460: Avoid a crash when a cast is not modeled.Artem Dergachev2017-10-133-23/+81
| | | | | | | | | | | | | | | | | The checker used to crash when a mempcpy's length argument is symbolic. In this case the cast from 'void *' to 'char *' failed because the respective ElementRegion that represents cast is hard to add on top of the existing ElementRegion that represents the offset to the last copied byte, while preseving a sane memory region structure. Additionally, a few test cases are added (to casts.c) which demonstrate problems caused by existing sloppy work we do with multi-layer ElementRegions. If said cast would be modeled properly in the future, these tests would need to be taken into account. Differential Revision: https://reviews.llvm.org/D38797 llvm-svn: 315742
* Basic: adjust attributes on `nan` LIBBUILTINsSaleem Abdulrasool2017-10-132-299/+299
| | | | | | | | | | | | The `nan` family of functions will inspect the contents of the parameter that they are passed. As a result, the function cannot be annotated as `const`. The documentation of the `const` attribute explicitly states this: Note that a function that has pointer arguments and examines the data pointed to must not be declared const. Adjust the annotations on this family of functions. llvm-svn: 315741
* DAG: Add opcode and source type to isFPExtFreeMatt Arsenault2017-10-134-241/+271
| | | | | | | | This is only currently used for mad/fma transforms. This is the only case where it should be used for AMDGPU, so add an opcode to be sure. llvm-svn: 315740
* Revert "[CodeGen] EmitPointerWithAlignment() to generate TBAA info along ↵Ivan A. Kosarev2017-10-137-84/+36
| | | | | | | | | | with LValue base info", r315731. With this change we fail on the clang-x86_64-linux-selfhost-modules builder. Differential Revision: https://reviews.llvm.org/D38796 llvm-svn: 315739
* [clang-refactor] Apply source replacementsAlex Lorenz2017-10-134-6/+155
| | | | | | | | | | This commit actually brings clang-refactor to a usable state as it can now apply the refactoring changes to source files. The -selection option is now also fully supported. Differential Revision: https://reviews.llvm.org/D38402 llvm-svn: 315738
* [ELF] Recognize additional relocation typesPetr Hosek2017-10-131-0/+4
| | | | | | | | | | These are generated by the linker itself and it shouldn't treat them as unrecognized. This was introduced in r315552 and is triggering an error when building UBSan shared library for i386. Differential Revision: https://reviews.llvm.org/D38899 llvm-svn: 315737
* [analyzer] RetainCount: Ignore annotations on user-made CFRetain wrappers.Artem Dergachev2017-10-132-0/+77
| | | | | | | | | | | | | It is not uncommon for the users to make their own wrappers around CoreFoundation's CFRetain and CFRelease functions that are defensive against null references. In such cases CFRetain is often incorrectly marked as CF_RETURNS_RETAINED. Ignore said annotation and treat such wrappers similarly to the regular CFRetain. rdar://problem/31699502 Differential Revision: https://reviews.llvm.org/D38877 llvm-svn: 315736
* [Hexagon] Minimize number of repeated constant extendersKrzysztof Parzyszek2017-10-135-1/+1939
| | | | | | | | | | | | | | Each constant extender requires an extra instruction, which adds to the code size and also reduces the number of available slots in an instruction packet. In most cases, the value of a repeated constant extender could be loaded into a register, and the instructions using the extender could be replaced with their counterparts that use that register instead. This patch adds a pass that tries to reduce the number of constant extenders, including extenders which differ only in an immediate offset known at compile time, e.g. @global and @global+12. llvm-svn: 315735
* Simplify. NFC.Rafael Espindola2017-10-131-1/+1
| | | | llvm-svn: 315734
* Revert r315148 [TableGen] Avoid unnecessary std::string creationsDaniel Sanders2017-10-132-13/+13
| | | | | | | | I'm about to commit a patch that makes them necessary for getPredCode() and it would be strange for getPredCode() and getImmCode() to require different usage. llvm-svn: 315733
* Fix build.Rafael Espindola2017-10-131-0/+1
| | | | llvm-svn: 315732
* [CodeGen] EmitPointerWithAlignment() to generate TBAA info along with LValue ↵Ivan A. Kosarev2017-10-137-36/+84
| | | | | | | | base info Differential Revision: https://reviews.llvm.org/D38796 llvm-svn: 315731
* [Sanitizers] Add more details to ASan allocator stats report.Alex Shlyapnikov2017-10-132-6/+21
| | | | | | | | | | | | Summary: . Reviewers: cryptoad Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D38834 llvm-svn: 315730
* [X86] Remove 'knm' defines from predefined-arch-macros.c test.Craig Topper2017-10-131-6/+0
| | | | | | Direction seems to be that we dont' want to keep adding these, but I forgot to remove it from the test before I committed r315723. llvm-svn: 315729
* [InstCombine] use local var to reduce code duplication; NFCISanjay Patel2017-10-131-16/+15
| | | | llvm-svn: 315728
* Handle shared symbols in --gc-sections.Rafael Espindola2017-10-132-1/+7
| | | | | | | We don't want to gc a section if it is used via __start_*, but we were doing that if the same symbol was visible in a shared library. llvm-svn: 315727
* [LLVMCore] fix description for OverflowingBinaryOperator; NFCSanjay Patel2017-10-131-3/+3
| | | | llvm-svn: 315726
* [lld] Move Threads to CommonBob Haarman2017-10-1314-26/+27
| | | | | | | | | | | | | | | | Summary: This will allow using the functionality from other linkers. It is also a prerequisite for sharing the error logging code. Reviewers: ruiu Reviewed By: ruiu Subscribers: emaste, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D38822 llvm-svn: 315725
* Simplify. NFC.Rafael Espindola2017-10-131-2/+2
| | | | llvm-svn: 315724
* [X86] Add skeleton support for knm cpuCraig Topper2017-10-134-0/+89
| | | | | | | | This adds support Knights Mill CPU. Preprocessor defines match gcc's implementation. Differential Revision: https://reviews.llvm.org/D38813 llvm-svn: 315723
* [X86] Add initial skeleton support for knm cpuCraig Topper2017-10-133-5/+23
| | | | | | | | This adds Intel's Knights Mill CPU to valid CPU names for the backend. For now its an alias of "knl", but ultimately we need to support AVX5124FMAPS and AVX5124VNNIW instruction sets for it. Differential Revision: https://reviews.llvm.org/D38811 llvm-svn: 315722
* Handle shared and lazy symbol in the gnu hash construction.Rafael Espindola2017-10-133-15/+66
| | | | | | | We were not considering those symbols undefined and they could end up in the end of the dynamic symbol table. llvm-svn: 315721
* Relax test.Rafael Espindola2017-10-131-3/+3
| | | | | | These value are irrelevant for the test. llvm-svn: 315720
* [IPSCCP] Move common functions to ValueLatticeUtils (NFC)Matthew Simpson2017-10-134-62/+113
| | | | | | | | | | | This patch moves some common utility functions out of IPSCCP and makes them available globally. The functions determine if interprocedural data-flow analyses can propagate information through function returns, arguments, and global variables. Differential Revision: https://reviews.llvm.org/D37638 llvm-svn: 315719
* [InstCombine] add hasOneUse check to add-zext-add fold to prevent increasing ↵Sanjay Patel2017-10-132-7/+4
| | | | | | instructions llvm-svn: 315718
* [InstCombine] add tests for add (zext (add nuw X, C2)), C --> zext (add nuw ↵Sanjay Patel2017-10-131-0/+32
| | | | | | X, C2 + C); NFC llvm-svn: 315717
* [llvm-demangle-fuzzer] Add a fuzz target for ItaniumDemangler.Matt Morehouse2017-10-134-0/+58
| | | | | | | | | | | | | | Patch By: hctim Reviewers: morehouse, bogner Reviewed By: bogner Subscribers: bogner, kcc, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38855 llvm-svn: 315716
* [CodeGen] emitOMPArraySectionBase() to generate TBAA info along with LValue ↵Ivan A. Kosarev2017-10-131-5/+10
| | | | | | | | base info Differential Revision: https://reviews.llvm.org/D38795 llvm-svn: 315715
* [llvm-cov] Reland sources-specified.test with addition of "-path-equivalence".Max Moroz2017-10-132-0/+34
| | | | | | | | | | | | Summary: This version of tests should be working properly. Reviewers: vsk Reviewed By: vsk Differential Revision: https://reviews.llvm.org/D38889 llvm-svn: 315714
* [SCEV] Maintain and use a loop->loop invalidation dependencySanjoy Das2017-10-133-118/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change uses the loop use list added in the previous change to remember the loops that appear in the trip count expressions of other loops; and uses it in forgetLoop. This lets us not scan every loop in the function on a forgetLoop call. With this change we no longer invalidate clear out backedge taken counts on forgetValue. I think this is fine -- the contract is that SCEV users must call forgetLoop(L) if their change to the IR could have changed the trip count of L; solely calling forgetValue on a value feeding into the backedge condition of L is not enough. Moreover, I don't think we can strengthen forgetValue to be sufficient for invalidating trip counts without significantly re-architecting SCEV. For instance, if we have the loop: I = *Ptr; E = I + 10; do { // ... } while (++I != E); then the backedge taken count of the loop is 9, and it has no reference to either I or E, i.e. there is no way in SCEV today to re-discover the dependency of the loop's trip count on E or I. So a SCEV client cannot change E to (say) "I + 20", call forgetValue(E) and expect the loop's trip count to be updated. Reviewers: atrick, sunfish, mkazantsev Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D38435 llvm-svn: 315713
* Revert "[lit] Raise the logic for enabling clang & lld substitutions to llvm."Bruno Cardoso Lopes2017-10-131-19/+136
| | | | | | | | | | | | This reverts commit r315627, fixing bot failures: http://green.lab.llvm.org/green/job/clang-stage1-configure-RA LIT is failing to properly apply substitution to debuginfo-tests after this change. rdar://problem/34979568 llvm-svn: 315712
* [X86] Test scalar integer absolutes on 32-bit targets with/without CMOVSimon Pilgrim2017-10-131-18/+35
| | | | llvm-svn: 315711
* Not all buildbots seem to dump the nuw flag in SDAGReid Kleckner2017-10-131-1/+1
| | | | llvm-svn: 315710
* [InstCombine] use AddOne helper to reduce code; NFCSanjay Patel2017-10-131-6/+3
| | | | llvm-svn: 315709
OpenPOWER on IntegriCloud