Commit Graph

165 Commits

Author SHA1 Message Date
Josh Magee
cde5c26c46 [stackprotector] Implement the sspstrong rules for stack layout.
This changes the PrologueEpilogInserter and LocalStackSlotAllocation passes to
follow the extended stack layout rules for sspstrong and sspreq.

The sspstrong layout rules are:
 1. Large arrays and structures containing large arrays (>= ssp-buffer-size)
are closest to the stack protector.
 2. Small arrays and structures containing small arrays (< ssp-buffer-size) are
2nd closest to the protector.
 3. Variables that have had their address taken are 3rd closest to the
protector.


Differential Revision: http://llvm-reviews.chandlerc.com/D2546


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200601 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-01 01:36:16 +00:00
Reid Kleckner
8a24e83550 Implement inalloca codegen for x86 with the new inalloca design
Calls with inalloca are lowered by skipping all stores for arguments
passed in memory and the initial stack adjustment to allocate argument
memory.

Now the frontend is responsible for the memory layout, and the backend
doesn't have to do any work.  As a result these changes are pretty
minimal.

Reviewers: echristo

Differential Revision: http://llvm-reviews.chandlerc.com/D2637

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200596 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31 23:50:57 +00:00
Matt Arsenault
e932091eb5 Allow speculating llvm.sqrt, fma and fmuladd
This doesn't set errno, so this should be OK.
Also update the documentation to explicitly state
that errno are not set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200501 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-31 00:09:00 +00:00
Juergen Ributzka
6bf3966f7f Extend the preserve_most/all calling convention description in LangRef about the
fact that the argument registers will be preserved too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200441 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-30 02:39:00 +00:00
Reid Kleckner
3cbfa1617f Add an inalloca flag to allocas
Summary:
The only current use of this flag is to mark the alloca as dynamic, even
if its in the entry block.  The stack adjustment for the alloca can
never be folded into the prologue because the call may clear it and it
has to be allocated at the top of the stack.

Reviewers: majnemer

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2571

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199525 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-17 23:58:17 +00:00
Juergen Ributzka
dbee8c1a3f Update LangRef to emphasize the difference between "coldcc" and "preserve_mostcc".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199521 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-17 22:24:35 +00:00
Juergen Ributzka
ceaf829339 Add two new calling conventions for runtime calls
This patch adds two new target-independent calling conventions for runtime
calls - PreserveMost and PreserveAll.
The target-specific implementation for X86-64 is defined as following:
  - Arguments are passed as for the default C calling convention
  - The same applies for the return value(s)
  - PreserveMost preserves all GPRs - except R11
  - PreserveAll preserves all GPRs and all XMMs/YMMs - except R11

Reviewed by Lang and Philip

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199508 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-17 19:47:03 +00:00
Reid Kleckner
ad60d3c304 Change inalloca rules to make it only apply to the last parameter
This makes things a lot easier, because we can now talk about the
"argument allocation", which allocates all the memory for the call in
one shot.

The only functional change is to the verifier for a feature that hasn't
shipped yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199434 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-16 22:59:24 +00:00
Hans Wennborg
268226b9f3 LangRef.rst: fix LangRef data layout text about m specifier, take 2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199286 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-15 02:49:17 +00:00
Hans Wennborg
37a98536bd LangRef: attempt to fix line breaks
The line breaks around the "m:<mangling>" text in the Data Layout section
look weird. Let's see if this helps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199285 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-15 02:30:37 +00:00
Nico Rieck
38f68c5a2e Decouple dllexport/dllimport from linkage
Representing dllexport/dllimport as distinct linkage types prevents using
these attributes on templates and inline functions.

Instead of introducing further mixed linkage types to include linkonce and
weak ODR, the old import/export linkage types are replaced with a new
separate visibility-like specifier:

  define available_externally dllimport void @f() {}
  @Var = dllexport global i32 1, align 4

Linkage for dllexported globals and functions is now equal to their linkage
without dllexport. Imported globals and functions must be either
declarations with external linkage, or definitions with
AvailableExternallyLinkage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199218 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-14 15:22:47 +00:00
Nico Rieck
55463f4ec1 Revert "Decouple dllexport/dllimport from linkage"
Revert this for now until I fix an issue in Clang with it.

This reverts commit r199204.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199207 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-14 12:38:32 +00:00
Nico Rieck
bce07a0c3b Decouple dllexport/dllimport from linkage
Representing dllexport/dllimport as distinct linkage types prevents using
these attributes on templates and inline functions.

Instead of introducing further mixed linkage types to include linkonce and
weak ODR, the old import/export linkage types are replaced with a new
separate visibility-like specifier:

  define available_externally dllimport void @f() {}
  @Var = dllexport global i32 1, align 4

Linkage for dllexported globals and functions is now equal to their linkage
without dllexport. Imported globals and functions must be either
declarations with external linkage, or definitions with
AvailableExternallyLinkage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199204 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-14 11:55:03 +00:00
Rafael Espindola
a9ad60c412 Use 'w' instead of 'c' to represent the win32 mangling.
This change was requested to avoid confusion if we ever support non windows coff
systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198938 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-10 13:42:12 +00:00
Rafael Espindola
177648336a Improve documentation of the 'a' specifier and the '<abi>:<pref>' align pair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198636 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-06 21:40:24 +00:00
Rafael Espindola
4432a618e5 Fix typo.
Thanks to Owen Anderson for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198443 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-03 19:42:04 +00:00
Rafael Espindola
8e0f67dcec Make the llvm mangler depend only on DataLayout.
Before this patch any program that wanted to know the final symbol name of a
GlobalValue had to link with Target.

This patch implements a compromise solution where the mangler uses DataLayout.
This way, any tool that already links with Target (llc, clang) gets the exact
behavior as before and new IR files can be mangled without linking with Target.

With this patch the mangler is constructed with just a DataLayout and DataLayout
is extended to include the information the Mangler needs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198438 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-03 19:21:54 +00:00
Rafael Espindola
33cc3f81c1 Remove the 's' DataLayout specification
During the years there have been some attempts at figuring out how to
align byval arguments. A look at the commit log suggests that they
were

* Use the ABI alignment.
* When that was not sufficient for x86-64, I added the 's' specification to
  DataLayout.
* When that was not sufficient Evan added the virtual getByValTypeAlignment.
* When even that was not sufficient, we just got the FE to add the alignment
  to the byval.

This patch is just a simple cleanup that removes my first attempt at fixing the
problem. I also added an AArch64 implementation of getByValTypeAlignment to
make sure this patch is a nop. I also left the 's' parsing for backward
compatibility.

I will send a short email to llvmdev about the change for anyone maintaining
an out of tree target.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198287 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-01 22:29:43 +00:00
Andrew Trick
e97b13228a LangRef documentation for the stackmap and patchpoint intrinsics.
These still have "experimental" status, meaning we don't guarantee
backward compatibility. However, they are already actively used by the
open source WebKit project, and have started to be adopted by other
projects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197930 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-24 02:57:25 +00:00
Reid Kleckner
4b70bfc905 Begin adding docs and IR-level support for the inalloca attribute
The inalloca attribute is designed to support passing C++ objects by
value in the Microsoft C++ ABI.  It behaves the same as byval, except
that it always implies that the argument is in memory and that the bytes
are never copied.  This attribute allows the caller to take the address
of an outgoing argument's memory and execute arbitrary code to store
into it.

This patch adds basic IR support, docs, and verification.  It does not
attempt to implement any lowering or fix any possibly broken transforms.

When this patch lands, a complete description of this feature should
appear at http://llvm.org/docs/InAlloca.html .

Differential Revision: http://llvm-reviews.chandlerc.com/D2173

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197645 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-19 02:14:12 +00:00
Rafael Espindola
2053a06bd5 Use "a" instead of "a0" in DataLayout.
It means exactly the same and is just a bit shorter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197169 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-12 17:21:51 +00:00
Rafael Espindola
bb0e2be6a3 Use Field Lists for the types' "Overview", "Syntax" and "Examples".
Thanks to Sean Silva for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196924 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-10 14:53:22 +00:00
Rafael Espindola
f7f74c22b1 Remove the notion of primitive types.
They were out of place since the introduction of arbitrary precision integer
types.

This also synchronizes the documentation to Types.h, so it refers to first class
types and single value types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196661 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-07 19:34:20 +00:00
Yunzhong Gao
9477d57763 Document that dllexported symbols are preserved by optimization passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196523 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 18:37:54 +00:00
Alp Toker
087ab613f4 Correct word hyphenations
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities and contractions in nearby lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 05:44:44 +00:00
Sean Silva
fe50a2661d [LangRef] Remove (non-normative) paragraph that doesn't make sense.
It appears to be referring to nonexistent entities. This must be a
carry-over from an older version of the document.

Patch by Mikael Lyngvig!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196342 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 02:19:25 +00:00
Sean Silva
e50e160348 [docs] Mention gotcha regarding implicit BB numbering
Impetus for the clarification by Mikael Lyngvig.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195812 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27 04:55:23 +00:00
Paul Robinson
fe45fd084d The 'optnone' attribute means don't inline anything into this function
(except functions marked always_inline).
Functions with 'optnone' must also have 'noinline' so they don't get
inlined into any other function.

Based on work by Andrea Di Biagio.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195046 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-18 21:44:03 +00:00
Matt Arsenault
ef1b87a1ad Fix typos.
I somehow didn't notice before that the examples
for addrspacecast use the wrong syntax for addrspace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194868 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 22:43:50 +00:00
Matt Arsenault
01ad8c308f Fix grammar in addrspacecast description
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194785 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 05:44:56 +00:00
Matt Arsenault
59d3ae6cdc Add addrspacecast instruction.
Patch by Michele Scandale!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194760 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 01:34:59 +00:00
Rafael Espindola
19794da02c Remove linkonce_odr_auto_hide.
linkonce_odr_auto_hide was in incomplete attempt to implement a way
for the linker to hide symbols that are known to be available in every
TU and whose addresses are not relevant for a particular DSO.

It was redundant in that it all its uses are equivalent to
linkonce_odr+unnamed_addr. Unlike those, it has never been connected
to clang or llvm's optimizers, so it was effectively dead.

Given that nothing produces it, this patch just nukes it
(other than the llvm-c enum value).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193865 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-01 17:09:14 +00:00
Andrew Trick
cf940ceff7 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193765 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 17:18:07 +00:00
Benjamin Kramer
d59761480e Fix common typos in the docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193632 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 17:53:27 +00:00
Rafael Espindola
1313a223ed Clarify that GlobalVariables definitions must have an initializer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193609 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29 13:44:11 +00:00
Bill Wendling
cba7d7d579 A small grammar-os fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193496 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-27 05:09:12 +00:00
Bill Wendling
09f8e132c8 Update to specify that both metadata and label types aren't proper return types.
PR15447

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193492 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-27 04:19:29 +00:00
Shuxin Yang
69bd41dfe3 Revert r193251 : Use address-taken to disambiguate global variable and indirect memops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193489 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-27 03:08:44 +00:00
Shuxin Yang
8e3851a6eb Use address-taken to disambiguate global variable and indirect memops.
Major steps include:
 1). introduces a not-addr-taken bit-field in GlobalVariable
 2). GlobalOpt pass sets "not-address-taken" if it proves a global varirable 
    dosen't have its address taken.
 3). AA use this info for disambiguation. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193251 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 17:28:19 +00:00
Bill Wendling
4216b993ca Write a simple description of the 'target triple' directive. This should be expanded. PR8976.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193014 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-18 23:41:25 +00:00
Bill Wendling
f47ffe08f9 Clarify that an alignment of 0 or 1 on a mem* intrinsic means 'no alignment'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193012 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-18 23:26:55 +00:00
Rafael Espindola
4306e87c61 Remove an outdated statement.
Aliases now have their own section where we document which linkages they can
have.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192825 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-16 18:37:51 +00:00
Rafael Espindola
cfa7d81a45 Fix typo.
Thanks to Sean Silva for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192102 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-07 13:57:59 +00:00
Rafael Espindola
2def17935c Add support for aliases with linkonce_odr.
This will be used to extend constructor aliases in clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192066 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 15:10:43 +00:00
Peter Collingbourne
a4ae405c1f Add a paragraph on prefix data layout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191219 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-23 20:14:21 +00:00
Peter Collingbourne
1e3037f0be Implement function prefix data as an IR feature.
Previous discussion:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063909.html

Differential Revision: http://llvm-reviews.chandlerc.com/D1191

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190773 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-16 01:08:15 +00:00
Nick Lewycky
f7e61562f9 Fix anachronism/typo in syntax of declaration of llvm.va_start.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190552 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 22:04:52 +00:00
Sean Silva
cce639979d [docs] Fix Sphinx warning.
Adornments need to be at least as long as the thing they adorn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190327 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-09 19:13:28 +00:00
Andrea Di Biagio
5768bb8d77 Add function attribute 'optnone'.
This function attribute indicates that the function is not optimized
by any optimization or code generator passes with the 
exception of interprocedural optimization passes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189101 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-23 11:53:55 +00:00
Hal Finkel
66d1fa6f4b Add a llvm.copysign intrinsic
This adds a llvm.copysign intrinsic; We already have Libfunc recognition for
copysign (which is turned into the FCOPYSIGN SDAG node). In order to
autovectorize calls to copysign in the loop vectorizer, we need a corresponding
intrinsic as well.

In addition to the expected changes to the language reference, the loop
vectorizer, BasicTTI, and the SDAG builder (the intrinsic is transformed into
an FCOPYSIGN node, just like the function call), this also adds FCOPYSIGN to a
few lists in LegalizeVector{Ops,Types} so that vector copysigns can be
expanded.

In TargetLoweringBase::initActions, I've made the default action for FCOPYSIGN
be Expand for vector types. This seems correct for all in-tree targets, and I
think is the right thing to do because, previously, there was no way to generate
vector-values FCOPYSIGN nodes (and most targets don't specify an action for
vector-typed FCOPYSIGN).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188728 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-19 23:35:46 +00:00
Michael Gottesman
2bf823e635 [stack protector] Fixed typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188195 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 19:44:09 +00:00
Michael Gottesman
2a64a639e5 [stackprotector] Added intrinsic llvm.stackprotectorcheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188191 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 18:35:32 +00:00
Andrea Di Biagio
1edaeb61b2 Add description of function attribute 'minsize' in LangRef.rst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188091 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09 18:42:18 +00:00
Hal Finkel
41418d17cc Add ISD::FROUND for libm round()
All libm floating-point rounding functions, except for round(), had their own
ISD nodes. Recent PowerPC cores have an instruction for round(), and so here I'm
adding ISD::FROUND so that round() can be custom lowered as well.

For the most part, this is straightforward. I've added an intrinsic
and a matching ISD node just like those for nearbyint() and friends. The
SelectionDAG pattern I've named frnd (because ISD::FP_ROUND has already claimed
fround).

This will be used by the PowerPC backend in a follow-up commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187926 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 22:49:12 +00:00
Sean Silva
e6b1079cd8 [LangRef] Alphabetize function attribute listing.
No content change.

Patch by Andrea Di Biagio!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187811 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-06 19:34:37 +00:00
Matt Arsenault
16e4ed5879 Reject bitcasts between address spaces with different sizes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187506 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-31 17:49:08 +00:00
Nick Lewycky
d1066efaec Fix language.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185739 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-06 01:04:47 +00:00
Nick Lewycky
dc89737bcd Extend 'readonly' and 'readnone' to work on function arguments as well as
functions. Make the function attributes pass add it to known library functions
and when it can deduce it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185735 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-06 00:29:58 +00:00
Michael Gottesman
550d9bf984 Fixed typo in LangRef where we were using _'' to quote instead of the correct _.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 21:32:56 +00:00
Michael Gottesman
e19a858d22 At the request of Richard Smith, swapped the order of cold/builtin so it is in alphabetical order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185113 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-27 22:48:08 +00:00
Michael Gottesman
2253a2f52f Added support for the Builtin attribute.
The Builtin attribute is an attribute that can be placed on function call site that signal that even though a function is declared as being a builtin,

rdar://problem/13727199

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185049 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-27 00:25:01 +00:00
Stephen Lin
8592fba155 Minor grammar and word usage fix to 'returned' parameter attribute section of LangRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-20 21:55:10 +00:00
Stefanus Du Toit
afea27befa Fix typos "metatadata" -> "metadata" in the LangRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184426 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-20 14:02:44 +00:00
Rafael Espindola
9f8e6da019 Require members of llvm.used to be named.
The effect of llvm.used is to introduce an invisible reference, so this seems
a reasonable restriction. It will be used to provide an easy ordering of
the entries in llvm.used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183743 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-11 13:18:13 +00:00
Eli Bendersky
88fe6824ee Add more explicit link targets to headers in LangRef.rst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183555 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 20:24:43 +00:00
Eli Bendersky
1de1410bd2 Add explicit link targets to some headers in LangRef.rst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183548 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 19:40:08 +00:00
Richard Smith
2b18526696 Fix link.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183248 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-04 20:42:42 +00:00
Paul Redmond
26266a1ece Fix warning and resulting formatting issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182939 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-30 17:24:32 +00:00
Paul Redmond
f95ac8a474 Revise llvm.vectorizer.width documentation
- clarify that vectorizer.width only applies if the vectorizer decides to
  vectorize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182938 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-30 17:22:46 +00:00
Paul Redmond
ee21b6f7b4 Add support for llvm.vectorizer metadata
- llvm.loop.parallel metadata has been renamed to llvm.loop to be more generic
  by making the root of additional loop metadata.
  - Loop::isAnnotatedParallel now looks for llvm.loop and associated
    llvm.mem.parallel_loop_access
  - document llvm.loop and update llvm.mem.parallel_loop_access
- add support for llvm.vectorizer.width and llvm.vectorizer.unroll
  - document llvm.vectorizer.* metadata
  - add utility class LoopVectorizerHints for getting/setting loop metadata
  - use llvm.vectorizer.width=1 to indicate already vectorized instead of
    already_vectorized
- update existing tests that used llvm.loop.parallel and
  llvm.vectorizer.already_vectorized

Reviewed by: Nadav Rotem


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182802 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-28 20:00:34 +00:00
Diego Novillo
77226a03dc Add a new function attribute 'cold' to functions.
Other than recognizing the attribute, the patch does little else.
It changes the branch probability analyzer so that edges into
blocks postdominated by a cold function are given low weight.

Added analysis and code generation tests.  Added documentation for the
new attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182638 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-24 12:26:52 +00:00
Tim Northover
5a02fc4b5f ARM: implement @llvm.readcyclecounter intrinsic
This implements the @llvm.readcyclecounter intrinsic as the specific
MRC instruction specified in the ARM manuals for CPUs with the Power
Management extensions.

Older CPUs had slightly different methods which may also have to be
implemented eventually, but this should cover all v7 cases.

rdar://problem/13939186

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182603 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-23 19:11:20 +00:00
Sean Silva
57f429fcac LangRef.rst: Clarify how basic blocks without named label are handled.
Describe that they are assigned numbered label using the same counter
as for unnamed temporaries.

Based on http://llvm.org/bugs/show_bug.cgi?id=16043 and mailing list
discussion.

Patch by Paul Sokolovsky!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182332 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-20 23:31:12 +00:00
Tim Northover
338eba7380 Correct logical shift documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181290 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 06:17:14 +00:00
Richard Sandiford
d07d29213b Remove comment that no target supports 128-bit IEEE floats
The soon-to-be-committed SystemZ port uses 128-bit IEEE floats.
MIPS64 GNU/Linux does too (albeit with unusual NaNs).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181016 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-03 14:32:27 +00:00
Rafael Espindola
cde25b435a Clarify that llvm.used can contain aliases.
Also add a check for llvm.used in the verifier and simplify clients now that
they can assume they have a ConstantArray.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180019 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-22 14:58:02 +00:00
Stephen Lin
456ca048af Add CodeGen support for functions that always return arguments via a new parameter attribute 'returned', which is taken advantage of in target-independent tail call opportunity detection and in ARM call lowering (when placed on an integral first parameter).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179925 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-20 05:14:40 +00:00
Eli Bendersky
f841609c4a Fixes to LangRef.rst: incorrect attributes syntax and misplaced 'nobuiltin'
Patch by Stephen Lin


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179763 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18 16:11:44 +00:00
Eli Bendersky
8c493386ce More consistent formatting and tidying-up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179716 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-17 20:17:08 +00:00
Eli Bendersky
8952d909a5 Make formatting more consistent and tidy-up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179689 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-17 17:17:20 +00:00
Michael Gottesman
872b4e5785 Added documentation to LangRef for the intrinsic llvm.ptr.annotation.* which for some reason was never written.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177950 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 00:34:27 +00:00
Eli Bendersky
48f8015121 Missing period in doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176809 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 16:51:15 +00:00
Michael Liao
2faa0f37c2 Remove tailing whitespaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176570 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 18:24:34 +00:00
Kostya Serebryany
8eec41fc77 Unify clang/llvm attributes for asan/tsan/msan (LLVM part)
These are two related changes (one in llvm, one in clang).
LLVM: 
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG: 
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176075 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-26 06:58:09 +00:00
Pekka Jaaskelainen
45b2c25efb Made it more explicit that the self-referential llvm.loop identifier metadata
should be unique for each loop.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175888 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22 12:03:07 +00:00
Bill Wendling
143d46476c Implement the NoBuiltin attribute.
The 'nobuiltin' attribute is applied to call sites to indicate that LLVM should
not treat the callee function as a built-in function. I.e., it shouldn't try to
replace that function with different code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175835 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-22 00:12:35 +00:00
Paul Redmond
8f0696c7a7 add missing space which prevented the llvm.loop code-block from appearing in the
generated html.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175769 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21 17:20:45 +00:00
Pekka Jaaskelainen
5d0ce79e26 Metadata for annotating loops as parallel. The first consumer for this
metadata is the loop vectorizer.

See the documentation update for more info.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175060 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-13 18:08:57 +00:00
Kostya Serebryany
ab39afa9d9 [tsan/msan] adding thread_safety and uninitialized_checks attributes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174864 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11 08:13:54 +00:00
Bill Wendling
95ce4c2ffb Initial submission for the attribute group feature.
Attribute groups are of the form:

  #0 = attributes { noinline "no-sse" "cpu"="cortex-a8" alignstack=4 }

Target-dependent attributes are represented as strings. Attributes can have
optional values associated with them. E.g., the "cpu" attribute has the value
"cortex-a8".

Target-independent attributes are listed as enums inside the attribute classes.

Multiple attribute groups can be referenced by the same object. In that case,
the attributes are merged together.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174493 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06 06:52:58 +00:00
Bill Wendling
be5d747f69 Alphabetize the function attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174490 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06 06:22:58 +00:00
Michael Gottesman
6c355ee427 Removed reference to LLVM as a project (since in LangRef it is used solely as a reference to the IR). Thanks silvas!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174301 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-04 03:22:00 +00:00
Michael Gottesman
fa987f08fb Added new Global Variable marker ``externally_initialized'' to LangRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174270 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-03 09:57:18 +00:00
Michael Gottesman
4283499dcd Added clarification paragraph to LangRef's documentation of
GlobalVariable about LLVM's assumptions vis-a-vis Global Variable
initial values and Global Variable initializers.

This is in preparation for adding the new keyword
externally_initialized.

Specifically, the patch explains how LLVM optimizes global initializers
by assumign that global variables defined within the module are not
modified from their initial values before the start of the global
initializer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174269 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-03 09:57:15 +00:00
Michael Gottesman
f5735888d5 Fixed a mistake in my previous commit where I changed the wording slightly and forgot to undo the change after changing my mind and deciding to only commit the style changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174041 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 05:48:48 +00:00
Michael Gottesman
3480487172 Formatting Fix. Changed " to `` around the word 'constant' in the Lang Ref
section Global Variable so that the style matches the other keywords in
said section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174040 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 05:44:04 +00:00
Andrew Trick
946317d07b LangRef: Add a Rationale for volatile rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174007 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 00:49:39 +00:00
Andrew Trick
9a6dd02261 ...in light of recent activity related to llvm.memcpy flags. I want to
prevent an llvm developer from mistakenly thinking that just because the
intrinsic has volatile flags that volatile operations can be converted
to or folded into them.

Platforms may rely on volatile loads and stores of natively supported
data width to be executed as single instruction. When compiling
C, this expectation likely holds for l-values of volatile primitive
types with native hardware support, but not necessarily for aggregate
types. The frontend upholds these expectations, which are not
specified in the IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173974 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 21:19:35 +00:00
Patrik Hagglund
3b5f0b0e50 Documentation: Updating the data layout default specifications to
correspond to the code.

Patch by Stephen McGruer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173914 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 09:02:06 +00:00
Dmitri Gribenko
d8acb289a2 Documentation: add empty lines so that lists are properly recognized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173845 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 23:14:41 +00:00