Commit Graph

119 Commits

Author SHA1 Message Date
Tobias Grosser fbe95dcfd2 [LangRef] Improve llvm.mem.parallel_loop_access example
The following changes have been applied:

  - Removed 'align 4'. We can simplify this away, as it does not provide useful
    information in the example.
  - Use named instructions instead of '%0'. This is nicer, but more importantly
    this makes the IR valid. Before we had two assignments to %0 in a single
    example.
  - Add a missing branch instruction to make the loop structure clear.
  - Move one access into outer.for.body to make it not look that empty.
  - The statments that are only in the outer loop body should not reference the
    inner loop metadata, but only the outer loop. Only statements in both loops
    should reference both surrounding loops.
  - Rename the array indexes to make them all independent. Before there were
    identical array indexes in the inner and the outer loop. We want to
    avoid this special case as it may lead to confusion.

llvm-svn: 202973
2014-03-05 13:36:04 +00:00
Reid Kleckner 9a16d088f6 Change x86mmx -> x86_mmx in LangRef.rst
The correct name of the type in LLVM assembly is "x86_mmx".  Also remove
the reST label "t_x86mmx" because it was unused anyway.

Patch by Manuel Jacob!

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

llvm-svn: 202929
2014-03-05 02:41:37 +00:00
Reid Kleckner 7c84d1d3f7 LangRef: Remove stale docs on LLVM types in module structure
The distinction between "identified" and "literal" struct types is fully
documented in a later section.

Patch by Philip Reames!

llvm-svn: 202927
2014-03-05 02:21:50 +00:00
Duncan P. N. Exon Smith 1ff08e389f Lower llvm.expect intrinsic correctly for i1
LowerExpectIntrinsic previously only understood the idiom of an expect
intrinsic followed by a comparison with zero. For llvm.expect.i1, the
comparison would be stripped by the early-cse pass.

Patch by Daniel Micay.

llvm-svn: 200664
2014-02-02 22:43:55 +00:00
Josh Magee 24c7f06333 [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

llvm-svn: 200601
2014-02-01 01:36:16 +00:00
Reid Kleckner f5b76518c9 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

llvm-svn: 200596
2014-01-31 23:50:57 +00:00
Matt Arsenault ee364ee729 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.

llvm-svn: 200501
2014-01-31 00:09:00 +00:00
Juergen Ributzka 980f2dc4fc Extend the preserve_most/all calling convention description in LangRef about the
fact that the argument registers will be preserved too.

llvm-svn: 200441
2014-01-30 02:39:00 +00:00
Reid Kleckner 436c42ec3d 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

llvm-svn: 199525
2014-01-17 23:58:17 +00:00
Juergen Ributzka 5d05ed1d17 Update LangRef to emphasize the difference between "coldcc" and "preserve_mostcc".
llvm-svn: 199521
2014-01-17 22:24:35 +00:00
Juergen Ributzka e625013071 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

llvm-svn: 199508
2014-01-17 19:47:03 +00:00
Reid Kleckner 60d3a835ff 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.

llvm-svn: 199434
2014-01-16 22:59:24 +00:00
Hans Wennborg d4245acf19 LangRef.rst: fix LangRef data layout text about m specifier, take 2
llvm-svn: 199286
2014-01-15 02:49:17 +00:00
Hans Wennborg 773353b174 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.

llvm-svn: 199285
2014-01-15 02:30:37 +00:00
Nico Rieck 7157bb765e 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.

llvm-svn: 199218
2014-01-14 15:22:47 +00:00
Nico Rieck 9d2e0df049 Revert "Decouple dllexport/dllimport from linkage"
Revert this for now until I fix an issue in Clang with it.

This reverts commit r199204.

llvm-svn: 199207
2014-01-14 12:38:32 +00:00
Nico Rieck e43aaf7967 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.

llvm-svn: 199204
2014-01-14 11:55:03 +00:00
Rafael Espindola af77e1205a 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.

llvm-svn: 198938
2014-01-10 13:42:12 +00:00
Rafael Espindola abdd726ce5 Improve documentation of the 'a' specifier and the '<abi>:<pref>' align pair.
llvm-svn: 198636
2014-01-06 21:40:24 +00:00
Rafael Espindola aa842f06bd Fix typo.
Thanks to Owen Anderson for noticing it.

llvm-svn: 198443
2014-01-03 19:42:04 +00:00
Rafael Espindola 58873566b3 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.

llvm-svn: 198438
2014-01-03 19:21:54 +00:00
Rafael Espindola 6994fdf33c 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.

llvm-svn: 198287
2014-01-01 22:29:43 +00:00
Andrew Trick 5e029cecdf 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.

llvm-svn: 197930
2013-12-24 02:57:25 +00:00
Reid Kleckner a534a38130 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

llvm-svn: 197645
2013-12-19 02:14:12 +00:00
Rafael Espindola e8f4d58700 Use "a" instead of "a0" in DataLayout.
It means exactly the same and is just a bit shorter.

llvm-svn: 197169
2013-12-12 17:21:51 +00:00
Rafael Espindola 2f6d7b96e7 Use Field Lists for the types' "Overview", "Syntax" and "Examples".
Thanks to Sean Silva for the suggestion.

llvm-svn: 196924
2013-12-10 14:53:22 +00:00
Rafael Espindola 080133453b 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.

llvm-svn: 196661
2013-12-07 19:34:20 +00:00
Yunzhong Gao f5b769e4f2 Document that dllexported symbols are preserved by optimization passes.
llvm-svn: 196523
2013-12-05 18:37:54 +00:00
Alp Toker f907b891da Correct word hyphenations
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities and contractions in nearby lines.

llvm-svn: 196471
2013-12-05 05:44:44 +00:00
Sean Silva e6c6d56cab [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!

llvm-svn: 196342
2013-12-04 02:19:25 +00:00
Sean Silva 6cda6dc6cf [docs] Mention gotcha regarding implicit BB numbering
Impetus for the clarification by Mikael Lyngvig.

llvm-svn: 195812
2013-11-27 04:55:23 +00:00
Paul Robinson dcbe35bad5 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.

llvm-svn: 195046
2013-11-18 21:44:03 +00:00
Matt Arsenault 9c13dd027b Fix typos.
I somehow didn't notice before that the examples
for addrspacecast use the wrong syntax for addrspace.

llvm-svn: 194868
2013-11-15 22:43:50 +00:00
Matt Arsenault 54a2a179a1 Fix grammar in addrspacecast description
llvm-svn: 194785
2013-11-15 05:44:56 +00:00
Matt Arsenault b03bd4d96b Add addrspacecast instruction.
Patch by Michele Scandale!

llvm-svn: 194760
2013-11-15 01:34:59 +00:00
Rafael Espindola 716e7405d3 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).

llvm-svn: 193865
2013-11-01 17:09:14 +00:00
Andrew Trick d4d1d9c06e whitespace
llvm-svn: 193765
2013-10-31 17:18:07 +00:00
Benjamin Kramer 3b32b2ff10 Fix common typos in the docs.
llvm-svn: 193632
2013-10-29 17:53:27 +00:00
Rafael Espindola 5d1b745689 Clarify that GlobalVariables definitions must have an initializer.
llvm-svn: 193609
2013-10-29 13:44:11 +00:00
Bill Wendling 6822ecb087 A small grammar-os fixed.
llvm-svn: 193496
2013-10-27 05:09:12 +00:00
Bill Wendling e9d5c4809d Update to specify that both metadata and label types aren't proper return types.
PR15447

llvm-svn: 193492
2013-10-27 04:19:29 +00:00
Shuxin Yang 2e1890e18b Revert r193251 : Use address-taken to disambiguate global variable and indirect memops.
llvm-svn: 193489
2013-10-27 03:08:44 +00:00
Shuxin Yang e4fb375995 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. 

llvm-svn: 193251
2013-10-23 17:28:19 +00:00
Bill Wendling 5cc9084dd7 Write a simple description of the 'target triple' directive. This should be expanded. PR8976.
llvm-svn: 193014
2013-10-18 23:41:25 +00:00
Bill Wendling 61163151f7 Clarify that an alignment of 0 or 1 on a mem* intrinsic means 'no alignment'.
llvm-svn: 193012
2013-10-18 23:26:55 +00:00
Rafael Espindola fd69f369a6 Remove an outdated statement.
Aliases now have their own section where we document which linkages they can
have.

llvm-svn: 192825
2013-10-16 18:37:51 +00:00
Rafael Espindola 65785497bf Fix typo.
Thanks to Sean Silva for noticing it.

llvm-svn: 192102
2013-10-07 13:57:59 +00:00
Rafael Espindola 78527050c2 Add support for aliases with linkonce_odr.
This will be used to extend constructor aliases in clang.

llvm-svn: 192066
2013-10-06 15:10:43 +00:00
Peter Collingbourne 213358aeaa Add a paragraph on prefix data layout.
llvm-svn: 191219
2013-09-23 20:14:21 +00:00
Peter Collingbourne 3fa50f9b05 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

llvm-svn: 190773
2013-09-16 01:08:15 +00:00