Commit Graph

23539 Commits

Author SHA1 Message Date
Sanjoy Das
ead2d1fbe0 [Statepoints] Support for "patchable" statepoints.
Summary:
This change adds two new parameters to the statepoint intrinsic, `i64 id`
and `i32 num_patch_bytes`.  `id` gets propagated to the ID field
in the generated StackMap section.  If the `num_patch_bytes` is
non-zero then the statepoint is lowered to `num_patch_bytes` bytes of
nops instead of a call (the spill and reload code remains unchanged).
A non-zero `num_patch_bytes` is useful in situations where a language
runtime requires complete control over how a call is lowered.

This change brings statepoints one step closer to patchpoints.  With
some additional work (that is not part of this patch) it should be
possible to get rid of `TargetOpcode::STATEPOINT` altogether.

PlaceSafepoints generates `statepoint` wrappers with `id` set to
`0xABCDEF00` (the old default value for the ID reported in the stackmap)
and `num_patch_bytes` set to `0`.  This can be made more sophisticated
later.

Reviewers: reames, pgavlin, swaroop.sridhar, AndyAyers

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237214 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 23:52:24 +00:00
Diego Novillo
c31e732474 Tidy comments in SampleProfile header. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237197 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 22:03:00 +00:00
Richard Smith
0f696bb57e Add missing #include and forward decl, found by modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237195 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 21:49:03 +00:00
Pat Gavlin
11fb9642dc [Statepoints] Clean up statepoint argument accessors.
Differential Revision: http://reviews.llvm.org/D9622

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237191 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 21:33:48 +00:00
Philip Reames
fab55cf45f [PlaceSafepoints] Switch to being a FunctionPass
The pass doesn't actually modify the module outside of the function being processed. The only confusing piece is that it both inserts calls and then inlines the resulting calls. Given that, it definitely invalidates module level analysis results, but many FunctionPasses do that.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 21:21:18 +00:00
Sanjay Patel
9e2a698369 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237181 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 21:14:24 +00:00
Pete Cooper
762a691bd6 Add a const method to iterator over PHI incoming values.
This will be used in the next commit which converts code to use incoming_values().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 20:05:23 +00:00
Pat Gavlin
81b3ceba60 [Statepoints] Split the calling convention and statepoint flags operand to STATEPOINT into two separate operands.
Differential Revision: http://reviews.llvm.org/D9623

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237166 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 19:50:19 +00:00
Jonathan Roelofs
77686a97a0 Delete dead code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237148 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 16:45:53 +00:00
Douglas Katzman
413b283997 Comment disambiguation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237146 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 15:45:56 +00:00
Sanjay Patel
112c87e94f fix typos, grammar; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237139 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 14:52:42 +00:00
Renato Golin
ed73167673 Change TargetParser enum names to avoid macro conflicts (llvm)
sys/time.h on Solaris (and possibly other systems) defines "SEC" as "1"
using a cpp macro.  The result is that this fails to compile.

Fixes https://llvm.org/PR23482

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237112 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 10:33:58 +00:00
Craig Topper
a4d6a35bf8 Remove unnecessary forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237093 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 06:09:57 +00:00
Eric Christopher
0552d51c45 Migrate existing backends that care about software floating point
to use the information in the module rather than TargetOptions.

We've had and clang has used the use-soft-float attribute for some
time now so have the backends set a subtarget feature based on
a particular function now that subtargets are created based on
functions and function attributes.

For the one middle end soft float check go ahead and create
an overloadable TargetLowering::useSoftFloat function that
just checks the TargetSubtargetInfo in all cases.

Also remove the command line option that hard codes whether or
not soft-float is set by using the attribute for all of the
target specific test cases - for the generic just go ahead and
add the attribute in the one case that showed up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237079 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12 01:26:05 +00:00
Richard Smith
96086ad501 Add more missing #includes, found by modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237062 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 22:41:07 +00:00
Richard Smith
310d031235 Add missing #include, found by modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237061 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 22:32:06 +00:00
Richard Smith
9fa8698925 Add missing #includes, found by modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237060 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 22:31:40 +00:00
David Blaikie
bbd301d97a Readdress r236990, use of static members on a non-static variable.
The TargetRegistry is just a namespace-like class, instantiated in one
place to use a range-based for loop. Instead, expose access to the
registry via a range-based 'targets()' function instead. This makes most
uses a bit awkward/more verbose - but eventually we should just add a
range-based find_if function which will streamline these functions. I'm
happy to mkae them a bit awkward in the interim as encouragement to
improve the algorithms in time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237059 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 22:20:48 +00:00
Sanjay Patel
f6548b86b6 propagate IR-level fast-math-flags to DAG nodes; 2nd try; NFC
This is a less ambitious version of:
http://reviews.llvm.org/rL236546

because that was reverted in:
http://reviews.llvm.org/rL236600

because it caused memory corruption that wasn't related to FMF
but was actually due to making nodes with 2 operands derive from a
plain SDNode rather than a BinarySDNode. 

This patch adds the minimum plumbing necessary to use IR-level
fast-math-flags (FMF) in the backend without actually using
them for anything yet. This is a follow-on to:
http://reviews.llvm.org/rL235997

...which split the existing nsw / nuw / exact flags and FMF
into their own struct.
 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237046 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 21:07:09 +00:00
Andrew Kaylor
aeeca679f7 [WinEH] Update exception numbering to give handlers their own base state.
Differential Revision: http://reviews.llvm.org/D9512



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237014 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 19:41:19 +00:00
Sanjay Patel
da4dc2dadc group getNode() variants by purpose and add comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237013 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 19:34:10 +00:00
Tom Stellard
37848f1ada CodeGen: Make MachineInstr::untieRegOperand() a public function
This makes it easier to update in place instructions with tied operands.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237005 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 17:40:54 +00:00
James Molloy
2605531fe8 Rip min/max pattern matching out of InstCombine and into
ValueTracking.

This matching functionality is useful in more than just InstCombine, so
make it available in ValueTracking.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236998 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 14:42:20 +00:00
Elena Demikhovsky
63df7cd4ea AVX-512: Changed CC parameter in "cmp" intrinsic
from i8 to i32 according to the Intel Spec

by Igor Breger (igor.breger@intel.com)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236979 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 09:03:14 +00:00
Elena Demikhovsky
8189eb4d7e AVX-512: Added SKX instructions and intrinsics:
{add/sub/mul/div/} x {ps/pd} x {128/256} 2. max/min with sae

By Asaf Badouh (asaf.badouh@intel.com)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236971 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-11 06:05:05 +00:00
Tom Stellard
7d66bd3e7f MachineCSE: Add a target query for the LookAheadLimit heurisitic
This is used to determine whether or not to CSE physical register
defs.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236923 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-09 00:56:07 +00:00
Arnold Schwaighofer
75e36e847e ScheduleDAGInstrs: In functions with tail calls PseudoSourceValues are not non-aliasing distinct objects
The code that builds the dependence graph assumes that two PseudoSourceValues
don't alias. In a tail calling function two FixedStackObjects might refer to the
same location. Worse 'immutable' fixed stack objects like function arguments are
not immutable and will be clobbered.

Change this so that a load from a FixedStackObject is not invariant in a tail
calling function and don't return a PseudoSourceValue for an instruction in tail
calling functions when building the dependence graph so that we handle function
arguments conservatively.

Fix for PR23459.

rdar://20740035

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236916 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-08 23:52:00 +00:00
Daniel Berlin
fd5c9868cb Add a comment about DepthFirstIterator's skipchildren behavior
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236904 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-08 21:17:24 +00:00
Renato Golin
a54f2b87f7 TargetParser: FPU/ARCH/EXT parsing refactory - NFC
This new class in a global context contain arch-specific knowledge in order
to provide LLVM libraries, tools and projects with the ability to understand
the architectures. For now, only FPU, ARCH and ARCH extensions on ARM are
supported.

Current behaviour it to parse from free-text to enum values and back, so that
all users can share the same parser and codes. This simplifies a lot both the
ASM/Obj streamers in the back-end (where this came from), and the front-end
parsers for command line arguments (where this is going to be used next).

The previous implementation, using .def/.h includes is deprecated due to its
inflexibility to be built without the backend support and for being too
cumbersome. As more architectures join this scheme, and as more features of
such architectures are added (such as hardware features, type sizes, etc) into
a full blown TargetDescription class, having a set of classes is the most
sane implementation.

The ultimate goal of this refactor both LLVM's and Clang's target description
classes into one unique interface, so that we can de-duplicate and standardise
the descriptions, as well as make it available for other front-ends, tools,
etc.

The FPU parsing for command line options in Clang has been converted to use
this new library and a number of aliases were added for compatibility:
 * A bogus neon-vfpv3 alias (neon defaults to vfp3)
 * armv5/v6
 * {fp4/fp5}-{sp/dp}-d16

Next steps:
 * Port Clang's ARCH/EXT parsing to use this library.
 * Create a TableGen back-end to generate this information.
 * Run this TableGen process regardless of which back-ends are built.
 * Expose more information and rename it to TargetDescription.
 * Continue re-factoring Clang to use as much of it as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236900 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-08 21:04:27 +00:00
Diego Novillo
d4f7f29277 Update Function::getContext documentation. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236899 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-08 21:01:29 +00:00
Pat Gavlin
5c7f7462e4 Extend the statepoint intrinsic to allow statepoints to be marked as transitions from GC-aware code to code that is not GC-aware.
This changes the shape of the statepoint intrinsic from:

  @llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 unused, ...call args, i32 # deopt args, ...deopt args, ...gc args)

to:

  @llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 flags, ...call args, i32 # transition args, ...transition args, i32 # deopt args, ...deopt args, ...gc args)

This extension offers the backend the opportunity to insert (somewhat) arbitrary code to manage the transition from GC-aware code to code that is not GC-aware and back.

In order to support the injection of transition code, this extension wraps the STATEPOINT ISD node generated by the usual lowering lowering with two additional nodes: GC_TRANSITION_START and GC_TRANSITION_END. The transition arguments that were passed passed to the intrinsic (if any) are lowered and provided as operands to these nodes and may be used by the backend during code generation.

Eventually, the lowering of the GC_TRANSITION_{START,END} nodes should be informed by the GC strategy in use for the function containing the intrinsic call; for now, these nodes are instead replaced with no-ops.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-08 18:07:42 +00:00
Jingyue Wu
c417f302cb [NoTTI] reject negative scale in addressing mode
Summary:
I noticed this bug when deubging a WIP on LSR. I wonder whether and how we
should add a regression test for this.

Test Plan: no tests failed.

Reviewers: atrick

Subscribers: hfinkel, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236887 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-08 18:07:24 +00:00
Simon Atanasyan
dfa21e1100 [llvm-readobj/obj2yaml/yaml2obj] Support MIPS machine ELF header flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236807 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-08 07:04:59 +00:00
David Blaikie
66583e4917 [opaque pointer type] Explicit pointee type for GEPOperator/GEPConstantExpr.
Also a couple of other changes to avoid use of
PointerType::getElementType here & there too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236799 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-08 00:42:26 +00:00
Alexey Samsonov
8404686a68 Delete unused createSanitizerCoverageModulePass overload.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236791 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 22:46:06 +00:00
Sergey Dmitrouk
5ef2a17a62 Disable r235989 "Reapply r235977 "[DebugInfo] Add debug locations to constant SD nodes""
Will be re-enabled with missing changes for ConstantFPSDNode and
fixes for wrong locations due to constant coalescing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236758 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 18:33:50 +00:00
Alex Lorenz
9e31c0cf91 YAML: Enable the YAMLParser tests.
This commit enables the tests located in test/YAMLParser directory.
Those tests were never actually enabled, as llvm-lit didn't pick up the
files with the 'data' extension. The commit renames those test files to files
with the 'test' extension so that llvm-lit would find them.

This commit also modifies yaml-bench so that it returns an error status
if an error occurred during parsing. It also adds the '-use-color'
command line option to yaml-bench (to make sure that file check matches
the error messages in the output stream).

This commit modifies some of the renamed tests so that they wouldn't
fail. It gets rid of XFAILs and uses the 'not' command instead for
some of the tests that have to fail during parsing. This commit
also adds some 'FIXME' comments to a couple of tests that are
supposed to fail but currently pass because of various bugs
in the implementation of the yaml parser.

Reviewers: Justin Bogner

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236754 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 18:08:46 +00:00
Simon Atanasyan
bd58bdb7a6 [obj2yaml/yaml2obj] Add SHT_MIPS_ABIFLAGS section support
This change adds support for the SHT_MIPS_ABIFLAGS section
reading/writing to the obj2yaml and yaml2obj tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236738 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 15:40:48 +00:00
Simon Atanasyan
ef7c2568fa [llvm-readobj] Print .MIPS.abiflags section content
This change adds new flag -mips-abi-flags to the llvm-readobj. This flag
forces printing of .MIPS.abiflags section content.

https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking#10.2.1._.MIPS.abiflags

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236737 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 15:40:35 +00:00
Simon Atanasyan
2d0087d82a [MIPS] Move MIPS ABI flags structure constants to the separate header
http://reviews.llvm.org/D9517

The separate header file allows to reuse the MIPS ABI flags structure
constants in other LLVM tools like the llvm-readobj.

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236732 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 14:57:04 +00:00
Simon Atanasyan
f6fa999df3 [llvm-readobj/obj2yaml/yaml2obj] Support more MIPS ELF header flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236728 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 14:04:44 +00:00
Elena Demikhovsky
d08d0340e5 AVX-512: Added all forms of FP compare instructions for KNL and SKX.
Added intrinsics for the instructions. CC parameter of the intrinsics was changed from i8 to i32 according to the spec.

By Igor Breger (igor.breger@intel.com)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236714 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 11:24:42 +00:00
NAKAMURA Takumi
3e9ef05a68 Attributes.h: Fix incorrect \brief introduced in r236666. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236712 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 10:18:56 +00:00
Alexey Samsonov
cddf82ae35 [SanitizerCoverage] Introduce SanitizerCoverageOptions struct.
Summary:
This gives frontend more precise control over collected coverage
information. User can still override these options by passing
-mllvm flags.

No functionality change.

Test Plan: regression test suite.

Reviewers: kcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236687 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 01:00:31 +00:00
Justin Bogner
0518652fc4 IR: Initialize DerefOrNullBytes in the AttrBuilder constructors
MSAN pointed out that this value is used uninitialized:

    http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/3678

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236686 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 00:56:34 +00:00
Vince Harron
a94bd7a780 Added support for building against Android API-9 SDK
Created an abstraction for log2, llvm::Log2 in Support/MathExtras.h

Hid Android problems inside of it

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236680 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-07 00:05:26 +00:00
Akira Hatanaka
e6f0494cd8 Let llc and opt override "-target-cpu" and "-target-features" via command line
options.

This commit fixes a bug in llc and opt where "-mcpu" and "-mattr" wouldn't
override function attributes "-target-cpu" and "-target-features" in the IR.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236677 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-06 23:54:14 +00:00
Sanjoy Das
8a86e2564d [IRBuilder] Add a CreateGCStatepointInvoke.
Renames the original CreateGCStatepoint to CreateGCStatepointCall, and
moves invoke creating functionality from PlaceSafepoints.cpp to
IRBuilder.cpp.

This changes the labels generated for PlaceSafepoints/invokes.ll so use
a regex there to make the basic block labels more resilient.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236672 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-06 23:53:09 +00:00
Akira Hatanaka
4f28a76c25 Factor out a function which determines the cpu and feature strings based on
command line options -mcpu and -mattr. NFC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236671 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-06 23:49:24 +00:00
Alex Lorenz
9daa4b18f7 YAML: Fix crash in the skip method of KeyValueNode class.
This commit changes the 'skip' method in the 'KeyValueNode' class
to ensure that it doesn't dereference a null pointer when calling 
the 'skip' method of its value child node. It also adds a unittest
that ensures that the crash doesn't occur.

This change is motivated by a patch that implements parsing
of YAML block scalars (http://reviews.llvm.org/D9503), as one
of the unittests in that patch triggered this problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236669 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-06 23:21:29 +00:00