| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 157527
|
|
|
|
|
|
|
| |
This is obviosly right but I don't see how to do this with proper vector
iterators without building a horrible mess of workarounds.
llvm-svn: 157526
|
|
|
|
|
|
| |
vector.begin()-1 is invalid too.
llvm-svn: 157525
|
|
|
|
|
|
|
|
| |
case.
Found by libstdc++'s debug mode.
llvm-svn: 157522
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
them by using edge weights.
SimplifyCFG tends to form a lot of 2-3 case switches when merging branches. Move
the most likely condition to the front so it is checked first and the others can
be skipped. This is currently not as effective as it could be because SimplifyCFG
destroys profiling metadata when merging branches and switches. Merging branch
weight metadata is tricky though.
This code touches at most 3 cases so I didn't use a proper sorting algorithm.
llvm-svn: 157521
|
|
|
|
|
|
|
|
|
|
| |
to pass around a struct instead of a large set of individual values. This
cleans up the interface and allows more information to be added to the struct
for future targets without requiring changes to each and every target.
NV_CONTRIB
llvm-svn: 157479
|
|
|
|
|
|
| |
small bug in the process.
llvm-svn: 157446
|
|
|
|
|
|
| |
SelectionDAGBuilder::Clusterify : main functinality was replaced with CRSBuilder::optimize, so big part of Clusterify's code was reduced.
llvm-svn: 157046
|
|
|
|
|
|
| |
representation of Low and High from signed to unsigned. Since unsigned ints usually simpler, faster and allows to reduce some extra signed bit checks needed before <,>,<=,>= comparisons.
llvm-svn: 156985
|
|
|
|
| |
llvm-svn: 156808
|
|
|
|
|
|
| |
CRSBuilder::optimize, so big part of Clusterify's code was reduced.
llvm-svn: 156804
|
|
|
|
| |
llvm-svn: 156774
|
|
|
|
|
|
| |
but it generates int3 on x86 instead of ud2.
llvm-svn: 156593
|
|
|
|
|
|
| |
PR10799
llvm-svn: 155954
|
|
|
|
| |
llvm-svn: 154479
|
|
|
|
|
|
| |
intrinsic to an nodetype.
llvm-svn: 154478
|
|
|
|
|
|
| |
compiled code size a bit.
llvm-svn: 154473
|
|
|
|
| |
llvm-svn: 154299
|
|
|
|
|
|
| |
width and the input vector widths don't match. No need to check the min and max are in range before calculating the start index. The range check after having the start index is sufficient. Also no need to check for an extract from the beginning differently.
llvm-svn: 154295
|
|
|
|
|
|
| |
remove patterns for selecting the intrinsic. Similar was already done for avx1.
llvm-svn: 154272
|
|
|
|
| |
llvm-svn: 154267
|
|
|
|
|
|
|
|
| |
This is the CodeGen equivalent of r153747. I tested that there is not noticeable
performance difference with any combination of -O0/-O2 /-g when compiling
gcc as a single compilation unit.
llvm-svn: 153817
|
|
|
|
| |
llvm-svn: 153571
|
|
|
|
| |
llvm-svn: 153428
|
|
|
|
|
|
| |
rdar://11096639
llvm-svn: 153269
|
|
|
|
| |
llvm-svn: 152843
|
|
|
|
|
|
|
| |
Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default.
Added some notes relative to case iterators.
llvm-svn: 152532
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
Patch by Sean Silva!
llvm-svn: 152042
|
|
|
|
|
|
|
|
| |
though they could have sideeffects.
Only allow log2/exp2 to be converted to an intrinsic if they are declared "readnone".
llvm-svn: 151807
|
|
|
|
|
|
| |
direct call.
llvm-svn: 151645
|
|
|
|
|
|
| |
prediction. ...", it is breaking the Clang build during the Compiler-RT part.
llvm-svn: 151630
|
|
|
|
| |
llvm-svn: 151627
|
|
|
|
|
|
|
|
|
|
|
| |
When the GEP index is a vector of pointers, the code that calculated the size
of the element started from the vector type, and not the contained pointer type.
As a result, instead of looking at the data element pointed by the vector, this
code used the size of the vector. This works for 32bit members (on 32bit
systems), but not for other types. Added code to peel the vector type and
added a test.
llvm-svn: 151626
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the processor keeps a return addresses stack (RAS) which stores the address
and the instruction execution state of the instruction after a function-call
type branch instruction.
Calling a "noreturn" function with normal call instructions (e.g. bl) can
corrupt RAS and causes 100% return misprediction so LLVM should use a
unconditional branch instead. i.e.
mov lr, pc
b _foo
The "mov lr, pc" is issued in order to get proper backtrace.
rdar://8979299
llvm-svn: 151623
|
|
|
|
|
|
| |
surrounding it.
llvm-svn: 151364
|
|
|
|
|
|
| |
duplicate patterns for selecting the intrinsics
llvm-svn: 151342
|
|
|
|
|
|
|
|
|
|
|
| |
variable declaration as an argument because we want that address
anyhow for our debug information.
This seems to fix rdar://9965111, at least we have more debug
information than before and from reading the assembly it appears
to be the correct location.
llvm-svn: 151335
|
|
|
|
|
|
|
| |
asm.
<rdar://problem/10106006>
llvm-svn: 151303
|
|
|
|
| |
llvm-svn: 151235
|
|
|
|
| |
llvm-svn: 151234
|
|
|
|
|
|
| |
Patch by Joe Groff!
llvm-svn: 151183
|
|
|
|
|
|
| |
consistency with setExceptionPointerRegister(...).
llvm-svn: 150460
|
|
|
|
|
|
|
| |
marking them as "live-in" into a BB ruins some invariants that the back-end
tries to maintain.
llvm-svn: 150437
|
|
|
|
|
|
|
| |
were no 'unwind' instructions being generated before this, so this is in effect
a no-op.
llvm-svn: 149906
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 149331
|
|
|
|
|
|
|
| |
we should (theoretically optimize and codegen ConstantDataVector as well
as ConstantVector.
llvm-svn: 149116
|
|
|
|
|
|
|
| |
more robust) ways to do what it was doing now. Also, add static methods
for decoding a ShuffleVector mask.
llvm-svn: 149028
|
|
|
|
| |
llvm-svn: 148897
|