Commit Graph

24752 Commits

Author SHA1 Message Date
Adam Nemet
8452a3f46e [LVer] Remove unused Pass parameter from versionLoop, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245032 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 06:30:26 +00:00
David Majnemer
2dacece9e2 [IR] Add token types
This introduces the basic functionality to support "token types".
The motivation stems from the need to perform operations on a Value
whose provenance cannot be obscured.

There are several applications for such a type but my immediate
motivation stems from WinEH.  Our personality routine enforces a
single-entry - single-exit regime for cleanups.  After several rounds of
optimizations, we may be left with a terminator whose "cleanup-entry
block" is not entirely clear because control flow has merged two
cleanups together.  We have experimented with using labels as operands
inside of instructions which are not terminators to indicate where we
came from but found that LLVM does not expect such exotic uses of
BasicBlocks.

Instead, we can use this new type to clearly associate the "entry point"
and "exit point" of our cleanup.  This is done by having the cleanuppad
yield a Token and consuming it at the cleanupret.
The token type makes it impossible to obscure or otherwise hide the
Value, making it trivial to track the relationship between the two
points.

What is the burden to the optimizer?  Well, it turns out we have already
paid down this cost by accepting that there are certain calls that we
are not permitted to duplicate, optimizations have to watch out for
such instructions anyway.  There are additional places in the optimizer
that we will probably have to update but early examination has given me
the impression that this will not be heroic.

Differential Revision: http://reviews.llvm.org/D11861

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245029 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 05:09:07 +00:00
Chandler Carruth
0d68ddf6ce [PM/AA] Extract the interface for GlobalsModRef into a header along with
its creation function.

This required shifting a bunch of method definitions to be out-of-line
so that we could leave most of the implementation guts in the .cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245021 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:48:20 +00:00
Chandler Carruth
40e8a59ff9 [PM/AA] Hoist the interface to TBAA into a dedicated header along with
its creation function. Update the relevant includes accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245019 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:33:48 +00:00
Chandler Carruth
63147bd117 [PM/AA] Remove a stray #include that snuck in via copy/paste when
creating this header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245016 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:16:11 +00:00
Chandler Carruth
0293ed6a06 [PM/AA] Clean up the SCEV-AA comment formatting and typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245015 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:14:50 +00:00
Chandler Carruth
72644dfdcd [PM/AA] Run clang-format over the SCEV-AA code to normalize the
formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245014 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:12:16 +00:00
Chandler Carruth
217849dc42 [PM/AA] Hoist the SCEV-AA interface to its own header and pull the
creation function into that header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245013 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 03:11:16 +00:00
Chandler Carruth
01910b8f31 [PM/AA] Hoist ScopedNoAliasAA's interface into a header and move the
creation function there.

Same basic refactoring as the other alias analyses. Nothing special
required this time around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245012 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:55:50 +00:00
Chandler Carruth
e115abc777 [PM/AA] Hoist the value handle definition for CFLAA into the header to
satisfy libc++'s std::forward_list which requires the value type to be
complete.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245011 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:50:34 +00:00
Chandler Carruth
519ed7c510 [PM/AA] Extract a minimal interface for CFLAA to its own header file.
I've used forward declarations and reorderd the source code some to make
this reasonably clean and keep as much of the code as possible in the
source file, including all the stratified set details. Just the basic AA
interface and the create function are in the header file, and the header
file is now included into the relevant locations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245009 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:42:20 +00:00
Chandler Carruth
c269c3d555 [PM/AA] Delete two pointlessly overridden methods on the AA interface by
the AA counter pass.

For pointsToConstantMemory, I think this is a "bug fix" as I think the
code as written will actually infloop if ever reached. For the
getModRefInfo, this is a no-op change but with a significantly simpler
form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245007 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:16:12 +00:00
Chandler Carruth
0dc1606c51 [PM/AA] Sink all the actual code from AliasAnalysisCounter back into the
.cpp file to make the header much less noisy.

Also makes it easy to use a static helper rather than a public method
for printing lines of stats.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245006 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:12:12 +00:00
Chandler Carruth
20c9ab5fe6 [PM/AA] Run clang-format over this code to establish a clean baseline
for subsequent changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245005 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:07:05 +00:00
Chandler Carruth
968d0e35a5 [PM/AA] Hoist the AA counter pass into a header to match the analysis
pattern.

Also hoist the creation routine out of the generic header and into the
pass header now that we have one.

I've worked to not make any changes, even formatting ones here. I'll
clean up the formatting and other things in a follow-up patch now that
the code is in the right place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245004 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 02:05:41 +00:00
Chandler Carruth
0d1a277d93 [PM/AA] Remove the function names and class names from doxygen comments
and generally clean up their formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245002 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 01:43:46 +00:00
Chandler Carruth
f6f87835da [PM/AA] Move the LibCall AA creation routine declaration to that
analysis's header file to be more consistent with other analyses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245001 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 01:43:02 +00:00
Chandler Carruth
67bd697ef7 [PM/AA] Run clang-format over LibCallAliasAnalysis prior to making
substantial changes needed for the new pass manager's AA integration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245000 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-14 01:38:25 +00:00
Alex Lorenz
5d09c2f25d MIR Serialization: Change MIR syntax - use custom syntax for MBBs.
This commit modifies the way the machine basic blocks are serialized - now the
machine basic blocks are serialized using a custom syntax instead of relying on
YAML primitives. Instead of using YAML mappings to represent the individual
machine basic blocks in a machine function's body, the new syntax uses a single
YAML block scalar which contains all of the machine basic blocks and
instructions for that function.

This is an example of a function's body that uses the old syntax:

    body:
      - id: 0
        name: entry
        instructions:
          - '%eax = MOV32r0 implicit-def %eflags'
          - 'RETQ %eax'
    ...

The same body is now written like this:

    body: |
      bb.0.entry:
        %eax = MOV32r0 implicit-def %eflags
        RETQ %eax
    ...

This syntax change is motivated by the fact that the bundled machine
instructions didn't map that well to the old syntax which was using a single
YAML sequence to store all of the machine instructions in a block. The bundled
machine instructions internally use flags like BundledPred and BundledSucc to
determine the bundles, and serializing them as MI flags using the old syntax
would have had a negative impact on the readability and the ease of editing
for MIR files. The new syntax allows me to serialize the bundled machine
instructions using a block construct without relying on the internal flags,
for example:

   BUNDLE implicit-def dead %itstate, implicit-def %s1 ... {
      t2IT 1, 24, implicit-def %itstate
      %s1 = VMOVS killed %s0, 1, killed %cpsr, implicit killed %itstate
   }

This commit also converts the MIR testcases to the new syntax. I developed
a script that can convert from the old syntax to the new one. I will post the
script on the llvm-commits mailing list in the thread for this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244982 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13 23:10:16 +00:00
Yaron Keren
4b885ee8e2 Remove and forbid raw_svector_ostream::flush() calls.
After r244870 flush() will only compare two null pointers and return,
doing nothing but wasting run time. The call is not required any more
as the stream and its SmallString are always in sync.

Thanks to David Blaikie for reviewing.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244928 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13 18:12:56 +00:00
Yaron Keren
e65e298541 Remove raw_svector_ostream::resync and users. It's no-op after r244870.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13 12:42:25 +00:00
Yaron Keren
d4177b2705 Modify raw_svector_ostream to use its SmallString without additional buffering.
This is faster and avoids the stream and SmallString state synchronization issue.
resync() is a no-op and may be safely deleted.  I'll do so in a follow-up commit.

Reviewed by Rafael Espindola.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244870 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13 06:19:52 +00:00
Rafael Espindola
42fe3754c5 There is only one saver of strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244854 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13 01:07:02 +00:00
Rafael Espindola
fe4c063626 Return ErrorOr from FileOutputBuffer::create. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244848 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13 00:31:39 +00:00
Dan Gohman
7e5609b45c [WebAssembly] Declare the llvm.wasm.page.size() intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244847 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-13 00:26:04 +00:00
David Blaikie
149fe5ef04 Simplify PackedVector by removing user-defined special members that aren't any different than the defaults
This causes the other special members (like move and copy construction,
and move assignment) to come through for free. Some code in clang was
depending on the (deprecated, in the original code) copy ctor. Now that
there's no user-defined special members, they're all available without
any deprecation concerns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244835 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 23:26:12 +00:00
David Blaikie
4c12d59570 IRBuilder: Use move semantics for the IRBuilderInserter parameter
Just drive by cleanup while fixing -Wdeprecated warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244832 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 23:18:49 +00:00
Chandler Carruth
7d30f78dc2 [PM/AA] Remove the AliasDebugger pass.
This debugger was designed to catch places where the old update API was
failing to be used correctly. As I've removed the update API, it no
longer serves any purpose. We can introduce new debugging aid passes
around any future work w.r.t. updating AAs.

Note that I've updated the documentation here, but really I need to
rewrite the documentation to carefully spell out the ideas around
stateful AA and how things are changing in the AA world. However, I'm
hoping to do that as a follow-up to the refactoring of the AA
infrastructure to work in both old and new pass managers so that I can
write the documentation specific to that world.

Differential Revision: http://reviews.llvm.org/D11984

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244825 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 22:54:47 +00:00
Aaron Ballman
7b9ff8d1d2 Move the object being used to move-initialize when calling the base class' constructor from the ctor-initializer. This should have no effect given the triviality of the class, but it allows for easier maintenance should the semantics of the base class change. NFC intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244812 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 21:10:41 +00:00
Dan Gohman
2a9c6a9a41 Update a comment; Emscripten no longer uses le32 and le64. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244804 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 20:34:40 +00:00
Chandler Carruth
0ba0118816 [PM/AA] Have memdep explicitly get and use TargetLibraryInfo rather than
relying on sneaking it out of its AliasAnalysis.

This abuse of AA (to shuffle TLI around rather than explicitly depending
on it) is going away with my refactor of AA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244778 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 17:47:44 +00:00
Adam Nemet
a395eac8a8 [LoopVer] Optionally allow using memchecks from LAA
r243382 changed the behavior to always require a set of memchecks to be
passed to LoopVer.  This change restores the prior behavior as an
alternative to the new behavior.  This allows the checks to be
implicitly taken from the LAA object.

Patch by Ashutosh Nema!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244763 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 16:51:19 +00:00
Michael Kuperstein
426921ffc7 [X86] Allow x86 call frame optimization to fold more loads into pushes
This abstracts away the test for "when can we fold across a MachineInstruction"
into the the MI interface, and changes call-frame optimization use the same test
the peephole optimizer users.

Differential Revision: http://reviews.llvm.org/D11945

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244729 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 10:14:58 +00:00
Craig Topper
8e7b0427c4 [TableGen] Remove unused constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244718 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 06:43:10 +00:00
Alex Lorenz
c1661a3506 PseudoSourceValue: Transform the mips subclass to target independent subclasses
This commit transforms the mips-specific 'MipsCallEntry' subclass of the
'PseudoSourceValue' class into two, target-independent subclasses named
'GlobalValuePseudoSourceValue' and 'ExternalSymbolPseudoSourceValue'.

This change makes it easier to serialize the pseudo source values by removing
target-specific pseudo source values.

Reviewers: Akira Hatanaka


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244698 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 23:23:17 +00:00
Alex Lorenz
de0129ac08 PseudoSourceValue: Replace global manager with a manager in a machine function.
This commit removes the global manager variable which is responsible for
storing and allocating pseudo source values and instead it introduces a new
manager class named 'PseudoSourceValueManager'. Machine functions now own an
instance of the pseudo source value manager class.

This commit also modifies the 'get...' methods in the 'MachinePointerInfo'
class to construct pseudo source values using the instance of the pseudo
source value manager object from the machine function.

This commit updates calls to the 'get...' methods from the 'MachinePointerInfo'
class in a lot of different files because those calls now need to pass in a
reference to a machine function to those methods.

This change will make it easier to serialize pseudo source values as it will
enable me to transform the mips specific MipsCallEntry PseudoSourceValue
subclass into two target independent subclasses.

Reviewers: Akira Hatanaka


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244693 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 23:09:45 +00:00
Alex Lorenz
c18bd9d600 PseudoSourceValue: Introduce a 'PSVKind' enumerator.
This commit introduces a new enumerator named 'PSVKind' in the
'PseudoSourceValue' class. This enumerator is now used to distinguish between
the various kinds of pseudo source values.

This change is done in preparation for the changes to the pseudo source value
object management and to the PseudoSourceValue's class hierarchy - the next two
PseudoSourceValue commits will get rid of the global variable that manages the
pseudo source values and the mips specific MipsCallEntry subclass.

Reviewers: Akira Hatanaka


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244687 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 22:32:00 +00:00
Alex Lorenz
1e37226acb PseudoSourceValue: Update comments and fix lowercase variable names. NFC.
This commit updates the documentation comments in PseudoSourceValue.cpp and
PseudoSourceValue.h based on the LLVM's documentation style. It also fixes
several instances of variable names that started with a lowercase letter.

This change is done in preparation for the changes to the pseudo source value
object management and to the PseudoSourceValue's class hierarchy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244686 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 22:23:19 +00:00
Alex Lorenz
60ae8c800a Reformat PseudoSourceValue.cpp and PseudoSourceValue.h. NFC.
This commit reformats the files lib/CodeGen/PseudoSourceValue.cpp and
include/llvm/CodeGen/PseudoSourceValue.h using clang-format. This change is
done in preparation for the changes to the pseudo source value object
management and to the PseudoSourceValue's class hierarchy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244685 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 22:17:22 +00:00
Rafael Espindola
b4a4468d7b Revert "Add non-member begin and end so that drop_begin works on iterator_range."
This reverts commit r244620.

MSVC doesn't like it :-(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244621 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 16:26:06 +00:00
Rafael Espindola
a09a71fcea Add non-member begin and end so that drop_begin works on iterator_range.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244620 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 16:12:56 +00:00
Michael Kruse
58cee9e869 [RegionInfo] Verify getRegionFor
Summary:
Check the contents of BBtoRegion during analysis verification. It only takes place if -verify-region-info is passed or LLVM is compiled with XDEBUG.

RegionBase<Tr>::verifyRegion() also checks the RegionInfoBase<Tr>::VerifyRegionInfo flag, which is redundant, but verifyRegion() is public API and might be invoked from other sites. In order to avoid behavioral change, this check is not removed. In any case, no region will be verified unless VerifyRegionInfo is set.

Reviewers: grosser

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11872

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244611 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 15:16:43 +00:00
James Molloy
bee32461e9 Add new ISD nodes: ISD::FMINNAN and ISD::FMAXNAN
The intention of these is to be a corollary to ISD::FMINNUM/FMAXNUM,
differing only on how NaNs are treated. FMINNUM returns the non-NaN
input (when given one NaN and one non-NaN), FMINNAN returns the NaN
input instead.

This patch includes support for scalarizing, widening and splitting
vectors, but not expansion or softening. The reason is that these
should never be needed - FMINNAN nodes are only going to be created
in one place (SDAGBuilder::visitSelect) and there we'll check if the
node is legal or custom. I could preemptively add expand and soften
code, but I'm fairly opposed to adding code I can't test. It's bad
enough I can't create tests with this patch, but at least this code
will be exercised by the ARM and AArch64 backends fairly shortly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244581 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 09:13:05 +00:00
James Molloy
cd45f4f580 Add support for floating-point minnum and maxnum
The select pattern recognition in ValueTracking (as used by InstCombine
and SelectionDAGBuilder) only knew about integer patterns. This teaches
it about minimum and maximum operations.

matchSelectPattern() has been extended to return a struct containing the
existing Flavor and a new enum defining the pattern's behavior when
given one NaN operand.

C minnum() is defined to return the non-NaN operand in this case, but
the idiomatic C "a < b ? a : b" would return the NaN operand.

ARM and AArch64 at least have different instructions for these different cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244580 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 09:12:57 +00:00
Tyler Nowicki
f175a4758b Print vectorization analysis when loop hint is specified.
This patch and a relatec clang patch solve the problem of having to explicitly enable analysis when specifying a loop hint pragma to get the diagnostics. Passing AlwasyPrint as the pass name (see below) causes the front-end to print the diagnostic if the user has specified '-Rpass-analysis' without an '=<target-pass>’. Users of loop hints can pass that compiler option without having to specify the pass and they will get diagnostics for only those loops with loop hints.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244555 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 01:09:15 +00:00
Alex Lorenz
2a04c76ecd MIR Serialization: Serialize UsedPhysRegMask from the machine register info.
This commit serializes the UsedPhysRegMask register mask from the machine
register information class. The mask is serialized as an inverted
'calleeSavedRegisters' mask to keep the output minimal.

This commit also allows the MIR parser to infer this mask from the register
mask operands if the machine function doesn't specify it.

Reviewers: Duncan P. N. Exon Smith


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244548 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 00:32:49 +00:00
Adam Nemet
5bcbae6404 [LAA] Change name from addRuntimeCheck to addRuntimeChecks, NFC
This was requested by Hal in D11205.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244540 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-11 00:09:37 +00:00
Alex Lorenz
2084c0d3a2 MIR Parser: Report an error when a stack object is redefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244536 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 23:50:41 +00:00
Alex Lorenz
dd0dde5b84 MIR Parser: Report an error when a fixed stack object is redefined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244534 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 23:45:02 +00:00
Adam Nemet
3de535e566 [LoopVer] Remove unused pointer partition argument, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 23:05:31 +00:00
Tyler Nowicki
22876919c3 Extend late diagnostics to include late test for runtime pointer checks.
This patch moves checking the threshold of runtime pointer checks to the vectorization requirements (late diagnostics) and emits a diagnostic that infroms the user the loop would be vectorized if not for exceeding the pointer-check threshold. Clang will also append the options that can be used to allow vectorization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244523 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 23:01:55 +00:00
Rafael Espindola
0d34e64f73 Don't iterate over all sections in the ELFFile constructor.
With this we finally have an ELFFile that is O(1) to construct. This is helpful
for programs like lld which have to do their own section walk.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244510 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 21:29:35 +00:00
Rafael Espindola
bfbf462c0d Rename improperly named variable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244507 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 21:25:44 +00:00
Rafael Espindola
4d79d2fcbf Delete getDotSymtabSec.
Another step in avoiding iterating over all sections in the ELFFile constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244496 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 20:25:04 +00:00
Tyler Nowicki
90622a1bc9 Removed unused and incorrectly implemented classof() on Optimization Remark base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244494 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 20:13:32 +00:00
Tyler Nowicki
9224227bc2 Late evaluation of the fast-math vectorization requirement.
This patch moves the verification of fast-math to just before vectorization is done. This way we can tell clang to append the command line options would that allow floating-point commutativity. Specifically those are enableing fast-math or specifying a loop hint. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244489 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 19:51:46 +00:00
Rafael Espindola
47b7f78637 rename toELFShdrIter to getSection and move it closer to getSymbol. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244483 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 19:10:37 +00:00
Rafael Espindola
42f80af623 toELFSymIter and getSymbol are now the same thing. Merge them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244482 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 19:07:56 +00:00
Igor Laevsky
b1b95a51f7 [IndVarSimplify] Make cost estimation in RewriteLoopExitValues smarter
Differential Revision: http://reviews.llvm.org/D11687



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244474 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 18:23:58 +00:00
Silviu Baranga
52aa6d3b71 [TTI] Add a hook for specifying per-target defaults for Interleaved Accesses
Summary:
This adds a hook to TTI which enables us to selectively turn on by default
interleaved access vectorization for targets on which we have have performed
the required benchmarking.

Reviewers: rengolin

Subscribers: rengolin, llvm-commits

Differential Revision: http://reviews.llvm.org/D11901

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244449 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 14:50:54 +00:00
Michael Kruse
4b4562925c [RegionInfo] Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244445 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 13:26:09 +00:00
Michael Kruse
5864ac7711 [RegionInfo] Add debug-time region viewer functions
Summary:
Analogously to Function::viewCFG(), RegionInfo::view() and RegionInfo::viewOnly() are meant to be called in debugging sessions. They open a viewer to show how RegionInfo currently understands the region hierarchy.

The functions viewRegion(Function*) and viewRegionOnly(Function*) invoke a fresh region analysis of the function in contrast to viewRegion(RegionInfo*) and viewRegionOnly(RegionInfo*) which show the current analysis result.

Reviewers: grosser

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11875

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244444 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 13:21:59 +00:00
Michael Kruse
a7bed6c4c5 [RegionInfo] Update old-style comments
Authorized-by: grosser



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244441 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 12:40:41 +00:00
Michael Kruse
833f982d14 [RegionInfo] More descriptive error messages in verifier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244440 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 12:28:52 +00:00
Robert Lougher
0d87d635d7 Trace copies when checking for rematerializability in spill weight calculation
PR24139 contains an analysis of poor register allocation. One of the findings
was that when calculating the spill weight, a rematerializable interval once
split is no longer rematerializable. This is because the isRematerializable
check in CalcSpillWeights.cpp does not follow the copies introduced by live
range splitting (after splitting, the live interval register definition is a
copy which is not rematerializable).

Reviewers: qcolombet

Differential Revision: http://reviews.llvm.org/D11686


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244439 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 11:59:44 +00:00
NAKAMURA Takumi
085ee025f0 Reformat headers in ADT and Support partially.
Note, I didn't reformat entirely, but partially where I touched in previous commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244432 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 04:22:36 +00:00
NAKAMURA Takumi
d1769e33c4 Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244431 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 04:22:09 +00:00
NAKAMURA Takumi
e4b461c8d7 Reformat linebreaks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244430 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 04:21:43 +00:00
NAKAMURA Takumi
8f38c5f0d3 llvm/include/llvm/Support/Memory.h: Fix comment header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244429 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 04:21:19 +00:00
Craig Topper
03973a139d [TableGen] Make StringInit constructor take a StringRef instead of const std::string&. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244426 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-09 22:03:04 +00:00
Adam Nemet
15a7a33742 [LAA] Remove unused pointer partition argument from needsChecking(), NFC
This is no longer used in any of the callers.  Also remove the logic of
handling this argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244421 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-09 20:06:08 +00:00
Adam Nemet
85fb628f1f [LAA] Remove unused pointer partition argument from generateChecks, NFC
LoopDistribution does its own filtering now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244420 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-09 20:06:06 +00:00
David Majnemer
97bdbf60d9 [IR] Remove unused declaration
CatchReturnInst::init is never referenced, remove it.
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244408 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-09 00:32:18 +00:00
Benjamin Kramer
d3c712e50b Fix some comment typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244402 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-08 18:27:36 +00:00
David Majnemer
a39dacef00 [IR] Cleanup some formatting issues in the EH instructions
No functionality change is intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244399 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-08 17:41:21 +00:00
Rafael Espindola
e32110a559 Return early on error. Should fix the asan bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244397 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-08 14:54:09 +00:00
NAKAMURA Takumi
5ba219fe8d 244368: Fix a comment line introduced in r244368. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244388 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-08 01:34:20 +00:00
David Majnemer
8d96c6989e [IR] Stop hacking around a bug in GCC 4.5
GCC 4.5 miscompiled this aspect of LLVM.  We support a minimum version
of 4.7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244387 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-08 01:33:30 +00:00
Rafael Espindola
18f2a33eba Delete dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244378 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-08 00:25:57 +00:00
Rafael Espindola
e84d8c12d5 Convert getSymbolSection to return an ErrorOr.
This function can actually fail since the symbol contains an index to the
section and that can be invalid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244375 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 23:27:14 +00:00
Adam Nemet
0346fc9343 [LAA] Remove unused pointer partition argument from getNumberOfChecks, NFC
This is unused after filtering checks was moved to the clients.

As a result, we can just return the number of the checks in the
precomputed set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244369 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 22:44:21 +00:00
Adam Nemet
32dd24633d [LAA] Make the set of runtime checks part of the state of LAA, NFC
This is the full set of checks that clients can further filter. IOW,
it's client-agnostic.  This makes LAA complete in the sense that it now
provides the two main results of its analysis precomputed:

1. memory dependences via getDepChecker().getInsterestingDependences()
2. run-time checks via getRuntimePointerCheck().getChecks()

However, as a consequence we now compute this information pro-actively.
Thus if the client decides to skip the loop based on the dependences
we've computed the checks unnecessarily.  In order to see whether this
was a significant overhead I checked compile time on SPEC2k6 LTO bitcode
files.  The change was in the noise.

The checks are generated in canCheckPtrAtRT, at the same place where we
used to call groupChecks to merge checks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244368 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 22:44:15 +00:00
Rafael Espindola
310e6c3606 Don't look for a SHT_DYNSYM in the ELFFile's constructor.
Yet another step in not having it scan every section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244353 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 20:11:08 +00:00
Rafael Espindola
8081351a70 Remove the symbol iteration functions that don't take a symbol table.
Another step in making ELFFile's constructor not iterate over all sections.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244351 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 20:07:27 +00:00
Adam Nemet
7ae57e1b53 [LAA] Remove unused pointer partition argument from print(), NFC
This is now handled in the client.  No need for LAA to provide this
variant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244349 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 19:44:48 +00:00
Frederic Riss
e825981a7b [MCDwarf] Use more idiomatic [u]int8_t types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244347 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 19:19:44 +00:00
Cong Hou
433c477edd NFC.
Use a parent class to avoid reduncant code when specializing GraphTraits for T and const T.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 18:04:17 +00:00
Nico Weber
6d6e4e4c1b Add functions to save and restore the PrettyStackTrace state.
PrettyStackTraceHead is a LLVM_THREAD_LOCAL, which means it's just a global
in LLVM_ENABLE_THREADS=NO builds.  If a CrashRecoveryContext is used with
code that uses PrettyStackEntries, and a crash happens, PrettyStackTraceHead is
currently not reset to its pre-crash value.  These functions make it possible
to add a cleanup to such code that does this.

(Not reseting the value then causes the assert in ~PrettyStackTraceEntry() to
fire if the code outside of the CrashRecoveryContext also uses
PrettyStackEntries -- for example, clang when building a module.)

Part of PR11974.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244338 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 17:47:03 +00:00
Rafael Espindola
9b171d27d0 Delete dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244335 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 17:06:05 +00:00
Rafael Espindola
09ad805fcf Don't use a DenseMap to handle SHT_SYMTAB_SHNDX.
It is already a convenient table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244333 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 16:51:44 +00:00
Rafael Espindola
0b35ff9dd4 Delete dead typedef. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244328 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 16:36:47 +00:00
Frederic Riss
e428f29a41 Use 'signed char' instead of 'char'
Hope this fixes the s390 and aarch64 bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244327 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 16:31:59 +00:00
Rafael Espindola
e1358aa4ce Add dynamic_table iterators back to ELF.h.
In tree they are only used by llvm-readobj, but it is also used by
https://github.com/mono/CppSharp.

While at it, add some missing error checking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244320 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 15:25:20 +00:00
Frederic Riss
796478f4f5 [MC/Dwarf] Allow to specify custom parameters for linetable emission.
NFC patch for current users, but llvm-dsymutil will use the new
functionality to adapt to the input linetable.

Based on a patch by Adrian Prantl.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244318 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 15:14:08 +00:00
Tom Stellard
9baa291a86 ELF: Add AMDGPU specific defintions
Reviewers: rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11458

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244303 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 01:35:24 +00:00
Rafael Espindola
8a0ff180e8 Move to llvm-readobj code that is only used there.
lld might end up using a small part of this, but it will be in a much
refactored form. For now this unblocks avoiding the full section scan in the
ELFFile constructor.

This also has a (very small) error handling improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244282 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:54:37 +00:00
David Majnemer
5931147ea2 [IR] Remove TerminateInst's "NameStr" argument
TerminateInst can't have a name because it doesn't produce a result.  No
functionality change is intended, this is just a cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:08:36 +00:00
Frederic Riss
9a7f4507ab Thread premissions through sys::fs::create_director{y|ies}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:04:55 +00:00
Nico Weber
a57926b847 Fix nested CrashRecoveryContexts with LLVM_ENABLE_THREADS=OFF, allow them.
libclang uses a CrashRecoveryContext, and building a module does too. If a
module gets built through libclang, nested CrashRecoveryContexts are used.  They
work fine with threads as things are stored in ThreadLocal variables, but in
LLVM_ENABLE_THREADS=OFF builds the two recovery contexts would write to the
same globals.

To fix, keep active CrashRecoveryContextImpls in a list and have the global
point to the innermost one, and do something similar for
tlIsRecoveringFromCrash.

Necessary (but not sufficient) for PR11974 and PR20325

http://reviews.llvm.org/D11770


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244251 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 19:21:25 +00:00
Nico Rieck
3dd7bf5e76 Rename inst_range() to instructions() for consistency. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244248 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 19:10:45 +00:00