oota-llvm.git
19 years agoUse the actual uid/gid for defaulting the fields in the archive.
Reid Spencer [Thu, 21 Apr 2005 17:49:57 +0000 (17:49 +0000)]
Use the actual uid/gid for defaulting the fields in the archive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21405 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix a bug where we would not promote calls to invokes if they occured in
Chris Lattner [Thu, 21 Apr 2005 16:46:46 +0000 (16:46 +0000)]
Fix a bug where we would not promote calls to invokes if they occured in
the same block as the setjmp.  Thanks to Greg Pettyjohn for noticing this!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21403 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEliminate calls to system dependent function getuid by using
Reid Spencer [Thu, 21 Apr 2005 16:15:19 +0000 (16:15 +0000)]
Eliminate calls to system dependent function getuid by using
the newly implemented sys::Process::GetCurrentUserId function. Replace
similarly for getgid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21402 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoProvide an implementation of the GetCurrentUserId and GetCurrentGroupId
Reid Spencer [Thu, 21 Apr 2005 16:12:57 +0000 (16:12 +0000)]
Provide an implementation of the GetCurrentUserId and GetCurrentGroupId
methods that were recently added to the interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21401 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd two new methods for getting the User Id and Group Id values for the
Reid Spencer [Thu, 21 Apr 2005 16:12:04 +0000 (16:12 +0000)]
Add two new methods for getting the User Id and Group Id values for the
current process.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21400 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd doxygen comments, patch contributed by Evan Jones.
Chris Lattner [Thu, 21 Apr 2005 16:10:03 +0000 (16:10 +0000)]
Add doxygen comments, patch contributed by Evan Jones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21397 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd support for taking and resolving the address of free.
Chris Lattner [Thu, 21 Apr 2005 16:09:43 +0000 (16:09 +0000)]
add support for taking and resolving the address of free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21396 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd support for taking the address of free.
Chris Lattner [Thu, 21 Apr 2005 16:08:59 +0000 (16:08 +0000)]
add support for taking the address of free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21395 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImprove doxygen, from part of Evan's patch that didn't apply.
Chris Lattner [Thu, 21 Apr 2005 16:06:03 +0000 (16:06 +0000)]
Improve doxygen, from part of Evan's patch that didn't apply.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21394 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImprove doxygen documentation, patch contributed by Evan Jones!
Chris Lattner [Thu, 21 Apr 2005 16:04:49 +0000 (16:04 +0000)]
Improve doxygen documentation, patch contributed by Evan Jones!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21393 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImprove and elimination. On PPC, for:
Chris Lattner [Thu, 21 Apr 2005 06:28:15 +0000 (06:28 +0000)]
Improve and elimination.  On PPC, for:

bool %test(int %X) {
        %Y = and int %X, 8
        %Z = setne int %Y, 0
        ret bool %Z
}

we now generate this:

        rlwinm r2, r3, 0, 28, 28
        srwi r3, r2, 3

instead of this:

        rlwinm r2, r3, 0, 28, 28
        srwi r2, r2, 3
        rlwinm r3, r2, 0, 31, 31

I'll leave it to Nate to get it down to one instruction. :)

---------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21391 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFold (x & 8) != 0 and (x & 8) == 8 into (x & 8) >> 3.
Chris Lattner [Thu, 21 Apr 2005 06:12:41 +0000 (06:12 +0000)]
Fold (x & 8) != 0 and (x & 8) == 8  into (x & 8) >> 3.

This turns this PPC code:

        rlwinm r2, r3, 0, 28, 28
        cmpwi cr7, r2, 8
        mfcr r2
        rlwinm r3, r2, 31, 31, 31

into this:

        rlwinm r2, r3, 0, 28, 28
        srwi r2, r2, 3
        rlwinm r3, r2, 0, 31, 31

Next up, nuking the extra and.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21390 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoInstcombine this:
Chris Lattner [Thu, 21 Apr 2005 05:43:13 +0000 (05:43 +0000)]
Instcombine this:

        %shortcirc_val = select bool %tmp.1, bool true, bool %tmp.4             ; <bool> [#uses=1]
        %tmp.6 = cast bool %shortcirc_val to int                ; <int> [#uses=1]

into this:

        %shortcirc_val = or bool %tmp.1, %tmp.4         ; <bool> [#uses=1]
        %tmp.6 = cast bool %shortcirc_val to int                ; <int> [#uses=1]

not this:

        %tmp.4.cast = cast bool %tmp.4 to int           ; <int> [#uses=1]
        %tmp.6 = select bool %tmp.1, int 1, int %tmp.4.cast             ; <int> [#uses=1]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21389 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTeach simplifycfg that setcc is cheap and non-trapping, so that it can
Chris Lattner [Thu, 21 Apr 2005 05:31:13 +0000 (05:31 +0000)]
Teach simplifycfg that setcc is cheap and non-trapping, so that it can
convert this:

        %tmp.1 = seteq int %i, 0                ; <bool> [#uses=1]
        br bool %tmp.1, label %shortcirc_done, label %shortcirc_next

shortcirc_next:         ; preds = %entry
        %tmp.4 = seteq int %j, 0                ; <bool> [#uses=1]
        br label %shortcirc_done

shortcirc_done:         ; preds = %shortcirc_next, %entry
        %shortcirc_val = phi bool [ %tmp.4, %shortcirc_next ], [ true, %entry ]         ; <bool> [#uses=1]

to this:
        %tmp.1 = seteq int %i, 0                ; <bool> [#uses=1]
        %tmp.4 = seteq int %j, 0                ; <bool> [#uses=1]
        %shortcirc_val = select bool %tmp.1, bool true, bool %tmp.4             ; <bool> [#uses=1]

... which is later simplified by instcombine into an or.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21388 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix some broken links, taking care of PR554
Chris Lattner [Thu, 21 Apr 2005 04:53:58 +0000 (04:53 +0000)]
Fix some broken links, taking care of PR554

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21387 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoupdate to match build changes.
Chris Lattner [Thu, 21 Apr 2005 04:52:37 +0000 (04:52 +0000)]
update to match build changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21386 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFor Bug 543:
Reid Spencer [Thu, 21 Apr 2005 02:50:10 +0000 (02:50 +0000)]
For Bug 543:
Standardize the error messages to be in "path: what failed: why" format.
Also attempt to use the correct errno to ThrowErrno in situations where
the errno value is erased by subsequent system calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21385 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFor Bug 543:
Reid Spencer [Thu, 21 Apr 2005 02:30:32 +0000 (02:30 +0000)]
For Bug 543:
Allow the ThrowErrno function to optionally accept an error number
parameter so that callers can specify the error number to be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21384 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRemove trailing whitespace at the end of lines
Misha Brukman [Wed, 20 Apr 2005 16:42:34 +0000 (16:42 +0000)]
Remove trailing whitespace at the end of lines

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21380 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoRemove trailing whitespace, patch by Markus Oberhumer.
Misha Brukman [Wed, 20 Apr 2005 16:05:03 +0000 (16:05 +0000)]
Remove trailing whitespace, patch by Markus Oberhumer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21379 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd FIXME by Markus Oberhumer from bug 545: not checking for "." in $PATH may
Misha Brukman [Wed, 20 Apr 2005 15:42:11 +0000 (15:42 +0000)]
Add FIXME by Markus Oberhumer from bug 545: not checking for "." in $PATH may
result in returning executable files that won't be runnable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21378 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoDo not mark directories as `executable', we only want program files
Misha Brukman [Wed, 20 Apr 2005 15:33:22 +0000 (15:33 +0000)]
Do not mark directories as `executable', we only want program files
Patch by Markus Oberhumer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21377 91177308-0d34-0410-b5e6-96231b3b80d8

19 years ago#include system headers after all LLVM headers
Misha Brukman [Wed, 20 Apr 2005 04:51:29 +0000 (04:51 +0000)]
#include system headers after all LLVM headers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21374 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEliminate trailing spaces at end-of-line
Misha Brukman [Wed, 20 Apr 2005 04:08:35 +0000 (04:08 +0000)]
Eliminate trailing spaces at end-of-line

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21372 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoConsistently eschew space between `*' or `&' and function argument name
Misha Brukman [Wed, 20 Apr 2005 04:07:47 +0000 (04:07 +0000)]
Consistently eschew space between `*' or `&' and function argument name

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21371 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoIgnore dangling symlinks in getDirectoryContents()
Misha Brukman [Wed, 20 Apr 2005 04:04:07 +0000 (04:04 +0000)]
Ignore dangling symlinks in getDirectoryContents()
Thanks to Markus Oberhumer for the patch!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21370 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoInitialize fields mode, uid, and gid.
Misha Brukman [Wed, 20 Apr 2005 03:55:35 +0000 (03:55 +0000)]
Initialize fields mode, uid, and gid.
Patch by Markus Oberhumer.  Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21369 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAlign comments together for consistency
Misha Brukman [Wed, 20 Apr 2005 03:52:59 +0000 (03:52 +0000)]
Align comments together for consistency

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21368 91177308-0d34-0410-b5e6-96231b3b80d8

19 years ago* Print commands as we execute them with `-v'
Misha Brukman [Wed, 20 Apr 2005 03:22:18 +0000 (03:22 +0000)]
* Print commands as we execute them with `-v'
* Add option `-save-temps'
Patch contributed by Markus Oberhumer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21367 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoWrap some long lines.
Chris Lattner [Tue, 19 Apr 2005 19:16:19 +0000 (19:16 +0000)]
Wrap some long lines.
Make IPSCCP strip off dead constant exprs that are using functions, making
them appear as though their address is taken.  This allows us to propagate
some more pool descriptors, lowering the overhead of pool alloc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21363 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoignore generated files
Chris Lattner [Tue, 19 Apr 2005 15:34:36 +0000 (15:34 +0000)]
ignore generated files

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21362 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agofix bogus warning
Chris Lattner [Tue, 19 Apr 2005 15:32:30 +0000 (15:32 +0000)]
fix bogus warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21361 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agofix PR549
Chris Lattner [Tue, 19 Apr 2005 15:27:29 +0000 (15:27 +0000)]
fix PR549

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21360 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoBug fixed
Chris Lattner [Tue, 19 Apr 2005 06:08:04 +0000 (06:08 +0000)]
Bug fixed

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21355 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoEliminate a broken transformation, fixing PR548
Chris Lattner [Tue, 19 Apr 2005 06:04:18 +0000 (06:04 +0000)]
Eliminate a broken transformation, fixing PR548

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21354 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd completely untested support for mtcrf/mfcrf encoding
Chris Lattner [Tue, 19 Apr 2005 05:41:52 +0000 (05:41 +0000)]
Add completely untested support for mtcrf/mfcrf encoding

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21353 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoswitch over the rest of the formats that use RC to use isDOT
Chris Lattner [Tue, 19 Apr 2005 05:21:30 +0000 (05:21 +0000)]
switch over the rest of the formats that use RC to use isDOT

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21352 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoConvert the XForm instrs and XSForm instruction over to use isDOT
Chris Lattner [Tue, 19 Apr 2005 05:15:18 +0000 (05:15 +0000)]
Convert the XForm instrs and XSForm instruction over to use isDOT

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21351 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoNow that the ppc64 and vmx operands of I are always 0, forward substitute
Chris Lattner [Tue, 19 Apr 2005 05:05:22 +0000 (05:05 +0000)]
Now that the ppc64 and vmx operands of I are always 0, forward substitute
them away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21350 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoconvert over bform and iform instructions
Chris Lattner [Tue, 19 Apr 2005 05:00:59 +0000 (05:00 +0000)]
convert over bform and iform instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21349 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoConvert over DForm and DSForm instructions
Chris Lattner [Tue, 19 Apr 2005 04:59:28 +0000 (04:59 +0000)]
Convert over DForm and DSForm instructions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21348 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoConvert XLForm and XForm instructions over to use PPC64 when appropriate.
Chris Lattner [Tue, 19 Apr 2005 04:51:30 +0000 (04:51 +0000)]
Convert XLForm and XForm instructions over to use PPC64 when appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21347 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoConvert XO XS and XFX forms to use isPPC64
Chris Lattner [Tue, 19 Apr 2005 04:40:07 +0000 (04:40 +0000)]
Convert XO XS and XFX forms to use isPPC64

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21346 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTurn PPC64 and VMX into classes that can be added to instructions instead of
Chris Lattner [Tue, 19 Apr 2005 04:32:54 +0000 (04:32 +0000)]
Turn PPC64 and VMX into classes that can be added to instructions instead of
bits that must be passed up the inheritance hierarchy.  Convert MForm and AForm
instructions over

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21345 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMajor change to tblgen: instead of resolving values every time a class is
Chris Lattner [Tue, 19 Apr 2005 03:36:21 +0000 (03:36 +0000)]
Major change to tblgen: instead of resolving values every time a class is
finished up, only resolve fully when the def is defined.  This allows things
to be changed and all uses to be propagated through.  This implements
TableGen/LazyChange.td and fixes TemplateArgRename.td in the process.

None of the .td files used in LLVM backends are changed at all by this
patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21344 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoNew testcase for a changing values late and allowing them to propagate
Chris Lattner [Tue, 19 Apr 2005 03:34:58 +0000 (03:34 +0000)]
New testcase for a changing values late and allowing them to propagate

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21343 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake this significantly harder
Chris Lattner [Tue, 19 Apr 2005 02:58:57 +0000 (02:58 +0000)]
Make this significantly harder

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21342 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a real run line
Chris Lattner [Tue, 19 Apr 2005 02:53:26 +0000 (02:53 +0000)]
Add a real run line

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21341 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agofix this testcase
Chris Lattner [Tue, 19 Apr 2005 02:52:04 +0000 (02:52 +0000)]
fix this testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21340 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew testcase
Chris Lattner [Tue, 19 Apr 2005 02:26:23 +0000 (02:26 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21339 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd a run line
Chris Lattner [Tue, 19 Apr 2005 01:37:24 +0000 (01:37 +0000)]
add a run line

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21338 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoTell dj to run the tests in this directory
Chris Lattner [Tue, 19 Apr 2005 01:36:41 +0000 (01:36 +0000)]
Tell dj to run the tests in this directory

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21337 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoimplementing shifting of literal integers
Chris Lattner [Tue, 19 Apr 2005 01:17:35 +0000 (01:17 +0000)]
implementing shifting of literal integers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21336 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd initial lexer and parser support for shifting values. Every use of this
Chris Lattner [Tue, 19 Apr 2005 01:11:03 +0000 (01:11 +0000)]
Add initial lexer and parser support for shifting values.  Every use of this
will lead to it being rejected though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21335 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoNext round of PPC CR optimizations. For the following code:
Nate Begeman [Mon, 18 Apr 2005 07:48:09 +0000 (07:48 +0000)]
Next round of PPC CR optimizations.  For the following code:

int %bar(float %a, float %b, float %c, float %d) {
entry:
    %tmp.1 = setlt float %a, %d
    %tmp.2 = setlt float %b, %d
    %or = or bool %tmp.1, %tmp.2
    %tmp.3 = setgt float %c, %d
    %tmp.4 = or bool %or, %tmp.3
    %tmp.5 = and bool %tmp.4, true
    %retval = cast bool %tmp.5 to int
    ret int %retval
}

We now emit:

_bar:
.LBB_bar_0:     ; entry
        fcmpu cr0, f1, f4
        fcmpu cr1, f2, f4
        cror 0, 0, 4
        fcmpu cr1, f3, f4
        cror 28, 0, 5
        mfcr r2
        rlwinm r3, r2, 29, 31, 31
        blr

Instead of:

_bar:
.LBB_bar_0:     ; entry
        fcmpu cr7, f1, f4
        mfcr r2
        rlwinm r2, r2, 29, 31, 31
        fcmpu cr7, f2, f4
        mfcr r3
        rlwinm r3, r3, 29, 31, 31
        or r2, r2, r3
        fcmpu cr7, f3, f4
        mfcr r3
        rlwinm r3, r3, 30, 31, 31
        or r3, r2, r3
        blr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21321 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agosilence a bogus warning
Chris Lattner [Mon, 18 Apr 2005 05:26:21 +0000 (05:26 +0000)]
silence a bogus warning

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21320 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFold setcc of MVT::i1 operands into logical operations
Chris Lattner [Mon, 18 Apr 2005 04:48:12 +0000 (04:48 +0000)]
Fold setcc of MVT::i1 operands into logical operations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21319 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAnother minor simplification: handle setcc (zero_extend x), c -> setcc(x, c')
Chris Lattner [Mon, 18 Apr 2005 04:30:45 +0000 (04:30 +0000)]
Another minor simplification: handle setcc (zero_extend x), c -> setcc(x, c')

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21318 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAnother simple xform
Chris Lattner [Mon, 18 Apr 2005 04:11:19 +0000 (04:11 +0000)]
Another simple xform

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21317 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFold:
Chris Lattner [Mon, 18 Apr 2005 03:59:53 +0000 (03:59 +0000)]
Fold:
        // (X != 0) | (Y != 0) -> (X|Y != 0)
        // (X == 0) & (Y == 0) -> (X|Y == 0)

Compiling this:

int %bar(int %a, int %b) {
        entry:
        %tmp.1 = setne int %a, 0
        %tmp.2 = setne int %b, 0
        %tmp.3 = or bool %tmp.1, %tmp.2
        %retval = cast bool %tmp.3 to int
        ret int %retval
        }

to this:

_bar:
        or r2, r3, r4
        addic r3, r2, -1
        subfe r3, r3, r2
        blr

instead of:

_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r3, r2, r3
        blr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21316 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake the AND elimination operation recursive and significantly more powerful,
Chris Lattner [Mon, 18 Apr 2005 03:48:41 +0000 (03:48 +0000)]
Make the AND elimination operation recursive and significantly more powerful,
eliminating an and for Nate's testcase:

int %bar(int %a, int %b) {
        entry:
        %tmp.1 = setne int %a, 0
        %tmp.2 = setne int %b, 0
        %tmp.3 = or bool %tmp.1, %tmp.2
        %retval = cast bool %tmp.3 to int
        ret int %retval
        }

generating:

_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r3, r2, r3
        blr

instead of:

_bar:
        addic r2, r3, -1
        subfe r2, r2, r3
        addic r3, r4, -1
        subfe r3, r3, r4
        or r2, r2, r3
        rlwinm r3, r2, 0, 31, 31
        blr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21315 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoChange codegen for setcc to read the bit directly out of the condition
Nate Begeman [Mon, 18 Apr 2005 02:43:24 +0000 (02:43 +0000)]
Change codegen for setcc to read the bit directly out of the condition
  register.  Added support in the .td file for the g5-specific variant
  of cr -> gpr moves that executes faster, but we currently don't
  generate it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21314 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd support for targets that require stubs for external functions.
Chris Lattner [Mon, 18 Apr 2005 01:44:27 +0000 (01:44 +0000)]
Add support for targets that require stubs for external functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21313 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoHandle ExternalSymbol operands in the PPC JIT
Chris Lattner [Mon, 18 Apr 2005 00:46:10 +0000 (00:46 +0000)]
Handle ExternalSymbol operands in the PPC JIT

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21312 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoUpdate dejagnu tests to use the new pattern isel flag
Nate Begeman [Sat, 16 Apr 2005 04:25:48 +0000 (04:25 +0000)]
Update dejagnu tests to use the new pattern isel flag

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21311 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd CondPropagate.cpp to VC++ Transforms project
Jeff Cohen [Sat, 16 Apr 2005 02:51:44 +0000 (02:51 +0000)]
Add CondPropagate.cpp to VC++ Transforms project

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21310 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake pattern isel default for ppc
Nate Begeman [Fri, 15 Apr 2005 22:12:16 +0000 (22:12 +0000)]
Make pattern isel default for ppc
Add new ppc beta option related to using condition registers
Make pattern isel control flag (-enable-pattern-isel) global and tristate
  0 == off
  1 == on
  2 == target default

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21309 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew pass
Chris Lattner [Fri, 15 Apr 2005 21:13:16 +0000 (21:13 +0000)]
new pass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21307 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoa new simple pass, which will be extended to be more useful in the future.
Chris Lattner [Fri, 15 Apr 2005 19:28:32 +0000 (19:28 +0000)]
a new simple pass, which will be extended to be more useful in the future.

This pass forward branches through conditions when it can show that the
conditions is either always true or false for a predecessor.  This currently
only handles the most simple cases of this, but is successful at threading
across 2489 branches and 65 switch instructions in 176.gcc, which isn't bad.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21306 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd a new prototype
Chris Lattner [Fri, 15 Apr 2005 19:24:49 +0000 (19:24 +0000)]
add a new prototype

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21305 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agonew testcase
Chris Lattner [Fri, 15 Apr 2005 19:24:36 +0000 (19:24 +0000)]
new testcase

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21304 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agofix calls
Andrew Lenharth [Thu, 14 Apr 2005 17:34:20 +0000 (17:34 +0000)]
fix calls

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21303 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoa 21264 fix, and fix the operator precidence on an and -> zap check (should fix hundr...
Andrew Lenharth [Thu, 14 Apr 2005 16:24:00 +0000 (16:24 +0000)]
a 21264 fix, and fix the operator precidence on an and -> zap check (should fix hundreds of test cases

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21302 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadded a random and mask test
Andrew Lenharth [Thu, 14 Apr 2005 16:17:49 +0000 (16:17 +0000)]
added a random and mask test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21301 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoprint negative 64 bit immediates as negative numbers, makes things a little
Duraid Madina [Thu, 14 Apr 2005 10:08:01 +0000 (10:08 +0000)]
print negative 64 bit immediates as negative numbers, makes things a little
easier on the eyes, not that numbers like 18446744073709541376 are bad or
anything

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21300 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agooops, this stopped us turning movl r4=0xFFFFFFFF;; and rX, r4 into zxt4
Duraid Madina [Thu, 14 Apr 2005 10:06:35 +0000 (10:06 +0000)]
oops, this stopped us turning movl r4=0xFFFFFFFF;; and rX, r4  into zxt4

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21299 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement multi-way branches through logical ops on condition registers.
Nate Begeman [Thu, 14 Apr 2005 09:45:08 +0000 (09:45 +0000)]
Implement multi-way branches through logical ops on condition registers.
This can generate considerably shorter code, reducing the size of crafty
by almost 1%.  Also fix the printing of mcrf.  The code is currently
disabled until it gets a bit more testing, but should work as-is.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21298 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd a couple missing transforms in getSetCC that were triggering assertions
Nate Begeman [Thu, 14 Apr 2005 08:56:52 +0000 (08:56 +0000)]
Add a couple missing transforms in getSetCC that were triggering assertions
in the PPC Pattern ISel

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21297 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agowe have zextloads, not sextloads!
Duraid Madina [Thu, 14 Apr 2005 08:37:32 +0000 (08:37 +0000)]
we have zextloads, not sextloads!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21296 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd the necessary support to codegen condition register logical ops with
Nate Begeman [Thu, 14 Apr 2005 03:20:38 +0000 (03:20 +0000)]
Add the necessary support to codegen condition register logical ops with
  register allocated condition registers.  Make sure that the printed
  output is gas compatible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21295 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoStart allocating condition registers. Almost all explicit uses of CR0 are
Nate Begeman [Wed, 13 Apr 2005 23:15:44 +0000 (23:15 +0000)]
Start allocating condition registers.  Almost all explicit uses of CR0 are
now gone.  Next step is to get rid of the remaining ones and then start
allocating bools to CRs where appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21294 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement the fold shift X, zext(Y) -> shift X, Y at the target level,
Nate Begeman [Wed, 13 Apr 2005 22:14:14 +0000 (22:14 +0000)]
Implement the fold shift X, zext(Y) -> shift X, Y at the target level,
  where it is safe to do so.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21293 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoAdd CodeGen tests for the recent SelectionDAG transforms
Nate Begeman [Wed, 13 Apr 2005 21:45:13 +0000 (21:45 +0000)]
Add CodeGen tests for the recent SelectionDAG transforms

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21292 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoDisbale the broken fold of shift + sz[ext] for now
Nate Begeman [Wed, 13 Apr 2005 21:23:31 +0000 (21:23 +0000)]
Disbale the broken fold of shift + sz[ext] for now
Move the transform for select (a < 0) ? b : 0 into the dag from ppc isel
Enable the dag to fold and (setcc, 1) -> setcc for targets where setcc
  always produces zero or one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21291 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agofix an infinite loop
Chris Lattner [Wed, 13 Apr 2005 20:06:29 +0000 (20:06 +0000)]
fix an infinite loop

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21289 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agofix some serious miscompiles on ia64, alpha, and ppc
Chris Lattner [Wed, 13 Apr 2005 19:53:40 +0000 (19:53 +0000)]
fix some serious miscompiles on ia64, alpha, and ppc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21288 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoavoid work when possible, perhaps fix the problem nate and andrew are seeing
Chris Lattner [Wed, 13 Apr 2005 19:41:05 +0000 (19:41 +0000)]
avoid work when possible, perhaps fix the problem nate and andrew are seeing
with != 0 comparisons vanishing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21287 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoWOW, function calls still seem to work after this.
Andrew Lenharth [Wed, 13 Apr 2005 17:17:28 +0000 (17:17 +0000)]
WOW, function calls still seem to work after this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21286 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoprepare for func call optimization
Andrew Lenharth [Wed, 13 Apr 2005 16:19:50 +0000 (16:19 +0000)]
prepare for func call optimization

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21285 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoregression case for faster call sequence
Andrew Lenharth [Wed, 13 Apr 2005 16:16:01 +0000 (16:16 +0000)]
regression case for faster call sequence

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21284 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agocheck that casts still use zap
Andrew Lenharth [Wed, 13 Apr 2005 13:00:16 +0000 (13:00 +0000)]
check that casts still use zap

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21283 91177308-0d34-0410-b5e6-96231b3b80d8

19 years ago* add the shladd instruction
Duraid Madina [Wed, 13 Apr 2005 06:12:04 +0000 (06:12 +0000)]
* add the shladd instruction
* fold left shifts of 1, 2, 3 or 4 bits into adds

  This doesn't save much now, but should get a serious workout once
  multiplies by constants get converted to shift/add/sub sequences.
  Hold on! :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21282 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd matches for SxADDL and company, as well as simplify the SxADDQ code
Andrew Lenharth [Wed, 13 Apr 2005 05:19:55 +0000 (05:19 +0000)]
add matches for SxADDL and company, as well as simplify the SxADDQ code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21281 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoImplement expansion of unsigned i64 -> FP.
Chris Lattner [Wed, 13 Apr 2005 05:09:42 +0000 (05:09 +0000)]
Implement expansion of unsigned i64 -> FP.

Note that this probably only works for little endian targets, but is enough
to get siod working :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21280 91177308-0d34-0410-b5e6-96231b3b80d8

19 years ago* if ANDing with a constant of the form:
Duraid Madina [Wed, 13 Apr 2005 04:50:54 +0000 (04:50 +0000)]
* if ANDing with a constant of the form:

  0x00000..00FFF..FF
      ^      ^
      ^      ^
    any number of
    0's followed by
    some number of
    1's

    then we use dep.z to just paste zeros over the input. For the special
    cases where this is zxt1/zxt2/zxt4, we use those instructions instead,
    because we're all about readability!!!
    that's what it's about!! readability!

  *twitch* ;D

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21279 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadded s4addl matching test
Andrew Lenharth [Wed, 13 Apr 2005 04:41:06 +0000 (04:41 +0000)]
added s4addl matching test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21277 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadded all flavors of zap for anding
Andrew Lenharth [Wed, 13 Apr 2005 03:47:03 +0000 (03:47 +0000)]
added all flavors of zap for anding

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21276 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoMake expansion of uint->fp cast assert out instead of infinitely recurse.
Chris Lattner [Wed, 13 Apr 2005 03:42:14 +0000 (03:42 +0000)]
Make expansion of uint->fp cast assert out instead of infinitely recurse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21275 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoFix some mysteriously missing {}'s which cause the miscompilation of
Chris Lattner [Wed, 13 Apr 2005 03:29:53 +0000 (03:29 +0000)]
Fix some mysteriously missing {}'s which cause the miscompilation of
Olden/mst, Ptrdist/bc, Obsequi, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21274 91177308-0d34-0410-b5e6-96231b3b80d8

19 years agoadd back the optimization that Nate added for shl X, (zext_inreg y)
Chris Lattner [Wed, 13 Apr 2005 02:58:13 +0000 (02:58 +0000)]
add back the optimization that Nate added for shl X, (zext_inreg y)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21273 91177308-0d34-0410-b5e6-96231b3b80d8