| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
when merging two TBAA tags, pointed out by Nuno.
llvm-svn: 171627
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.
There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.
The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.
I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).
I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.
llvm-svn: 171366
|
| |
|
|
|
|
| |
Also add an assert to avoid confusion in the code where is known that C1 <= C2.
llvm-svn: 171310
|
| |
|
|
|
|
| |
PR14753
llvm-svn: 171279
|
| |
|
|
| |
llvm-svn: 171272
|
| |
|
|
|
|
| |
the getAttrSomewhere predicate. This prevents the uses of 'Attribute' as a collection of attributes.
llvm-svn: 171271
|
| |
|
|
|
|
|
| |
if C1 and C2 differ only with one bit.
Fixes PR14708.
llvm-svn: 171270
|
| |
|
|
|
|
|
|
|
| |
GEP::accumulateConstantOffset().
The later API is nicer than the former, and is correct regarding wrap-around offsets (if anyone cares).
There are a few more places left with duplicated code, which I'll remove soon.
llvm-svn: 171259
|
| |
|
|
|
|
|
| |
such as by a compiler warning, a check in clang -fsanitizer=undefined, being
optimized to unreachable, or a combination of the above. PR14722.
llvm-svn: 171119
|
| |
|
|
|
|
|
|
|
| |
When the backend is used from clang, it should produce proper diagnostics
instead of just printing messages to errs(). Other clients may also want to
register their own error handlers with the LLVMContext, and the same handler
should work for warnings in the same way as the existing emitError methods.
llvm-svn: 171041
|
| |
|
|
| |
llvm-svn: 170990
|
| |
|
|
|
|
| |
functional change.
llvm-svn: 170676
|
| |
|
|
| |
llvm-svn: 170675
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When the least bit of C is greater than V, (x&C) must be greater than V
if it is not zero, so the comparison can be simplified.
Although this was suggested in Target/X86/README.txt, it benefits any
architecture with a directly testable form of AND.
Patch by Kevin Schoedel
llvm-svn: 170576
|
| |
|
|
|
|
| |
some minor comment reformatting.
llvm-svn: 170516
|
| |
|
|
|
|
| |
single attribute in the future.
llvm-svn: 170502
|
| |
|
|
|
|
| |
alignment.
llvm-svn: 170486
|
| |
|
|
|
|
| |
InstCombine for unsafe floating-point add/sub.
llvm-svn: 170471
|
| |
|
|
|
|
| |
catch these errors and to test the presence of the optimization itself
llvm-svn: 170248
|
| |
|
|
|
|
| |
Implement rule : "x * (select cond 1.0, 0.0) -> select cond x, 0.0"
llvm-svn: 170226
|
| |
|
|
|
|
|
|
|
| |
This assumes (1 << n) is always not zero. Consider n is greater than word size.
Although I know it is undefined, this transforms undefined behavior hidden.
This led clang unexpected behavior with some failures. I will investigate to fix undefined shl in clang.
llvm-svn: 170128
|
| |
|
|
|
|
|
|
| |
it seems to be breaking self-host for a few people and is PR14592.
This reverts commit r170024.
llvm-svn: 170106
|
| |
|
|
| |
llvm-svn: 170094
|
| |
|
|
|
|
|
|
| |
In a previous thread it was pointed out that isPowerOfTwo is not a very precise
name since it can return false for powers of two if it is unable to show that
they are powers of two.
llvm-svn: 170093
|
| |
|
|
|
|
| |
Provides m_Argument that allows matching against a CallSite's specified argument. Provides m_Intrinsic pattern that can be templatized over the intrinsic id and bind/match arguments similarly to other pattern matchers. Implementations provided for 0 to 4 arguments, though it's very simple to extend for more. Also provides example template specialization for bswap (m_BSwap) and example of code cleanup for its use.
llvm-svn: 170091
|
| |
|
|
| |
llvm-svn: 170050
|
| |
|
|
| |
llvm-svn: 170024
|
| |
|
|
| |
llvm-svn: 170022
|
| |
|
|
| |
llvm-svn: 170020
|
| |
|
|
|
|
|
|
|
|
| |
been used in the first place. It simply was passed to the function and to the
recursive invocations. Simply drop the parameter and update the callers for the
new signature.
Patch by Saleem Abdulrasool!
llvm-svn: 169988
|
| |
|
|
|
|
| |
- Propagate "exact" bit of [l|a]shr instruction.
llvm-svn: 169942
|
| |
|
|
|
|
| |
functions from SimplifyInstruction
llvm-svn: 169941
|
| |
|
|
|
|
| |
No functionality change.
llvm-svn: 169703
|
| |
|
|
| |
llvm-svn: 169701
|
| |
|
|
|
|
| |
in the near future.
llvm-svn: 169651
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change attempts to simplify (X^Y) -> X or Y in the user's context if we know that
only bits from X or Y are demanded.
A minimized case is provided bellow. This change will simplify "t>>16" into "var1 >>16".
=============================================================
unsigned foo (unsigned val1, unsigned val2) {
unsigned t = val1 ^ 1234;
return (t >> 16) | t; // NOTE: t is used more than once.
}
=============================================================
Note that if the "t" were used only once, the expression would be finally optimized as well.
However, with with this change, the optimization will take place earlier.
Reviewed by Nadav, Thanks a lot!
llvm-svn: 169317
|
| |
|
|
|
|
|
|
|
|
| |
missed in the first pass because the script didn't yet handle include
guards.
Note that the script is now able to handle all of these headers without
manual edits. =]
llvm-svn: 169224
|
| |
|
|
|
|
|
| |
The type of shirt-right (logical or arithemetic) should remain unchanged
when transforming "X << C1 >> C2" into "X << (C1-C2)"
llvm-svn: 169209
|
| |
|
|
|
|
|
|
|
|
|
| |
This change tries to simmplify E1 = " X >> C1 << C2" into :
- E2 = "X << (C2 - C1)" if C2 > C1, or
- E2 = "X >> (C1 - C2)" if C1 > C2, or
- E2 = X if C1 == C2.
Reviewed by Nadav. Thanks!
llvm-svn: 169182
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.
Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]
llvm-svn: 169131
|
| |
|
|
|
|
| |
nested ifs
llvm-svn: 169049
|
| |
|
|
| |
llvm-svn: 169043
|
| |
|
|
|
|
| |
reviewed by Michael Ilseman <milseman@apple.com>
llvm-svn: 169025
|
| |
|
|
|
|
|
|
|
| |
The simplify-libcalls pass maintained a statistic to count the number
of library calls that have been simplified. Now that library call
simplification is being carried out in instcombine the statistic should
be moved to there.
llvm-svn: 168975
|
| |
|
|
|
|
|
|
|
|
|
|
| |
depends on the IR infrastructure, there is no sense in it being off in
Support land.
This is in preparation to start working to expand InstVisitor into more
special-purpose visitors that are still generic and can be re-used
across different passes. The expansion will go into the Analylis tree
though as nothing in VMCore needs it.
llvm-svn: 168972
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
My commit to migrate the printf simplifiers from the simplify-libcalls
in r168604 introduced a regression reported by Duncan [1]. The problem
is that in some cases the library call simplifier can return a new value
that has no uses and the new value's type is different than the old value's
type (which is fine because there are no uses). The specific case that
triggered the bug looked something like:
declare void @printf(i8*, ...)
...
call void (i8*, ...)* @printf(i8* %fmt)
Which we want to optimized into:
call i32 @putchar(i32 104)
However, the code was attempting to replace all uses of the printf with
the putchar and the types differ, hence a crash. This is fixed by *just*
deleting the original instruction when there are no uses. The old
simplify-libcalls pass is already doing something similar.
[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-November/056338.html
llvm-svn: 168716
|
| |
|
|
|
|
|
|
| |
InstCombineLoadStoreAlloca.cpp, which had many issues.
(At least two bugs were noted on llvm-commits, and it was overly conservative.)
Instead, use getOrEnforceKnownAlignment.
llvm-svn: 168629
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enhancement to InstCombine. Try to catch this opportunity:
---------------------------------------------------------------
((X^C1) >> C2) ^ C3 => (X>>C2) ^ ((C1>>C2)^C3)
where the subexpression "X ^ C1" has more than one uses, and
"(X^C1) >> C2" has single use.
----------------------------------------------------------------
Reviewed by Nadav (with minor change per his request).
llvm-svn: 168615
|
| |
|
|
|
|
|
|
|
| |
When code deletes the context, the AttributeImpls that the AttrListPtr points to
are now invalid. Therefore, instead of keeping a separate managed static for the
AttrListPtrs that's reference counted, move it into the LLVMContext and delete
it when deleting the AttributeImpls.
llvm-svn: 168354
|
| |
|
|
| |
llvm-svn: 168280
|