|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| ... |  | 
| | 
| 
| 
| 
| 
| 
| 
| | after checking for a GEP, so that it matches what GetUnderlyingObject
does. This fixes an obscure bug turned up by bugpoint in the testcase
for PR9931.
llvm-svn: 131971 | 
| | 
| 
| 
| 
| 
| 
| 
| | miscompilation of
UnitTests/ObjC/messages-2.m with the recent optimizer improvements.
llvm-svn: 131897 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | aligned.
Teach memcpyopt to not give up all hope when confonted with an underaligned
memcpy feeding an overaligned byval.  If the *source* of the memcpy can be
determined to be adequeately aligned, or if it can be forced to be, we can
eliminate the memcpy.
This addresses PR9794.  We now compile the example into:
define i32 @f(%struct.p* nocapture byval align 8 %q) nounwind ssp {
entry:
  %call = call i32 @g(%struct.p* byval align 8 %q) nounwind
  ret i32 %call
}
in both x86-64 and x86-32 mode.  We still don't get a tailcall though,
because tailcalls apparently can't handle byval.
llvm-svn: 131884 | 
| | 
| 
| 
| 
| 
| | C99 runtimes don't have exp2).
llvm-svn: 131872 | 
| | 
| 
| 
| | llvm-svn: 131861 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | Original log message:
When BasicAA can determine that two pointers have the same base but
differ by a dynamic offset, return PartialAlias instead of MayAlias.
See the comment in the code for details. This fixes PR9971.
llvm-svn: 131809 | 
| | 
| 
| 
| 
| 
| 
| | differ by a dynamic offset, return PartialAlias instead of MayAlias.
See the comment in the code for details. This fixes PR9971.
llvm-svn: 131781 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | No functionality enabled by default. Use -disable-iv-rewrite.
Extended IVUsers to keep track of the phi that represents the users' IV.
Added the WidenIV transform to replace a narrow IV with a wide IV
by doing a one-for-one replacement of IV users instead of expanding the
SCEV expressions. [sz]exts are removed and truncs are inserted.
llvm-svn: 131744 | 
| | 
| 
| 
| | llvm-svn: 131437 | 
| | 
| 
| 
| | llvm-svn: 131405 | 
| | 
| 
| 
| 
| 
| 
| 
| | set.
rdar://9423996
llvm-svn: 131283 | 
| | 
| 
| 
| | llvm-svn: 131088 | 
| | 
| 
| 
| 
| 
| 
| | often expressed as "x >= y ? x : y", there is a good chance we can extract
the existing "x >= y" from it and use that as a replacement for "max(x,y)==x".
llvm-svn: 131049 | 
| | 
| 
| 
| 
| 
| | side of the icmp is an exact shift.
llvm-svn: 130954 | 
| | 
| 
| 
| | llvm-svn: 130920 | 
| | 
| 
| 
| 
| 
| 
| 
| | but according to my super-optimizer there are only two missed simplifications
of -instsimplify kind when compiling bzip2, and this is one of them.  It amuses
me to have bzip2 be perfectly optimized as far as instsimplify goes!
llvm-svn: 130840 | 
| | 
| 
| 
| 
| 
| 
| 
| | This adds functionality to remove size/zero extension during indvars
without generating a canonical IV and rewriting all IV users. It's
disabled by default so should have no effect on codegen. Work in progress.
llvm-svn: 130829 | 
| | 
| 
| 
| 
| 
| 
| 
| | max(a,b) >= a -> true.  According to my super-optimizer, these are
by far the most common simplifications (of the -instsimplify kind)
that occur in the testsuite and aren't caught by -std-compile-opts.
llvm-svn: 130780 | 
| | 
| 
| 
| | llvm-svn: 130756 | 
| | 
| 
| 
| 
| 
| | a vector compare, generate a vector result rather than i1 (and crashing).
llvm-svn: 130706 | 
| | 
| 
| 
| 
| 
| 
| | This automagically provides a transform noticed by my super-optimizer
as occurring quite often: "rem x, (select cond, x, 1)" -> 0.
llvm-svn: 130694 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | wider load would allow elimination of subsequent loads, and when the wider
load is still a native integer type.  This eliminates a ton of loads on 
various benchmarks involving struct fields, though it is somewhat hobbled
by clang not being very aggressive about field alignment.
This is yet another step along the way towards resolving PR6627.
llvm-svn: 130390 | 
| | 
| 
| 
| | llvm-svn: 130327 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | only check arguments with pointer types. Update the documentation
of IntrReadArgMem reflect this.
While here, add support for TBAA tags on intrinsic calls.
llvm-svn: 130317 | 
| | 
| 
| 
| | llvm-svn: 130316 | 
| | 
| 
| 
| | llvm-svn: 130294 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | incompatible type!"' failed.
Added a type check in ScalarEvolution::computeSCEVAtScope to handle the case in which operands of an
AddRecExpr in the current scope are folded.
llvm-svn: 130271 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | an earlier load could be widened to encompass a later load.  For example,
if we see:
  X = load i8* P, align 4
  Y = load i8* (P+3), align 1
and we have a 32-bit native integer type, we can widen the former load
to i32 which then makes the second load redundant.  GVN can't actually
do anything with this load/load relation yet, so this isn't testable, but 
it is the next step to resolving PR6627, and a fairly general class of 
"merge neighboring loads" missed optimizations.
llvm-svn: 130250 | 
| | 
| 
| 
| | llvm-svn: 130248 | 
| | 
| 
| 
| 
| 
| | work-in-progress that is not progressing, and it has issues.
llvm-svn: 130247 | 
| | 
| 
| 
| 
| 
| | This worked untill now because stars are aligned (i.e. num of complex address elments are always 0 or 2+ and when it is 2+ at least two elements are access together)
llvm-svn: 130225 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | return it as a clobber.  This allows GVN to do smart things.
Enhance GVN to be smart about the case when a small load is clobbered
by a larger overlapping load.  In this case, forward the value.  This
allows us to compile stuff like this:
int test(void *P) {
  int tmp = *(unsigned int*)P;
  return tmp+*((unsigned char*)P+1);
}
into:
_test:                                  ## @test
	movl	(%rdi), %ecx
	movzbl	%ch, %eax
	addl	%ecx, %eax
	ret
which has one load.  We already handled the case where the smaller
load was from a must-aliased base pointer.
llvm-svn: 130180 | 
| | 
| 
| 
| | llvm-svn: 130166 | 
| | 
| 
| 
| | llvm-svn: 130086 | 
| | 
| 
| 
| | llvm-svn: 130068 | 
| | 
| 
| 
| | llvm-svn: 130028 | 
| | 
| 
| 
| | llvm-svn: 129932 | 
| | 
| 
| 
| | llvm-svn: 129735 | 
| | 
| 
| 
| 
| 
| | silences Clang's -Wunused-function when building in release mode.
llvm-svn: 129709 | 
| | 
| 
| 
| 
| 
| | information generated for an interface.
llvm-svn: 129624 | 
| | 
| 
| 
| 
| 
| | Luis Felipe Strano Moraes!
llvm-svn: 129558 | 
| | 
| 
| 
| 
| 
| | related tweaks to ExprMapKeyType.
llvm-svn: 129443 | 
| | 
| 
| 
| | llvm-svn: 129271 | 
| | 
| 
| 
| 
| 
| 
| | it's completely safe to cache the AST across LICM runs even with this fix,
but this fix can't hurt.
llvm-svn: 129198 | 
| | 
| 
| 
| | llvm-svn: 128947 | 
| | 
| 
| 
| 
| 
| | still used by RegionInfo :(
llvm-svn: 128943 | 
| | 
| 
| 
| 
| 
| | Contributed by: etherzhhb@gmail.com
llvm-svn: 128808 | 
| | 
| 
| 
| 
| 
| 
| | Based on PR9429, but no testcase because I can't figure out how to trigger it
anymore given other changes to the relevant code.
llvm-svn: 128781 | 
| | 
| 
| 
| 
| 
| | PHINode::Create() giving the (known or expected) number of operands.
llvm-svn: 128537 | 
| | 
| 
| 
| | llvm-svn: 128535 |