| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 159546
|
| |
|
|
|
|
|
|
|
|
|
| |
Original commit message:
If a constant or a function has linkonce_odr linkage and unnamed_addr, mark it
hidden. Being linkonce_odr guarantees that it is available in every dso that
needs it. Being a constant/function with unnamed_addr guarantees that the
copies don't have to be merged.
llvm-svn: 159272
|
| |
|
|
|
|
|
|
| |
hidden. Being linkonce_odr guarantees that it is available in every dso that
needs it. Being a constant/function with unnamed_addr guarantees that the
copies don't have to be merged.
llvm-svn: 159136
|
| |
|
|
| |
llvm-svn: 159104
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows the user/front-end to specify a model that is better
than what LLVM would choose by default. For example, a variable
might be declared as
@x = thread_local(initialexec) global i32 42
if it will not be used in a shared library that is dlopen'ed.
If the specified model isn't supported by the target, or if LLVM can
make a better choice, a different model may be used.
llvm-svn: 159077
|
| |
|
|
|
|
| |
sorry for the churn :S enough for today; going to sleep.
llvm-svn: 158953
|
| |
|
|
|
|
| |
user. Update GlobalOpt accordingly.
llvm-svn: 158952
|
| |
|
|
|
|
|
|
| |
linkonce linkage. For example, it is not valid to add unnamed_addr.
This also fixes a crash in g++.dg/opt/static5.C.
llvm-svn: 158528
|
| |
|
|
|
|
|
| |
globaldce. Globaldce was already removing linkonce globals, but globalopt was
not.
llvm-svn: 158476
|
| |
|
|
|
|
| |
the address of a function.
llvm-svn: 156703
|
| |
|
|
|
|
| |
that we just determined to be constant, replace all loads from it with a zero value.
llvm-svn: 153576
|
| |
|
|
| |
llvm-svn: 152634
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html
Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*".
ConstCaseIt is just a read-only iterator.
CaseIt is read-write iterator; it allows to change case successor and case value.
Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters.
Main way of iterator usage looks like this:
SwitchInst *SI = ... // intialize it somehow
for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) {
BasicBlock *BB = i.getCaseSuccessor();
ConstantInt *V = i.getCaseValue();
// Do something.
}
If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method.
If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method.
There are also related changes in llvm-clients: klee and clang.
llvm-svn: 152297
|
| |
|
|
|
|
| |
Found by valgrind.
llvm-svn: 151525
|
| |
|
|
|
|
| |
returns 'true' and emits a warning. Help it out.
llvm-svn: 151242
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
they'll be simple enough to simulate, and to reduce the chance we'll encounter
equal but different simple pointer constants.
This removes the symptoms from PR11352 but is not a full fix. A proper fix would
either require a guarantee that two constant objects we simulate are folded
when equal, or a different way of handling equal pointers (ie., trying a
constantexpr icmp on them to see whether we know they're equal or non-equal or
unsure).
llvm-svn: 151093
|
| |
|
|
| |
llvm-svn: 151003
|
| |
|
|
| |
llvm-svn: 150947
|
| |
|
|
|
|
| |
the information that they pass around between them. No functionality change!
llvm-svn: 150939
|
| |
|
|
|
|
|
|
|
| |
useful to represent a variable that is const in the source but can't be constant
in the IR because of a non-trivial constructor. If globalopt evaluates the
constructor, and there was an invariant.start with no matching invariant.end
possible, it will mark the global constant afterwards.
llvm-svn: 150794
|
| |
|
|
|
|
| |
that no optz'ns have run yet to convert invokes to calls.
llvm-svn: 150326
|
| |
|
|
| |
llvm-svn: 150324
|
| |
|
|
|
|
| |
to TargetLibraryInfo and use one of them in GlobalOpt.
llvm-svn: 150323
|
| |
|
|
|
|
| |
few fixme's when TLI was added.
llvm-svn: 150322
|
| |
|
|
|
|
| |
doxy-style on local variables to not do so. Fix one 80-col violation.
llvm-svn: 150320
|
| |
|
|
| |
llvm-svn: 150319
|
| |
|
|
| |
llvm-svn: 150183
|
| |
|
|
|
|
|
|
|
| |
GlobalOpt runs early in the pipeline (before inlining) and complex class
hierarchies often introduce bitcasts or GEPs which weren't optimized away.
Teach it to ignore side-effect free instructions instead of depending on
other passes to remove them.
llvm-svn: 150174
|
| |
|
|
|
|
| |
change.
llvm-svn: 149861
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Most of the transforms come through intact by having each transformed load or
store copy the ordering and synchronization scope of the original.
* The transform that turns a global only accessed in main() into an alloca
(since main is non-recursive) with a store of the initial value uses an
unordered store, since it's guaranteed to be the first thing to happen in main.
(Threads may have started before main (!) but they can't have the address of a
function local before the point in the entry block we insert our code.)
* The heap-SRoA transforms are disabled in the face of atomic operations. This
can probably be improved; it seems odd to have atomic accesses to an alloca
that doesn't have its address taken.
AnalyzeGlobal keeps track of the strongest ordering found in any use of the
global. This is more information than we need right now, but it's cheap to
compute and likely to be useful.
llvm-svn: 149847
|
| |
|
|
| |
llvm-svn: 149845
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want.
What was done:
1. Changed semantics of index inside the getCaseValue method:
getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous.
2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned.
3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment.
4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst.
4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor.
4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor.
Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang.
llvm-svn: 149481
|
| |
|
|
|
|
|
| |
we should (theoretically optimize and codegen ConstantDataVector as well
as ConstantVector.
llvm-svn: 149116
|
| |
|
|
|
|
| |
new methods recently added to (sometimes greatly!) simplify code.
llvm-svn: 149024
|
| |
|
|
| |
llvm-svn: 148934
|
| |
|
|
| |
llvm-svn: 148578
|
| |
|
|
|
|
| |
global initializers if there's an implied extension or truncation.
llvm-svn: 147625
|
| |
|
|
|
|
| |
Add FIXMEs to places that are non-trivial to fix.
llvm-svn: 145661
|
| |
|
|
|
|
|
| |
where it appeared beneficial to pass.
More of rdar://10500969
llvm-svn: 145630
|
| |
|
|
|
|
| |
definition is unused, and enhance it so it can tell that functions which are only used by a blockaddress are in fact dead. This probably doesn't happen much on most code, but the Linux kernel's _THIS_IP_ can trigger this issue with blockaddress. (GlobalDCE can also handle the given tescase, but we only run that at -O3.) Found while looking at PR11180.
llvm-svn: 142572
|
| |
|
|
|
|
|
|
| |
to be uniqued, without any benefit.
If someone prefers %tmp42 to %42, run instnamer.
llvm-svn: 140634
|
| |
|
|
| |
llvm-svn: 137693
|
| |
|
|
| |
llvm-svn: 137667
|
| |
|
|
|
|
|
|
|
| |
This adds the 'resume' instruction class, IR parsing, and bitcode reading and
writing. The 'resume' instruction resumes propagation of an existing (in-flight)
exception whose unwinding was interrupted with a 'landingpad' instruction (to be
added later).
llvm-svn: 136589
|
| |
|
|
|
|
|
| |
r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444,
r136445, r136446, r136253 pending review.
llvm-svn: 136556
|
| |
|
|
|
|
| |
This adds the new instructions 'landingpad' and 'resume'.
llvm-svn: 136253
|
| |
|
|
| |
llvm-svn: 135904
|
| |
|
|
|
|
| |
ConstantExpr::getGetElementPtr to use ArrayRef.
llvm-svn: 135762
|
| |
|
|
| |
llvm-svn: 135676
|
| |
|
|
|
|
| |
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.
llvm-svn: 135673
|