- Sep 26, 2012
-
-
Hans Wennborg authored
- 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
-
Hans Wennborg authored
- Finish assert messages with exclamation mark - Move overflow checking into ShouldBuildLookupTable. llvm-svn: 164692
-
Hans Wennborg authored
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
-
Hans Wennborg authored
breaking out the building of lookup tables into a separate class. llvm-svn: 164682
-
Craig Topper authored
llvm-svn: 164666
-
Michael Ilseman authored
Fixed issue with Release build. llvm-svn: 164654
-
- Sep 25, 2012
-
-
Chad Rosier authored
llvm-svn: 164627
-
Michael Ilseman authored
llvm-svn: 164614
-
- Sep 21, 2012
-
-
Manman Ren authored
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
-
- Sep 19, 2012
-
-
Michael Ilseman authored
llvm-svn: 164238
-
Michael Ilseman authored
llvm-svn: 164235
-
Michael Ilseman authored
llvm-svn: 164232
-
Hans Wennborg authored
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
-
Benjamin Kramer authored
llvm-svn: 164216
-
Michael Ilseman authored
Implementation derived from compiler-rt's implementation of signed and unsigned integer division. llvm-svn: 164173
-
- Sep 18, 2012
-
-
Manman Ren authored
and a conditional branch; also when removing dead cases from a switch. llvm-svn: 164084
-
Manman Ren authored
Hanlde the case when we split the default edge if the default target has "icmp" and unconditinal branch. llvm-svn: 164076
-
Manman Ren authored
llvm-svn: 164068
-
- Sep 17, 2012
-
-
Manman Ren authored
destination in SimplifyCondBranchToCondBranch. llvm-svn: 164054
-
Axel Naumann authored
The cases where no initialization happens should still be checked for logic flaws. llvm-svn: 164032
-
- Sep 15, 2012
-
-
Manman Ren authored
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
-
- Sep 14, 2012
-
-
Manman Ren authored
case to a conditional branch and when removing dead cases. llvm-svn: 163942
-
Evan Cheng authored
llvm-svn: 163940
-
Alex Rosenberg authored
lit config. llvm-svn: 163928
-
Manman Ren authored
llvm-svn: 163926
-
Manman Ren authored
the default target of the first switch is not the basic block the second switch is in (PredDefault != BB). llvm-svn: 163916
-
- Sep 12, 2012
-
-
Manman Ren authored
to the default target. llvm-svn: 163724
-
Manman Ren authored
"#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)" No functional change. Update r163344. llvm-svn: 163679
-
- Sep 11, 2012
-
-
Manman Ren authored
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
-
NAKAMURA Takumi authored
llvm-svn: 163593
-
Alex Rosenberg authored
Add a pass that renames everything with metasyntatic names. This works well after using bugpoint to reduce the confusion presented by the original names, which no longer mean what they used to. llvm-svn: 163592
-
- Sep 10, 2012
-
-
Benjamin Kramer authored
llvm-svn: 163503
-
Hans Wennborg authored
llvm-svn: 163491
-
- Sep 08, 2012
-
-
Andrew Trick authored
Patch and test case by Alastair Murray! llvm-svn: 163437
-
- Sep 07, 2012
-
-
Hans Wennborg authored
llvm-svn: 163378
-
- Sep 06, 2012
-
-
Manman Ren authored
No functional change. llvm-svn: 163344
-
Hans Wennborg authored
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
-
Hans Wennborg authored
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
-
Roman Divacky authored
llvm-svn: 163258
-
- Sep 05, 2012
-
-
Jakub Staszak authored
llvm-svn: 163179
-