History log of /llvm-project/llvm/lib/IR/Function.cpp (Results 326 – 350 of 370)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 059ecbfb 24-Nov-2014 Philip Reames <listmail@philipreames.com>

Incorporate review comments from r221742

This change implements the comment and style changes Sean requested during post commit review with r221742. Sorry for the delay.

llvm-svn: 222707


# 9e5089a9 23-Nov-2014 Elena Demikhovsky <elena.demikhovsky@intel.com>

Masked Vector Load and Store Intrinsics.
Introduced new target-independent intrinsics in order to support masked vector loads and stores. The loop vectorizer optimizes loops containing conditional me

Masked Vector Load and Store Intrinsics.
Introduced new target-independent intrinsics in order to support masked vector loads and stores. The loop vectorizer optimizes loops containing conditional memory accesses by generating these intrinsics for existing targets AVX2 and AVX-512. The vectorizer asks the target about availability of masked vector loads and stores.
Added SDNodes for masked operations and lowering patterns for X86 code generator.
Examples:
<16 x i32> @llvm.masked.load.v16i32(i8* %addr, <16 x i32> %passthru, i32 4 /* align */, <16 x i1> %mask)
declare void @llvm.masked.store.v8f64(i8* %addr, <8 x double> %value, i32 4, <8 x i1> %mask)

Scalarizer for other targets (not AVX2/AVX-512) will be done in a separate patch.

http://reviews.llvm.org/D6191

llvm-svn: 222632

show more ...


# 319c48eb 12-Nov-2014 Philip Reames <listmail@philipreames.com>

Extend intrinsic name mangling to support arrays, named structs, and function types.

Currently, we have a type parameter mechanism for intrinsics. Rather than having to specify a separate intrinsic

Extend intrinsic name mangling to support arrays, named structs, and function types.

Currently, we have a type parameter mechanism for intrinsics. Rather than having to specify a separate intrinsic for each combination of argument and return types, we can specify a single intrinsic with one or more type parameters. These type parameters are passed explicitly to Intrinsic::getDeclaration or can be specified implicitly in the naming of the intrinsic function in an LL file.

Today, the types are limited to integer, floating point, and pointer types. With a goal of supporting symbolic targets for patchpoints and statepoints, this change adds support for function types. The change also includes support for first class aggregate types (named structures and arrays) since these appear in function types we've encountered.

Reviewed by: atrick, ributzka
Differential Revision: http://reviews.llvm.org/D4608

llvm-svn: 221742

show more ...


# d4bcefc7 24-Oct-2014 Rafael Espindola <rafael.espindola@gmail.com>

Don't ever call materializeAllPermanently during LTO.

To do this, change the representation of lazy loaded functions.

The previous representation cannot differentiate between a function whose body

Don't ever call materializeAllPermanently during LTO.

To do this, change the representation of lazy loaded functions.

The previous representation cannot differentiate between a function whose body
has been removed and one whose body hasn't been read from the .bc file. That
means that in order to drop a function, the entire body had to be read.

llvm-svn: 220580

show more ...


# 1b47a28f 23-Oct-2014 Rafael Espindola <rafael.espindola@gmail.com>

clang-format two code snippets to make the next patch easy to read.

llvm-svn: 220484


# 65c27568 20-Oct-2014 Robert Khasanov <rob.khasanov@gmail.com>

Moved out IIT_V64 from common values section.
Thanks Juergen Ributzka for notice.

llvm-svn: 220224


# d05affcc 20-Oct-2014 Steven Wu <stevenwu@apple.com>

Fix Intrinsic::getType not working with vararg

VarArg Intrinsic functions are encoded with "void" type as the last
argument. Now Intrinsic::getType can correctly return all the intrinsic
function ty

Fix Intrinsic::getType not working with vararg

VarArg Intrinsic functions are encoded with "void" type as the last
argument. Now Intrinsic::getType can correctly return all the intrinsic
function type.

llvm-svn: 220205

show more ...


# b25e562d 30-Sep-2014 Robert Khasanov <rob.khasanov@gmail.com>

[AVX512] Added intrinsics for VPCMPEQB and VPCMPEQW.
Added new operand type for intrinsics (IIT_V64)

llvm-svn: 218668


Revision tags: llvmorg-3.5.0, llvmorg-3.5.0-rc4
# e1d12948 27-Aug-2014 Craig Topper <craig.topper@gmail.com>

Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created.

llvm-svn: 216525


Revision tags: llvmorg-3.5.0-rc3, llvmorg-3.5.0-rc2
# 384c3b5c 05-Aug-2014 Juergen Ributzka <juergen@apple.com>

Provide convenient access to the zext/sext attributes of function arguments. NFC.

llvm-svn: 214843


Revision tags: llvmorg-3.5.0-rc1
# b0407ba0 18-Jul-2014 Hal Finkel <hfinkel@anl.gov>

Add a dereferenceable attribute

This attribute indicates that the parameter or return pointer is
dereferenceable. Practically speaking, loads from such a pointer within the
associated byte range are

Add a dereferenceable attribute

This attribute indicates that the parameter or return pointer is
dereferenceable. Practically speaking, loads from such a pointer within the
associated byte range are safe to speculatively execute. Such pointer
parameters are common in source languages (C++ references, for example).

llvm-svn: 213385

show more ...


# 4e63fc49 04-Jul-2014 Saleem Abdulrasool <compnerd@compnerd.org>

TableGen: introduce support for MSBuiltin

Add MSBuiltin which is similar in vein to GCCBuiltin. This allows for adding
intrinsics for Microsoft compatibility to individual instructions. This is
ne

TableGen: introduce support for MSBuiltin

Add MSBuiltin which is similar in vein to GCCBuiltin. This allows for adding
intrinsics for Microsoft compatibility to individual instructions. This is
needed to permit the creation of ARM specific MSVC extensions.

This is not currently in use, and requires an associated change in clang to
enable use of the intrinsics defined by this new class. This merely sets the
LLVM portion of the infrastructure in place to permit the use of this
functionality. A separate set of changes will enable the new intrinsics.

llvm-svn: 212350

show more ...


# d52b1528 20-May-2014 Nick Lewycky <nicholas@mxc.ca>

Add 'nonnull', a new parameter and return attribute which indicates that the pointer is not null. Instcombine will elide comparisons between these and null. Patch by Luqman Aden!

llvm-svn: 209185


Revision tags: llvmorg-3.4.2, llvmorg-3.4.2-rc1
# 99e05cf1 13-May-2014 Rafael Espindola <rafael.espindola@gmail.com>

Split GlobalValue into GlobalValue and GlobalObject.

This allows code to statically accept a Function or a GlobalVariable, but
not an alias. This is already a cleanup by itself IMHO, but the main
re

Split GlobalValue into GlobalValue and GlobalObject.

This allows code to statically accept a Function or a GlobalVariable, but
not an alias. This is already a cleanup by itself IMHO, but the main
reason for it is that it gives a lot more confidence that the refactoring to fix
the design of GlobalAlias is correct. That will be a followup patch.

llvm-svn: 208716

show more ...


# 79418564 09-May-2014 Reid Kleckner <reid@kleckner.net>

Allow sret on the second parameter as well as the first

MSVC always places the implicit sret parameter after the implicit this
parameter of instance methods. We used to handle this for
x86_thiscall

Allow sret on the second parameter as well as the first

MSVC always places the implicit sret parameter after the implicit this
parameter of instance methods. We used to handle this for
x86_thiscallcc by allocating the sret parameter on the stack and leaving
the this pointer in ecx, but that doesn't handle alternative calling
conventions like cdecl, stdcall, fastcall, or the win64 convention.

Instead, change the verifier to allow sret on the second parameter.

This also requires changing the Mips and X86 backends to return the
argument with the sret parameter, instead of assuming that the sret
parameter comes first.

The Sparc backend also returns sret parameters in a register, but I
wasn't able to update it to handle secondary sret parameters. It
currently calls report_fatal_error if you feed it an sret in the second
parameter.

Reviewers: rafael.espindola, majnemer

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

llvm-svn: 208453

show more ...


# b2ea3397 09-May-2014 Rafael Espindola <rafael.espindola@gmail.com>

Run clang-format in small sections of code to make a patch easier to read.

llvm-svn: 208419


Revision tags: llvmorg-3.4.1, llvmorg-3.4.1-rc2, llvmorg-3.4.1-rc1
# c620761c 09-Apr-2014 Craig Topper <craig.topper@gmail.com>

[C++11] More 'nullptr' conversion or in some cases just using a boolean check instead of comparing to nullptr.

llvm-svn: 205831


# 4516de34 29-Mar-2014 Tim Northover <tnorthover@apple.com>

Intrinsics: add LLVMHalfElementsVectorType constraint

This is like the LLVMMatchType, except the verifier checks that the
second argument is a vector with the same base type and half the
number of e

Intrinsics: add LLVMHalfElementsVectorType constraint

This is like the LLVMMatchType, except the verifier checks that the
second argument is a vector with the same base type and half the
number of elements.

This will be used by the ARM64 backend.

llvm-svn: 205079

show more ...


# aa3cf1e6 28-Mar-2014 Tim Northover <tnorthover@apple.com>

Intrinsics: expand semantics of LLVMExtendedVectorType (& trunc)

These are used in the ARM backends to aid type-checking on patterns involving
intrinsics. By making sure one argument is an extended/

Intrinsics: expand semantics of LLVMExtendedVectorType (& trunc)

These are used in the ARM backends to aid type-checking on patterns involving
intrinsics. By making sure one argument is an extended/truncated version of
another.

However, there's no reason to limit them to just vectors types. For example
AArch64 has the instruction "uqshrn sD, dN, #imm" which would naturally use an
intrinsic taking an i64 and returning an i32.

llvm-svn: 205003

show more ...


# ad6efbfa 12-Mar-2014 Evan Cheng <evan.cheng@apple.com>

Revert r203488 and r203520.

llvm-svn: 203687


# 0e8f4612 10-Mar-2014 Evan Cheng <evan.cheng@apple.com>

For functions with ARM target specific calling convention, when simplify-libcall
optimize a call to a llvm intrinsic to something that invovles a call to a C
library call, make sure it sets the right

For functions with ARM target specific calling convention, when simplify-libcall
optimize a call to a llvm intrinsic to something that invovles a call to a C
library call, make sure it sets the right calling convention on the call.

e.g.
extern double pow(double, double);
double t(double x) {
return pow(10, x);
}

Compiles to something like this for AAPCS-VFP:
define arm_aapcs_vfpcc double @t(double %x) #0 {
entry:
%0 = call double @llvm.pow.f64(double 1.000000e+01, double %x)
ret double %0
}

declare double @llvm.pow.f64(double, double) #1

Simplify libcall (part of instcombine) will turn the above into:
define arm_aapcs_vfpcc double @t(double %x) #0 {
entry:
%__exp10 = call double @__exp10(double %x) #1
ret double %__exp10
}

declare double @__exp10(double)

The pre-instcombine code works because calls to LLVM builtins are special.
Instruction selection will chose the right calling convention for the call.
However, the code after instcombine is wrong. The call to __exp10 will use
the C calling convention.

I can think of 3 options to fix this.

1. Make "C" calling convention just work since the target should know what CC
is being used.

This doesn't work because each function can use different CC with the "pcs"
attribute.

2. Have Clang add the right CC keyword on the calls to LLVM builtin.

This will work but it doesn't match the LLVM IR specification which states
these are "Standard C Library Intrinsics".

3. Fix simplify libcall so the resulting calls to the C routines will have the
proper CC keyword. e.g.
%__exp10 = call arm_aapcs_vfpcc double @__exp10(double %x) #1

This works and is the solution I implemented here.

Both solutions #2 and #3 would work. After carefully considering the pros and
cons, I decided to implement #3 for the following reasons.

1. It doesn't change the "spec" of the intrinsics.
2. It's a self-contained fix.

There are a couple of potential downsides.
1. There could be other places in the optimizer that is broken in the same way
that's not addressed by this.
2. There could be other calling conventions that need to be propagated by
simplify-libcall that's not handled.

But for now, this is the fix that I'm most comfortable with.

llvm-svn: 203488

show more ...


# cdf47884 09-Mar-2014 Chandler Carruth <chandlerc@gmail.com>

[C++11] Add range based accessors for the Use-Def chain of a Value.

This requires a number of steps.
1) Move value_use_iterator into the Value class as an implementation
detail
2) Change it to ac

[C++11] Add range based accessors for the Use-Def chain of a Value.

This requires a number of steps.
1) Move value_use_iterator into the Value class as an implementation
detail
2) Change it to actually be a *Use* iterator rather than a *User*
iterator.
3) Add an adaptor which is a User iterator that always looks through the
Use to the User.
4) Wrap these in Value::use_iterator and Value::user_iterator typedefs.
5) Add the range adaptors as Value::uses() and Value::users().
6) Update *all* of the callers to correctly distinguish between whether
they wanted a use_iterator (and to explicitly dig out the User when
needed), or a user_iterator which makes the Use itself totally
opaque.

Because #6 requires churning essentially everything that walked the
Use-Def chains, I went ahead and added all of the range adaptors and
switched them to range-based loops where appropriate. Also because the
renaming requires at least churning every line of code, it didn't make
any sense to split these up into multiple commits -- all of which would
touch all of the same lies of code.

The result is still not quite optimal. The Value::use_iterator is a nice
regular iterator, but Value::user_iterator is an iterator over User*s
rather than over the User objects themselves. As a consequence, it fits
a bit awkwardly into the range-based world and it has the weird
extra-dereferencing 'operator->' that so many of our iterators have.
I think this could be fixed by providing something which transforms
a range of T&s into a range of T*s, but that *can* be separated into
another patch, and it isn't yet 100% clear whether this is the right
move.

However, this change gets us most of the benefit and cleans up
a substantial amount of code around Use and User. =]

llvm-svn: 203364

show more ...


# 4b6845c7 04-Mar-2014 Chandler Carruth <chandlerc@gmail.com>

[Modules] Move the LeakDetector header into the IR library where the
source file had already been moved. Also move the unittest into the IR
unittest library.

This may seem an odd thing to put in the

[Modules] Move the LeakDetector header into the IR library where the
source file had already been moved. Also move the unittest into the IR
unittest library.

This may seem an odd thing to put in the IR library but we only really
use this with instructions and it needs the LLVM context to work, so it
is intrinsically tied to the IR library.

llvm-svn: 202842

show more ...


# 219b89b9 04-Mar-2014 Chandler Carruth <chandlerc@gmail.com>

[Modules] Move CallSite into the IR library where it belogs. It is
abstracting between a CallInst and an InvokeInst, both of which are IR
concepts.

llvm-svn: 202816


# 8394857f 04-Mar-2014 Chandler Carruth <chandlerc@gmail.com>

[Modules] Move InstIterator out of the Support library, where it had no
business.

This header includes Function and BasicBlock and directly uses the
interfaces of both classes. It has to do with the

[Modules] Move InstIterator out of the Support library, where it had no
business.

This header includes Function and BasicBlock and directly uses the
interfaces of both classes. It has to do with the IR, it even has that
in the name. =] Put it in the library it belongs to.

This is one step toward making LLVM's Support library survive a C++
modules bootstrap.

llvm-svn: 202814

show more ...


1...<<1112131415