| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
enums. These are then created via the correct Attributes creation method.
llvm-svn: 165607
|
|
|
|
|
|
| |
attribute object and add it appropriately. No functionality change.
llvm-svn: 165595
|
|
|
|
| |
llvm-svn: 165402
|
|
|
|
|
|
|
|
| |
a pointer to a type, in order to remove the uses of getGlobalContext().
Patch by Tyler Nowicki.
llvm-svn: 165255
|
|
|
|
|
|
|
|
|
|
| |
dereference" optimization to also handle instructions with multiple uses.
We conservatively only check the first use to avoid walking long use chains.
This catches the common case of having both a load and a store to a pointer
supplied by a PHI node.
llvm-svn: 165232
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
instruction (for Intel Atom) was not being done by Clang, because
the type context used by Clang is not the default context.
It fixes the problem by getting the global context types for each div/rem
instruction in order to compare them against the types in the BypassTypeMap.
Tests for this will be done as a separate patch to Clang.
Patch by Tyler Nowicki.
llvm-svn: 165126
|
|
|
|
|
|
|
|
| |
value.
Fixes PR13985.
llvm-svn: 164934
|
|
|
|
|
|
|
|
| |
(switches), avoid it if possible.
No functionality change.
llvm-svn: 164923
|
|
|
|
|
|
|
|
| |
If the width is very large it gets truncated from uint64_t to uint32_t when
passed to TD->fitsInLegalInteger. The truncated value can fit in a register.
This manifested in massive memory usage or crashes (PR13946).
llvm-svn: 164784
|
|
|
|
|
|
| |
See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767
llvm-svn: 164768
|
|
|
|
| |
llvm-svn: 164767
|
|
|
|
|
|
|
|
| |
- Put statistics in alphabetical order
- Don't use getZextValue when building TableInt, just use APInts
- Introduce Create{Z,S}ExtOrTrunc in IRBuilder.
llvm-svn: 164696
|
|
|
|
|
|
|
| |
- Finish assert messages with exclamation mark
- Move overflow checking into ShouldBuildLookupTable.
llvm-svn: 164692
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
tables in bitmaps when they fit in a target-legal register.
This saves some space, and it also allows for building tables that would
otherwise be deemed too sparse.
One interesting case that this hits is example 7 from
http://blog.regehr.org/archives/320. We currently generate good code
for this when lowering the switch to the selection DAG: we build a
bitmask to decide whether to jump to one block or the other. My patch
will result in the same bitmask, but it removes the need for the jump,
as the return value can just be retrieved from the mask.
llvm-svn: 164684
|
|
|
|
|
|
| |
breaking out the building of lookup tables into a separate class.
llvm-svn: 164682
|
|
|
|
|
|
| |
the rest of the tree.
llvm-svn: 164666
|
|
|
|
|
|
|
|
| |
and u/srem.
Fixed issue with Release build.
llvm-svn: 164654
|
|
|
|
| |
llvm-svn: 164627
|
|
|
|
|
|
| |
and u/srem.
llvm-svn: 164614
|
|
|
|
|
|
|
|
|
|
|
|
| |
We already have HoistThenElseCodeToIf, this patch implements
SinkThenElseCodeToEnd. When END block has only two predecessors and each
predecessor terminates with unconditional branches, we compare instructions in
IF and ELSE blocks backwards and check whether we can sink the common
instructions down.
rdar://12191395
llvm-svn: 164325
|
|
|
|
| |
llvm-svn: 164238
|
|
|
|
| |
llvm-svn: 164235
|
|
|
|
| |
llvm-svn: 164232
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
two variables where the first variable is returned and the second
ignored.
I don't think this occurs in practice (other passes should have cleaned
up the unused phi node), but it should still be handled correctly.
Also make the logic for determining if we should return early less
sketchy.
llvm-svn: 164225
|
|
|
|
|
|
| |
without parens.
llvm-svn: 164216
|
|
|
|
|
|
| |
Implementation derived from compiler-rt's implementation of signed and unsigned integer division.
llvm-svn: 164173
|
|
|
|
|
|
| |
and a conditional branch; also when removing dead cases from a switch.
llvm-svn: 164084
|
|
|
|
|
|
|
| |
Hanlde the case when we split the default edge if the default target has "icmp"
and unconditinal branch.
llvm-svn: 164076
|
|
|
|
| |
llvm-svn: 164068
|
|
|
|
|
|
| |
destination in SimplifyCondBranchToCondBranch.
llvm-svn: 164054
|
|
|
|
|
|
| |
The cases where no initialization happens should still be checked for logic flaws.
llvm-svn: 164032
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
destination.
Updated previous implementation to fix a case not covered:
// PBI: br i1 %x, TrueDest, BB
// BI: br i1 %y, TrueDest, FalseDest
The other case was handled correctly.
// PBI: br i1 %x, BB, FalseDest
// BI: br i1 %y, TrueDest, FalseDest
Also tried to use 64-bit arithmetic instead of APInt with scale to simplify the
computation. Let me know if you have other opinions about this.
llvm-svn: 163954
|
|
|
|
|
|
| |
case to a conditional branch and when removing dead cases.
llvm-svn: 163942
|
|
|
|
| |
llvm-svn: 163940
|
|
|
|
|
|
| |
lit config.
llvm-svn: 163928
|
|
|
|
| |
llvm-svn: 163926
|
|
|
|
|
|
|
| |
the default target of the first switch is not the basic block the second switch
is in (PredDefault != BB).
llvm-svn: 163916
|
|
|
|
|
|
| |
to the default target.
llvm-svn: 163724
|
|
|
|
|
|
|
|
| |
"#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)"
No functional change. Update r163344.
llvm-svn: 163679
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a pair of switch/branch where both depend on the value of the same variable and
the default case of the first switch/branch goes to the second switch/branch.
Code clean up and fixed a few issues:
1> handling the case where some cases of the 2nd switch are invalidated
2> correctly calculate the weight for the 2nd switch when it is a conditional eq
Testing case is modified from Alastair's original patch.
llvm-svn: 163635
|
|
|
|
| |
llvm-svn: 163593
|
|
|
|
|
|
| |
after using bugpoint to reduce the confusion presented by the original names, which no longer mean what they used to.
llvm-svn: 163592
|
|
|
|
| |
llvm-svn: 163503
|
|
|
|
| |
llvm-svn: 163491
|
|
|
|
|
|
| |
Patch and test case by Alastair Murray!
llvm-svn: 163437
|
|
|
|
| |
llvm-svn: 163378
|
|
|
|
|
|
| |
No functional change.
llvm-svn: 163344
|
|
|
|
|
|
|
|
| |
The lookup tables did not get built in a deterministic order.
This makes them get built in the order that the corresponding phi nodes
were found.
llvm-svn: 163305
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a transformation to SimplifyCFG that attemps to turn switch
instructions into loads from lookup tables. It works on switches that
are only used to initialize one or more phi nodes in a common successor
basic block, for example:
int f(int x) {
switch (x) {
case 0: return 5;
case 1: return 4;
case 2: return -2;
case 5: return 7;
case 6: return 9;
default: return 42;
}
This speeds up the code by removing the hard-to-predict jump, and
reduces code size by removing the code for the jump targets.
llvm-svn: 163302
|
|
|
|
| |
llvm-svn: 163258
|