| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
is free. The whole CodeMetrics API should probably be reworked more, but
this is enough to allow deleting the duplicate code there for computing
whether an instruction is free.
All of the passes using this have been updated to pull in TTI and hand
it to the CodeMetrics stuff. Further, a dead CodeMetrics API
(analyzeFunction) is nuked for lack of users.
llvm-svn: 173036
|
| |
|
|
| |
llvm-svn: 172864
|
| |
|
|
| |
llvm-svn: 172863
|
| |
|
|
|
|
|
| |
Further encapsulation of the Attribute object. Don't allow direct access to the
Attribute object as an aggregate.
llvm-svn: 172853
|
| |
|
|
| |
llvm-svn: 172839
|
| |
|
|
| |
llvm-svn: 172782
|
| |
|
|
| |
llvm-svn: 172736
|
| |
|
|
|
|
| |
``Visited'' Debug message to use it.
llvm-svn: 172735
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
-fno-objc-arc-exception is enabled due to it's affect on correctness.
Specifically according to the semantics of ARC -fno-objc-arc-exception simply
states that it is expected that the unwind path out of a call *MAY* not release
objects. Thus we can have the situation where a release gets moved into a catch
block which we ignore when we remove a retain/release pair resulting in (even
though we assume the program is exiting anyways) the cleanup code path
potentially blowing up before program exit.
llvm-svn: 172599
|
| |
|
|
| |
llvm-svn: 172452
|
| |
|
|
| |
llvm-svn: 172374
|
| |
|
|
|
|
| |
use doxygen). Still some work to do though.
llvm-svn: 172371
|
| |
|
|
|
|
|
|
| |
2x blocks each assigned a value via a phi-node causing each to depend on the other.
A test case is provided as well.
llvm-svn: 172368
|
| |
|
|
| |
llvm-svn: 172347
|
| |
|
|
| |
llvm-svn: 172346
|
| |
|
|
|
|
|
|
| |
case, but looking at the diff this was an obviously unintended change.
Thanks for the careful review Bill! =]
llvm-svn: 172336
|
| |
|
|
| |
llvm-svn: 172299
|
| |
|
|
| |
llvm-svn: 172298
|
| |
|
|
|
|
| |
=> objc_autorelease but were not updating the InstructionClass to IC_Autorelease.
llvm-svn: 172288
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
not be placed into an autorelease pool.
The reason that this occurs is that tail calling objc_autorelease eventually
tail calls -[NSObject autorelease] which supports fast autorelease. This can
cause us to violate the semantic gaurantees of __autoreleasing variables that
assignment to an __autoreleasing variables always yields an object that is
placed into the innermost autorelease pool.
The fix included in this patch works by:
1. In the peephole optimization function OptimizeIndividualFunctions, always
remove tail call from objc_autorelease.
2. Whenever we convert to/from an objc_autorelease, set/unset the tail call
keyword as appropriate.
*NOTE* I also handled the case where objc_autorelease is converted in
OptimizeReturns to an autoreleaseRV which still violates the ARC semantics. I
will be removing that in a later patch and I wanted to make sure that the tree
is in a consistent state vis-a-vis ARC always.
Additionally some test cases are provided and all tests that have tail call marked
objc_autorelease keywords have been modified so that tail call has been removed.
*NOTE* One test fails due to a separate bug that I am going to commit soon. Thus
I marked the check line TMP: instead of CHECK: so make check does not fail.
llvm-svn: 172287
|
| |
|
|
|
|
|
|
| |
The root cause is mistakenly taking for granted that
"dyn_cast<Instruction>(a-Value)"
return a non-NULL instruction.
llvm-svn: 172145
|
| |
|
|
|
|
| |
into an autoreleaseRV.
llvm-svn: 172034
|
| |
|
|
|
|
|
|
|
|
| |
commits ala echristo's suggestion.
1. Added debug messages when in OptimizeIndividualCalls we move calls into predecessors and then erase the original call.
2. Added debug messages when in the process of moving calls in ObjCARCOpt::MoveCalls we create new RR and delete old RR.
3. Added a debug message when we visit a specific retain instruction in ObjCARCOpt::PerformCodePlacement.
llvm-svn: 171988
|
| |
|
|
|
|
| |
Fixes PR14854.
llvm-svn: 171984
|
| |
|
|
| |
llvm-svn: 171791
|
| |
|
|
|
|
|
|
|
| |
peculiar headers under include/llvm.
This struct still doesn't make a lot of sense, but it makes more sense
down in TargetLowering than it did before.
llvm-svn: 171739
|
| |
|
|
|
|
|
|
|
|
|
|
| |
already in a class, just inline the four of them. I suspect that this
class could be simplified some to not always keep distinct variables for
these things, but it wasn't clear to me how given the usage so I opted
for a trivial and mechanical translation.
This removes one of the two remaining users of a header in include/llvm
which does nothing more than define a 4 member struct.
llvm-svn: 171738
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TargetTransformInfo rather than TargetLowering, removing one of the
primary instances of the layering violation of Transforms depending
directly on Target.
This is a really big deal because LSR used to be a "special" pass that
could only be tested fully using llc and by looking at the full output
of it. It also couldn't run with any other loop passes because it had to
be created by the backend. No longer is this true. LSR is now just
a normal pass and we should probably lift the creation of LSR out of
lib/CodeGen/Passes.cpp and into the PassManagerBuilder. =] I've not done
this, or updated all of the tests to use opt and a triple, because
I suspect someone more familiar with LSR would do a better job. This
change should be essentially without functional impact for normal
compilations, and only change behvaior of targetless compilations.
The conversion required changing all of the LSR code to refer to the TTI
interfaces, which fortunately are very similar to TargetLowering's
interfaces. However, it also allowed us to *always* expect to have some
implementation around. I've pushed that simplification through the pass,
and leveraged it to simplify code somewhat. It required some test
updates for one of two things: either we used to skip some checks
altogether but now we get the default "no" answer for them, or we used
to have no information about the target and now we do have some.
I've also started the process of removing AddrMode, as the TTI interface
doesn't use it any longer. In some cases this simplifies code, and in
others it adds some complexity, but I think it's not a bad tradeoff even
there. Subsequent patches will try to clean this up even further and use
other (more appropriate) abstractions.
Yet again, almost all of the formatting changes brought to you by
clang-format. =]
llvm-svn: 171735
|
| |
|
|
|
|
| |
the global variables. We partition the set of globals by their address space, and apply the same the trasnformation as before to merge them.
llvm-svn: 171730
|
| |
|
|
|
|
|
|
| |
I'm sorry for duplicating bad style here, but I wanted to keep
consistency. I've pinged the code review thread where this style was
reviewed and changes were requested.
llvm-svn: 171714
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
through as a reference rather than a pointer. There is always *some*
implementation of this available, so this simplifies code by not having
to test for whether it is available or not.
Further, it turns out there were piles of places where SimplifyCFG was
recursing and not passing down either TD or TTI. These are fixed to be
more pedantically consistent even though I don't have any particular
cases where it would matter.
llvm-svn: 171691
|
| |
|
|
|
|
|
| |
follow the conding conventions regarding enumerating a set of "kinds" of
things.
llvm-svn: 171687
|
| |
|
|
|
|
|
| |
longer would violate any dependency layering and it is in fact an
analysis. =]
llvm-svn: 171686
|
| |
|
|
|
|
| |
pair in ObjCARCContract::ContractAutorelease.
llvm-svn: 171679
|
| |
|
|
|
|
| |
retain/autorelease pair in ObjCARCOpt::OptimizeReturns.
llvm-svn: 171678
|
| |
|
|
|
|
| |
null since they are no-ops.
llvm-svn: 171677
|
| |
|
|
|
|
| |
to a function which can not throw.
llvm-svn: 171676
|
| |
|
|
|
|
| |
a function which can never be passed stack args.
llvm-svn: 171675
|
| |
|
|
| |
llvm-svn: 171674
|
| |
|
|
|
|
| |
objc_release(x) when x is otherwise unused.
llvm-svn: 171673
|
| |
|
|
|
|
|
|
| |
undefined pointer-to-weak-pointer is NULL cases by replacing the given call inst with an undefined value.
The reason that there are two cases is that the first case handles the unary cases and the second the binary cases.
llvm-svn: 171672
|
| |
|
|
|
|
| |
special semantic meaning in the frontend and thus in the optimizer can be deleted.
llvm-svn: 171670
|
| |
|
|
|
|
| |
objc_autoreleaseReturnValue => objc_autorelease due to its operand not being used as a return value.
llvm-svn: 171669
|
| |
|
|
|
|
|
| |
Indirect branch in the preheader crashes replaceCongruentIVs.
Fixes rdar://12910141.
llvm-svn: 171653
|
| |
|
|
|
|
| |
objc_retainAutorelasedReturnValue => objc_retain since the operand to said function is not a return value.
llvm-svn: 171629
|
| |
|
|
|
|
| |
objc_autoreleaseReturnValue/objc_retainAutoreleasedValue pair.
llvm-svn: 171628
|
| |
|
|
|
|
| |
when merging two TBAA tags, pointed out by Nuno.
llvm-svn: 171627
|
| |
|
|
|
|
| |
interface rather than the ScalarTargetTransformInterface.
llvm-svn: 171616
|
| |
|
|
|
|
|
|
|
|
|
|
| |
next to its only user. This helper relies on TargetLowering information
that shouldn't be generally used throughout the Transfoms library, and
so it made little sense as a generic utility.
This also consolidates the file where we need to remove the remaining
uses of TargetLowering in favor of the IR-layer abstract interface in
TargetTransformInfo.
llvm-svn: 171590
|
| |
|
|
|
|
| |
objc_retainAutorelasedReturnValue.
llvm-svn: 171535
|