summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAge
* Speculatively revert commit 121905 since it looks like it might have broken theDuncan Sands2010-12-16
| | | | | | | | | | | | dragonegg self-host buildbot. Original commit message: Add an InstCombine transform to recognize instances of manual overflow-safe addition (performing the addition in a wider type and explicitly checking for overflow), and fold them down to intrinsics. This currently only supports signed-addition, but could be generalized if someone works out the magic constant formulas for other operations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121965 91177308-0d34-0410-b5e6-96231b3b80d8
* 1. ARM/MC/ELF: A few more ELF relocs for .oJason W Kim2010-12-16
| | | | | | | | | 2. Fixed EmitLocalCommonSymbol for ELF (Yes, they exist. :) Test added. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121951 91177308-0d34-0410-b5e6-96231b3b80d8
* -enable-tbaa is on by default now.Dan Gohman2010-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121945 91177308-0d34-0410-b5e6-96231b3b80d8
* Make memcpyopt TBAA-aware.Dan Gohman2010-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121944 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix elf-dump --dump-section-data for .bss sectionJason W Kim2010-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121927 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve TBAA tags when doing load PRE.Dan Gohman2010-12-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121921 91177308-0d34-0410-b5e6-96231b3b80d8
* Thumb1 had two patterns for the same load-from-constant-pool instruction.Jim Grosbach2010-12-15
| | | | | | Canonicalize on tLDRpci and remove tLDRcp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121920 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't handle -arm-long-calls in fast isel for now.Eric Christopher2010-12-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121919 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an InstCombine transform to recognize instances of manual overflow-safe ↵Owen Anderson2010-12-15
| | | | | | | | | | | | | addition (performing the addition in a wider type and explicitly checking for overflow), and fold them down to intrinsics. This currently only supports signed-addition, but could be generalized if someone works out the magic constant formulas for other operations. Fixes <rdar://problem/8558713>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121905 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach machine cse to commute instructions.Evan Cheng2010-12-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121903 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Neon VCVT instructions for f32 <-> f16 conversions.Bob Wilson2010-12-15
| | | | | | | Clang is now providing intrinsics for these and so we need to support them in the backend. Radar 8068427. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121902 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix misspelled target triples in MC/ARM test commands.Bob Wilson2010-12-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121901 91177308-0d34-0410-b5e6-96231b3b80d8
* Lower the MBlaze target specific calling conventions for "interrupt_handler"Wesley Peck2010-12-15
| | | | | | | | and "save_volatiles" correctly. This completes the custom calling convention functionality changes for the MBlaze backend that were started in 121888. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121891 91177308-0d34-0410-b5e6-96231b3b80d8
* Move Sub simplifications and additional Add simplifications out ofDuncan Sands2010-12-15
| | | | | | | instcombine and into InstructionSimplify. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121861 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach jump threading to "look through" a select when the branch direction of ↵Frits van Bommel2010-12-15
| | | | | | | | | a terminator depends on it. When it sees a promising select it now tries to figure out whether the condition of the select is known in any of the predecessors and if so it maps the operands appropriately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121859 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax alignment fragments.Rafael Espindola2010-12-15
| | | | | | | | | | | With this we don't need the EffectiveSize field anymore. Without that field LayoutFragment only updates offsets and we don't need to invalidate the current fragment when it is relaxed (only the ones following it). This is also a very small improvement in the accuracy of the layout info as we now use the after relaxation size immediately. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121857 91177308-0d34-0410-b5e6-96231b3b80d8
* Patch by David Meyer to avoid a O(N^2) behaviour when relaxing fragments.Rafael Espindola2010-12-15
| | | | | | | Since we now don't update addresses so early, we might relax a bit more than we need to. This is simillar to the issue in PR8467. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121856 91177308-0d34-0410-b5e6-96231b3b80d8
* take care of some todos, transforming [us]mul_lohi into Chris Lattner2010-12-15
| | | | | | | a wider mul if the wider mul is legal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121848 91177308-0d34-0410-b5e6-96231b3b80d8
* merge two testsChris Lattner2010-12-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121847 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some more MC tests for ARM arithmetic instructions that update or don'tKevin Enderby2010-12-15
| | | | | | | | update the condition codes. These come from my test generator and are just the ones that MC currently assembles correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121830 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR8790, another instance where unreachable code can cause instruction ↵Owen Anderson2010-12-15
| | | | | | | | | simplification to fail, this case involve a select that simplifies to itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121817 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a minor bug in two-address pass. It was missing a commute opportunity.Evan Cheng2010-12-14
| | | | | | | | | | | | | | | | | | | | regB = move RCX regA = op regB, regC RAX = move regA where both regB and regC are killed. If regB is constrainted to non-compatible physical registers but regC is not constrainted at all, then it's better to commute the instruction. movl %edi, %eax shlq $32, %rcx leaq (%rcx,%rax), %rax => movl %edi, %eax shlq $32, %rcx orq %rcx, %rax rdar://8762995 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121793 91177308-0d34-0410-b5e6-96231b3b80d8
* MC/ARM: Fix-up fixup offset for fixup_arm_branch target specific fixup.Daniel Dunbar2010-12-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121772 91177308-0d34-0410-b5e6-96231b3b80d8
* - Insert new instructions before DomBlock's terminator,Chris Lattner2010-12-14
| | | | | | | | | | | which is simpler than finding a place to insert in BB. - Don't perform the 'if condition hoisting' xform on certain i1 PHIs, as it interferes with switch formation. This re-fixes "example 7", without breaking the world hopefully. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121764 91177308-0d34-0410-b5e6-96231b3b80d8
* fix two significant issues with FoldTwoEntryPHINode:Chris Lattner2010-12-14
| | | | | | | | | | | | | | | first, it can kick in on blocks whose conditions have been folded to a constant, even though one of the edges will be trivially folded. second, it doesn't clean up the "if diamond" that it just eliminated away. This is a problem because other simplifycfg xforms kick in depending on the order of block visitation, causing pointless work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121762 91177308-0d34-0410-b5e6-96231b3b80d8
* fix yet anohter broken lineChris Lattner2010-12-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121750 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply my recent change that disables a piece of the switch formationChris Lattner2010-12-14
| | | | | | | work, but fixes 400.perlbmk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121749 91177308-0d34-0410-b5e6-96231b3b80d8
* bfi A, (and B, C1), C2) -> bfi A, B, C2 iff C1 & C2 == C1. rdar://8458663Evan Cheng2010-12-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121746 91177308-0d34-0410-b5e6-96231b3b80d8
* fix fixme case typo :-) Jason W Kim2010-12-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121743 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix recent buildbot breakage by pulling SimplifyCFG back to its state as of ↵Owen Anderson2010-12-13
| | | | | | | | | r121694, the most recent state where I'm confident there were no crashes or miscompilations. XFAIL the test added since then for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121733 91177308-0d34-0410-b5e6-96231b3b80d8
* First cut of ARM/MC/ELF PIC relocations.Jason W Kim2010-12-13
| | | | | | | | Test has fixme, to move to .s -> .o test when AsmParser works better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121732 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the rest of the *_sfp Neon instruction patterns.Bob Wilson2010-12-13
| | | | | | | | | | | | | Use the same COPY_TO_REGCLASS approach as for the 2-register *_sfp instructions. This change made a big difference in the code generated for the CodeGen/Thumb2/cross-rc-coalescing-2.ll test: The coalescer is still doing a fine job, but some instructions that were previously moved outside the loop are not moved now. It's using fewer VFP registers now, which is generally a good thing, so I think the estimates for register pressure changed and that affected the LICM behavior. Since that isn't obviously wrong, I've just changed the test file. This completes the work for Radar 8711675. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121730 91177308-0d34-0410-b5e6-96231b3b80d8
* temporarily disable part of my previous patch, which causes an iterator ↵Chris Lattner2010-12-13
| | | | | | invalidation issue, causing a crash on some versions of perlbmk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121728 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r121520, PartialAlias implementation for BasicAA, now thatDan Gohman2010-12-13
| | | | | | | memdep is updated to handle it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121725 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix sort predicate. qsort(3)'s predicate semantics differ from std::sort's. ↵Benjamin Kramer2010-12-13
| | | | | | Fixes PR 8780. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121705 91177308-0d34-0410-b5e6-96231b3b80d8
* rename testChris Lattner2010-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121697 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a couple dag combines to transform mulhi/mullo into a wider multiplyChris Lattner2010-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when the wider type is legal. This allows us to compile: define zeroext i16 @test1(i16 zeroext %x) nounwind { entry: %div = udiv i16 %x, 33 ret i16 %div } into: test1: # @test1 movzwl 4(%esp), %eax imull $63551, %eax, %eax # imm = 0xF83F shrl $21, %eax ret instead of: test1: # @test1 movw $-1985, %ax # imm = 0xFFFFFFFFFFFFF83F mulw 4(%esp) andl $65504, %edx # imm = 0xFFE0 movl %edx, %eax shrl $5, %eax ret Implementing rdar://8760399 and example #4 from: http://blog.regehr.org/archives/320 We should implement the same thing for [su]mul_hilo, but I don't have immediate plans to do this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121696 91177308-0d34-0410-b5e6-96231b3b80d8
* reinstate my patch: the miscompile was caused by an inverted branch in theChris Lattner2010-12-13
| | | | | | | 'and' case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121695 91177308-0d34-0410-b5e6-96231b3b80d8
* Completely disable the optimization I added in r121680 untilChris Lattner2010-12-13
| | | | | | | | I can track down a miscompile. This should bring the buildbots back to life git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121693 91177308-0d34-0410-b5e6-96231b3b80d8
* Make simplifycfg reprocess newly formed "br (cond1 | cond2)" conditionsChris Lattner2010-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when simplifying, allowing them to be eagerly turned into switches. This is the last step required to get "Example 7" from this blog post: http://blog.regehr.org/archives/320 On X86, we now generate this machine code, which (to my eye) seems better than the ICC generated code: _crud: ## @crud ## BB#0: ## %entry cmpb $33, %dil jb LBB0_4 ## BB#1: ## %switch.early.test addb $-34, %dil cmpb $58, %dil ja LBB0_3 ## BB#2: ## %switch.early.test movzbl %dil, %eax movabsq $288230376537592865, %rcx ## imm = 0x400000017001421 btq %rax, %rcx jb LBB0_4 LBB0_3: ## %lor.rhs xorl %eax, %eax ret LBB0_4: ## %lor.end movl $1, %eax ret git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121690 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a bug in r121680 that upset the various buildbots.Chris Lattner2010-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121687 91177308-0d34-0410-b5e6-96231b3b80d8
* make these tests a bit less fragileChris Lattner2010-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121682 91177308-0d34-0410-b5e6-96231b3b80d8
* enhance the "change or icmp's into switch" xform to handle one value in an Chris Lattner2010-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'or sequence' that it doesn't understand. This allows us to optimize something insane like this: int crud (unsigned char c, unsigned x) { if(((((((((( (int) c <= 32 || (int) c == 46) || (int) c == 44) || (int) c == 58) || (int) c == 59) || (int) c == 60) || (int) c == 62) || (int) c == 34) || (int) c == 92) || (int) c == 39) != 0) foo(); } into: define i32 @crud(i8 zeroext %c, i32 %x) nounwind ssp noredzone { entry: %cmp = icmp ult i8 %c, 33 br i1 %cmp, label %if.then, label %switch.early.test switch.early.test: ; preds = %entry switch i8 %c, label %if.end [ i8 39, label %if.then i8 44, label %if.then i8 58, label %if.then i8 59, label %if.then i8 60, label %if.then i8 62, label %if.then i8 46, label %if.then i8 92, label %if.then i8 34, label %if.then ] by pulling the < comparison out ahead of the newly formed switch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121680 91177308-0d34-0410-b5e6-96231b3b80d8
* merge two testsChris Lattner2010-12-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121679 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix my previous patch to handle a degenerate case that the llvm-gccChris Lattner2010-12-13
| | | | | | | bootstrap buildbot tripped over. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121674 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a fairly serious oversight with switch formation fromChris Lattner2010-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | or'd conditions. Previously we'd compile something like this: int crud (unsigned char c) { return c == 62 || c == 34 || c == 92; } into: switch i8 %c, label %lor.rhs [ i8 62, label %lor.end i8 34, label %lor.end ] lor.rhs: ; preds = %entry %cmp8 = icmp eq i8 %c, 92 br label %lor.end lor.end: ; preds = %entry, %entry, %lor.rhs %0 = phi i1 [ true, %entry ], [ %cmp8, %lor.rhs ], [ true, %entry ] %lor.ext = zext i1 %0 to i32 ret i32 %lor.ext which failed to merge the compare-with-92 into the switch. With this patch we simplify this all the way to: switch i8 %c, label %lor.rhs [ i8 62, label %lor.end i8 34, label %lor.end i8 92, label %lor.end ] lor.rhs: ; preds = %entry br label %lor.end lor.end: ; preds = %entry, %entry, %entry, %lor.rhs %0 = phi i1 [ true, %entry ], [ false, %lor.rhs ], [ true, %entry ], [ true, %entry ] %lor.ext = zext i1 %0 to i32 ret i32 %lor.ext which is much better for codegen's switch lowering stuff. This kicks in 33 times on 176.gcc (for example) cutting 103 instructions off the generated code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121671 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for using the `!if' operator when initializing variables:Bill Wendling2010-12-13
| | | | | | | | | | | | class A<bit a, bits<3> x, bits<3> y> { bits<3> z; let z = !if(a, x, y); } The variable z will get the value of x when 'a' is 1 and 'y' when a is '0'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121666 91177308-0d34-0410-b5e6-96231b3b80d8
* Missed some ADDI <-> ADDIK conversions in 121649.Wesley Peck2010-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121652 91177308-0d34-0410-b5e6-96231b3b80d8
* Generalize the and-icmp-select instcombine further by allowing selects of ↵Benjamin Kramer2010-12-11
| | | | | | | | | | | | the form (x & 2^n) ? 2^m+C : C we can offset both arms by C to get the "(x & 2^n) ? 2^m : 0" form, optimize the select to a shift and apply the offset afterwards. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121609 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor the (x & 2^n) ? 2^m : 0 instcombine into its own method and generalize itBenjamin Kramer2010-12-11
| | | | | | | to catch cases where n != m with a shift. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121608 91177308-0d34-0410-b5e6-96231b3b80d8