Commit Graph

6519 Commits

Author SHA1 Message Date
Brian Gaeke
46bf5afa01 Turn loads of ConstantPointerNulls into loads of zero... don't spill
them into the constant pool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14128 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 02:03:48 +00:00
Alkis Evlogimenos
f616f22e81 Add the isunordered intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14127 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-11 01:08:18 +00:00
Reid Spencer
7c7680a14e Remove tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14123 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 22:03:00 +00:00
Reid Spencer
cbb22e218e Implement detailed function level data collection and reporting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14122 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 22:00:54 +00:00
Reid Spencer
2467a06057 Adjust prototypes to new Handler interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14121 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 22:00:29 +00:00
Reid Spencer
ab5fce2299 Make the parser deal with functions instead of just function types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14120 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 21:59:20 +00:00
Reid Spencer
8d131d1fec Doxygenize a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14115 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 08:27:00 +00:00
Reid Spencer
00c28a7481 Implemented the bulk of the functionality. Cleaned up the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14113 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 08:09:13 +00:00
Chris Lattner
577aec1428 Fix the prolog epilog code inserter to match the documentation and support
targets whose stack grows up.

Patch contributed by Vladimir Prus


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14111 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 06:23:35 +00:00
Chris Lattner
32305f7763 Fix the fixed stack offset, patch contributed by Vladimir Prus
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14110 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 06:19:25 +00:00
Chris Lattner
3285a6f426 Fix a bug in my checkin from last night that caused miscompilations of
186.crafty, fhourstones and 132.ijpeg.

Bugpoint makes really nasty miscompilations embarassingly easy to find.  It
narrowed it down to the instcombiner and this testcase (from fhourstones):

bool %l7153_l4706_htstat_loopentry_2E_4_no_exit_2E_4(int* %i, [32 x int]* %works, int* %tmp.98.out) {
newFuncRoot:
        %tmp.96 = load int* %i          ; <int> [#uses=1]
        %tmp.97 = getelementptr [32 x int]* %works, long 0, int %tmp.96         ; <int*> [#uses=1]
        %tmp.98 = load int* %tmp.97             ; <int> [#uses=2]
        %tmp.99 = load int* %i          ; <int> [#uses=1]
        %tmp.100 = and int %tmp.99, 7           ; <int> [#uses=1]
        %tmp.101 = seteq int %tmp.100, 7                ; <bool> [#uses=2]
        %tmp.102 = cast bool %tmp.101 to int            ; <int> [#uses=0]
        br bool %tmp.101, label %codeRepl4.exitStub, label %codeRepl3.exitStub

codeRepl4.exitStub:             ; preds = %newFuncRoot
        store int %tmp.98, int* %tmp.98.out
        ret bool true

codeRepl3.exitStub:             ; preds = %newFuncRoot
        store int %tmp.98, int* %tmp.98.out
        ret bool false
}

... which only has one combination performed on it:

$ llvm-as < t.ll | opt -instcombine -debug | llvm-dis
IC: Old =       %tmp.101 = seteq int %tmp.100, 7                ; <bool> [#uses=1]
    New =       setne int %tmp.100, 0           ; <bool>:<badref> [#uses=0]
IC: MOD =       br bool %tmp.101, label %codeRepl3.exitStub, label %codeRepl4.exitStub
IC: MOD =       %tmp.97 = getelementptr [32 x int]* %works, uint 0, int %tmp.96         ; <int*> [#uses=1]

It doesn't get much better than this.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14109 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 02:33:20 +00:00
Chris Lattner
448c323cba More minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14108 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 02:12:35 +00:00
Chris Lattner
48595f18cf Eliminate many occurrances of Instruction::
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14107 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 02:07:29 +00:00
Chris Lattner
1797ce1e24 Share some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14106 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-10 01:57:38 +00:00
Chris Lattner
e9e326e2eb Tolerate more errors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14104 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 22:22:10 +00:00
Brian Gaeke
7fa84b70c3 Encode %fsr correctly; don't fail an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14103 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 21:54:59 +00:00
Brian Gaeke
40e7fdc05a Fix encoding of ST*FSR instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14102 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 21:54:58 +00:00
Brian Gaeke
e8a6bee3c9 Fix assertion failure message to have the right method name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14101 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 20:44:42 +00:00
Chris Lattner
69566459cc Make the asmwriter much more tolerant of errors (which are common when working
on new front-ends and stuff).  Also get rid of some tabs that snuck in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14100 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 19:41:19 +00:00
Reid Spencer
fc621e2878 Made it possible for the printInfoComment method to invoke getSlot in
such a way that if the Value being printed is standalone that we don't
assert and abort but just print ":??" for the slot number instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14097 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 15:26:53 +00:00
John Criswell
6b5bd5857d Fix for PR#366. We use getClassB() so that we can handle cast instructions
that cast to bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14096 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 15:18:51 +00:00
Chris Lattner
457dd829ad Implement InstCombine/select.ll:test15*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14095 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 07:59:58 +00:00
Reid Spencer
525f228d95 Cleanup alignment of output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14093 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:22:00 +00:00
Reid Spencer
edc3b582ae Implement analysis output. Don't dump function details unless requested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14091 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:17:58 +00:00
Reid Spencer
649ee57b1d Implement some rudimentary analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14090 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:16:43 +00:00
Reid Spencer
0545b3e673 Clean up indentation of file body output.
Don't dump functions unless "detailedResults" is requested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14089 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:16:19 +00:00
Reid Spencer
a670c414f7 Move parsing details to Parser.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14088 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:15:21 +00:00
Reid Spencer
926572c478 Bring some things out of header files that belong only in this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14087 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 06:14:52 +00:00
Chris Lattner
f523d06816 Be more careful about the order we put stuff onto the worklist. This allow us to
collapse this:
bool %le(int %A, int %B) {
        %c1 = setgt int %A, %B
        %tmp = select bool %c1, int 1, int 0
        %c2 = setlt int %A, %B
        %result = select bool %c2, int -1, int %tmp
        %c3 = setle int %result, 0
        ret bool %c3
}

into:

bool %le(int %A, int %B) {
        %c3 = setle int %A, %B          ; <bool> [#uses=1]
        ret bool %c3
}

which is handy, because the Java FE makes these sequences all over the place.

This is tested as: test/Regression/Transforms/InstCombine/JavaCompare.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14086 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 05:08:07 +00:00
Reid Spencer
6269ded8ee Cleaned up a dead header file to prevent duplicate definition warnings
in doxygen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14084 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 04:38:34 +00:00
Chris Lattner
2be51ae22d Implement select.ll:test14*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14083 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-09 04:24:29 +00:00
Chris Lattner
2a5020150c Workaround or a VS miscompilation bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14078 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 23:21:39 +00:00
Chris Lattner
47c31a8248 Don't grab the condition of unconditional branches!
This fixes PR363


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14076 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 21:50:30 +00:00
Brian Gaeke
8e6e7c90ce Fix a minor bug in the map - since this pass adds a global symbol, it must be
accounted for in the map (at least, in its current format).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14075 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 20:08:30 +00:00
Brian Gaeke
777a1cde66 Add a TmpInstruction ctor that doesn't take a MCFI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14073 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 18:52:46 +00:00
Chris Lattner
82d55902c6 Fix a link error using VS8.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14071 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 17:53:24 +00:00
Reid Spencer
5e8868d2a3 Fix the bug that was preventing the parser from working on all bytecode
files. It was reading non-initialized global vars when the flag said it was
initialized and vice versa. Causes mis-alignment since initialized and
non-initialized constants have different bytecode lengths.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14057 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 05:54:47 +00:00
Reid Spencer
b7041b0c43 Make it #include Parser.h instead of AnalyzerInternals.h since it only
needs the BytecodeHandler interface which is now in Parser.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14056 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 05:53:14 +00:00
Reid Spencer
aee4f5bbfd Adjust what's included to compensate for changes in Parser.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14055 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 05:52:29 +00:00
Reid Spencer
29dba0ceea Merged BytecodeHandler.h into Parser.h since the parser and the handler
must always coexist. Cleaned up the documentation on these interfaces
significantly. This is in preparation for moving Parser.h to the include
directories to make it a public interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14054 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-08 05:51:18 +00:00
Chris Lattner
40416e4e85 Fix PR361.
Dominance properties don't hold in unreachable code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14053 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-07 23:07:33 +00:00
Chris Lattner
fa5fe7c8b8 Make all of this functionality work directly on win32. Properly conditionalize
system specific stuff on HAVE_MKSTEMP


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14051 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-07 19:37:24 +00:00
Chris Lattner
b4db5f3e4b Implement getTimeRecord natively in Win32, properly conditionalize the
getrusage implementation on HAVE_GETRUSAGE


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14050 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-07 19:34:51 +00:00
Reid Spencer
dac69c83c2 Commit For New Tool: llvm-abcd (Analysis of ByteCode Dumper). This tool
will (eventually) provide statistical analysis of bytecode files as well
as the ability to dump them in a low level format (slot numbers not
resolved). The purpose of this is to aid in the Type!=Value change of
bug 122. With this initial release, llvm-abcd merely dumps out the
bytecode. However, the infrastructure for separating bytecode parsing from
handling the parsing events is in place. The style chosen is similar to
SAX XML parsing where a handler object is called to handlign the parsing
events. This probably isn't useful to anyone but me right now as there is
no analysis yet, and the dumper doesn't work on every bytecode file. It
will probably be useful by the end of this week. Note that there is some
duplication of code from the bytecode reader.  This was done to eliminate
errors from being introduced in the reader and to minimize the impact to
other LLVM developers. At some point, the Analyzer and the Reader will be
integrated to use the same infrastructure. Also, sorry for the minor change
to Instruction.h but I just couldn't bring myself to write code that
depends on Instruction internals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14048 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-07 17:53:43 +00:00
Chris Lattner
c7ca32b203 Add some notes so I can throw away one of my many todo lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14046 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-05 20:12:36 +00:00
Chris Lattner
c70a5092bf Fix GCC warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14045 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-05 17:44:48 +00:00
Chris Lattner
9bf2a926cb Fix GCC warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14044 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-05 17:43:52 +00:00
Alkis Evlogimenos
8868e84614 Include cerrno.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14041 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-05 08:59:43 +00:00
Chris Lattner
f0a3e6c21c Remove an unused variable.
Work around for bogus errors: no those static functions don't need to
be executed to be initialized!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14040 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-05 01:05:19 +00:00
Chris Lattner
8e72749fc0 Add missing #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14037 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-05 00:24:59 +00:00