Commit Graph

30616 Commits

Author SHA1 Message Date
Reid Spencer 3939b1a274 Remove an unnecessary if statement and adjust indentation.
llvm-svn: 34939
2007-03-05 23:36:13 +00:00
Bill Wendling b1c86b49ea Add the emms intrinsic for MMX support.
llvm-svn: 34938
2007-03-05 23:09:45 +00:00
Reid Spencer ad0075d6d4 Document the use of getValueType() more accurately, specifically explain
that the instruction opcode is added to the InstructionVal value and the
consequences of that.

llvm-svn: 34937
2007-03-05 23:06:32 +00:00
Devang Patel ec2b9a7850 Current pass manager, not the parent pass manager, assumes the role of
last user when one of the managed pass uses info provided by parent pass
manager.

This was exposed by LPPassManager work.

llvm-svn: 34936
2007-03-05 22:57:49 +00:00
Reid Spencer 509acc186e Add a test case for a particular udiv/select transform.
llvm-svn: 34935
2007-03-05 22:51:08 +00:00
Devang Patel 003a559633 Avoid constructing std::strings unless pass debugging is ON.
llvm-svn: 34933
2007-03-05 20:01:30 +00:00
Devang Patel 7ebf09dbca Account for time consumed by releaseMemory() properly.
llvm-svn: 34932
2007-03-05 18:20:51 +00:00
Lauro Ramos Venancio f10769dda7 Use init_array/fini_array sections for static contructors/destructors when the ABI is AAPCS.
Fix SingleSource/Regression/C/ConstructorDestructorAttributes test on arm-linux-gnueabi.

llvm-svn: 34931
2007-03-05 17:59:58 +00:00
Jeff Cohen 9bf52a72d1 The hack won't work on VS 2005, and it might not be needed anyway.
llvm-svn: 34930
2007-03-05 17:22:33 +00:00
Zhou Sheng 9587a919ee Correct the calculation in APInt::logBase2().
llvm-svn: 34929
2007-03-05 16:42:58 +00:00
Duncan Sands b4086b65e1 Credit self for Ada front-end.
llvm-svn: 34928
2007-03-05 09:21:11 +00:00
Duncan Sands 0af659640e Testcase for handling of static constant declarations in EmitBIND_EXPR.
llvm-svn: 34927
2007-03-05 08:39:58 +00:00
Duncan Sands 49f6938169 Testcase causing the Ada front-end to create bogus constructor fields.
llvm-svn: 34926
2007-03-05 08:34:35 +00:00
Duncan Sands 14b7061a60 New directory for Ada testcases. Test handling of NON_LVALUE_EXPR.
llvm-svn: 34925
2007-03-05 08:20:48 +00:00
Chris Lattner 66e6a8229a This is the first major step of implementing PR1226. We now successfully
scalarrepl things down to elements, but mem2reg can't promote elements that
are memset/memcpy'd.  Until then, the code is disabled "0 &&".

llvm-svn: 34924
2007-03-05 07:52:57 +00:00
Jeff Cohen 7157fe3f4b Ensure 64-bit correctness.
llvm-svn: 34923
2007-03-05 05:45:08 +00:00
Jeff Cohen a531d04b64 Implement memoryLimit on Windows.
llvm-svn: 34922
2007-03-05 05:22:08 +00:00
Jeff Cohen 50bf51e8ac Elminate tabs and improve comments.
llvm-svn: 34921
2007-03-05 00:46:22 +00:00
Chris Lattner fe53cf2459 fix a subtle bug that caused an MSVC warning. Thanks to Jeffc for pointing this out.
llvm-svn: 34920
2007-03-05 00:11:19 +00:00
Chris Lattner 5fdded1d2f Add some simplifications for demanded bits, this allows instcombine to turn:
define i64 @test(i64 %A, i32 %B) {
        %tmp12 = zext i32 %B to i64             ; <i64> [#uses=1]
        %tmp3 = shl i64 %tmp12, 32              ; <i64> [#uses=1]
        %tmp5 = add i64 %tmp3, %A               ; <i64> [#uses=1]
        %tmp6 = and i64 %tmp5, 123              ; <i64> [#uses=1]
        ret i64 %tmp6
}

into:

define i64 @test(i64 %A, i32 %B) {
        %tmp6 = and i64 %A, 123         ; <i64> [#uses=1]
        ret i64 %tmp6
}

This implements Transforms/InstCombine/add2.ll:test1

llvm-svn: 34919
2007-03-05 00:02:29 +00:00
Chris Lattner 3a8b0c7607 new testcase
llvm-svn: 34918
2007-03-05 00:01:38 +00:00
Jeff Cohen b622c11f77 Unbreak VC++ build.
llvm-svn: 34917
2007-03-05 00:00:42 +00:00
Chris Lattner 2fbcc0714c add a getSignBit method, elimiante virtual method from getBitMask()
llvm-svn: 34916
2007-03-04 23:33:19 +00:00
Chris Lattner e824f085c8 fix 80 col violations, mark arrays static
llvm-svn: 34915
2007-03-04 23:33:03 +00:00
Chris Lattner ab2f913b68 simplify some code
llvm-svn: 34914
2007-03-04 23:16:36 +00:00
Chris Lattner 47206667c0 fold away addc nodes when we know there cannot be a carry-out.
llvm-svn: 34913
2007-03-04 20:40:38 +00:00
Chris Lattner dc3d4406bd add a new node
llvm-svn: 34912
2007-03-04 20:40:06 +00:00
Chris Lattner 4bdd578f8a new testcase, corresponds to:
long long test(long long A, unsigned B) {
  return (A + ((long long)B << 32));
}

llvm-svn: 34911
2007-03-04 20:39:47 +00:00
Chris Lattner 2dcc6e7f58 generalize
llvm-svn: 34910
2007-03-04 20:08:45 +00:00
Chris Lattner e2e13caeb2 canonicalize constants to the RHS of addc/adde. If nothing uses the carry out of
addc, turn it into add.

This allows us to compile:

long long test(long long A, unsigned B) {
  return (A + ((long long)B << 32)) & 123;
}

into:

_test:
        movl $123, %eax
        andl 4(%esp), %eax
        xorl %edx, %edx
        ret

instead of:
_test:
        xorl %edx, %edx
        movl %edx, %eax
        addl 4(%esp), %eax   ;; add of zero
        andl $123, %eax
        ret

llvm-svn: 34909
2007-03-04 20:03:15 +00:00
Chris Lattner 362621c7ae eliminate some ops if they have an undef RHS
llvm-svn: 34908
2007-03-04 20:01:46 +00:00
Chris Lattner 1e04147240 fix typo
llvm-svn: 34906
2007-03-04 06:36:24 +00:00
Chris Lattner d647f92a14 add missing braces
llvm-svn: 34905
2007-03-04 06:13:52 +00:00
Chris Lattner c33fd469ef minor cleanups
llvm-svn: 34904
2007-03-04 04:50:21 +00:00
Reid Spencer b8825b8c04 Remove unneeded header file.
llvm-svn: 34903
2007-03-04 04:41:04 +00:00
Chris Lattner 8258b44b22 Speed up -instcombine by 20% by avoiding a particularly expensive passmgr call.
llvm-svn: 34902
2007-03-04 04:27:24 +00:00
Chris Lattner a5403a587c switch MarkAliveBlocks over to using SmallPtrSet instead of std::set, speeding
up simplifycfg by 20%

llvm-svn: 34901
2007-03-04 04:20:48 +00:00
Chris Lattner 16cf9a7686 Speed up Loop::isLCSSAForm by using a hash table instead of a sorted vector.
llvm-svn: 34900
2007-03-04 04:06:39 +00:00
Chris Lattner f083768df3 add iterator range version of ctor.
llvm-svn: 34899
2007-03-04 04:04:43 +00:00
Chris Lattner d7b4c92cd0 make better use of LCSSA information in RewriteLoopExitValues. Before, we
would scan the entire loop body, then scan all users of instructions in the
loop, looking for users outside the loop.  Now, since we know that the
loop is in LCSSA form, we know that any users outside the loop will be LCSSA
phi nodes.  Just scan them.

This speeds up indvars significantly.

llvm-svn: 34898
2007-03-04 03:43:23 +00:00
Reid Spencer 69904f939a Guard further against APInt operations with operands of unequal bit width.
llvm-svn: 34897
2007-03-04 01:25:35 +00:00
Chris Lattner 1f7648efba Implement PR1179/PR1232 and test/Transforms/IndVarsSimplify/loop_evaluate_[234].ll
This makes -indvars require and use LCSSA, updating it as appropriate.

llvm-svn: 34896
2007-03-04 01:00:28 +00:00
Chris Lattner dd3f9f8c3b New testcases for PR1179/PR1232.
llvm-svn: 34895
2007-03-04 00:54:06 +00:00
Reid Spencer ed2ce58244 Get the version number for the LLVM from the autoconf/configure.ac file
when building the documentation for the web site.

llvm-svn: 34894
2007-03-04 00:45:50 +00:00
Chris Lattner ca401aac31 Fix CodeGen/Generic/fpowi-promote.ll and PR1239
llvm-svn: 34893
2007-03-03 23:43:21 +00:00
Chris Lattner 6053ad4252 New testcase for PR1239
llvm-svn: 34892
2007-03-03 23:42:50 +00:00
Chris Lattner ed30abf0cb Make RewriteLoopExitValues far less nested by using continue in the loop
llvm-svn: 34891
2007-03-03 22:48:48 +00:00
Chris Lattner 567b9254cd Add an expand action for ISD label which just deletes the label.
This "fixes" PR1238.

llvm-svn: 34890
2007-03-03 19:21:38 +00:00
Reid Spencer 04a1829559 Remove unnecessary #include.
llvm-svn: 34889
2007-03-03 18:29:16 +00:00
Reid Spencer e586f2e7f7 1. Handle errors around the ModuleProvider. This is necessary since it is
reading bytecode.
2. The interpreter can delete the ModuleProvider and replace it with
   another so don't depend on it being around after the EE is created.
3. Don't just run llvm_shutdown on exit but actually delete the EE as well.
   This cleans up a vast amount of memory (but not all) that EE retained
   through exit.

llvm-svn: 34888
2007-03-03 18:21:44 +00:00
Reid Spencer 603682ad1d Deal with error handling better.
llvm-svn: 34887
2007-03-03 18:19:18 +00:00
Reid Spencer 30ed3bdaf2 Make the creation functions take an error string. This will help the
ExecutionEngine report errors on creation (like bytecode stuff) and also
help to get rid of exception handling.

llvm-svn: 34886
2007-03-03 18:18:11 +00:00
Reid Spencer 1f87660d29 Make sure that when we store a value it is masked to its correct bit
width. This helps CBE work with non-standard integer bit widths.

llvm-svn: 34885
2007-03-03 16:33:33 +00:00
Reid Spencer ec8c51c1b1 Complete the APIntification of the interpreter. All asserts for > 64 bits
have been removed and dealt with. The interpreter should now be able to
execute any LLVM program using any bit width.

llvm-svn: 34884
2007-03-03 08:38:04 +00:00
Reid Spencer 00919f5769 Avoid memory leakage by having caller construct the APInt for the
destination value of LoadValueFromMemory.

llvm-svn: 34883
2007-03-03 08:36:29 +00:00
Reid Spencer c3bfe13ed5 Require the destination GlobalValue for LoadValueFromMemory to be passed
in as a parameter instead of returned.

llvm-svn: 34882
2007-03-03 08:35:14 +00:00
Reid Spencer 94a48f06e5 Regularize the interface for conversion functions to/from float/double.
llvm-svn: 34881
2007-03-03 08:34:02 +00:00
Reid Spencer 50d7ad9183 Fix constant folding of fp->int bitcast for vectors.
llvm-svn: 34880
2007-03-03 08:32:46 +00:00
Reid Spencer cfe415c4e1 Add APIntVal as a possible GenericeValue.
llvm-svn: 34879
2007-03-03 07:36:44 +00:00
Evan Cheng d74cb0e194 Only propagate IsKill if the last use is a kill.
llvm-svn: 34878
2007-03-03 06:32:37 +00:00
Reid Spencer 54c6e84c83 Implement APInt support for the binary operators.
Move the getConstantExpr function towards the end of the file so we don't
need a dozen forward declarations.

llvm-svn: 34877
2007-03-03 06:22:22 +00:00
Reid Spencer 72aafa1d49 1. Have the ExecutionContext keep track of the APInt's allocated and
ensure they are cleaned up when the stack frame exits.
2. Move a function to the Execution.cpp file where it belongs.

llvm-svn: 34876
2007-03-03 06:19:55 +00:00
Nate Begeman 323cf8f602 http://llvm.org/bugs/show_bug.cgi?id=1237
llvm-svn: 34875
2007-03-03 06:18:18 +00:00
Reid Spencer 815f8dd225 Implement loading and storing of APInt values from memory.
llvm-svn: 34874
2007-03-03 06:18:03 +00:00
Reid Spencer 1a7d446963 Make getNumWords public so that those using getRawData stand a chance of
not reading beyond the end of the buffer returned.

llvm-svn: 34873
2007-03-03 06:17:23 +00:00
Reid Spencer 22c4fedabf Add names for some of the operators. This is needed for the macros in
the Interpreter.

llvm-svn: 34872
2007-03-03 05:37:23 +00:00
Nick Lewycky e6049c2f08 Emit low/high immediate loads properly for Linux/PPC.
llvm-svn: 34871
2007-03-03 05:29:51 +00:00
Chris Lattner da1d04a057 my recent change caused a failure in a bswap testcase, because it changed
the order that instcombine processed instructions in the testcase.  The end
result is that instcombine finished with:

define i16 @test1(i16 %a) {
        %tmp = zext i16 %a to i32               ; <i32> [#uses=2]
        %tmp21 = lshr i32 %tmp, 8               ; <i32> [#uses=1]
        %tmp5 = shl i32 %tmp, 8         ; <i32> [#uses=1]
        %tmp.upgrd.32 = or i32 %tmp21, %tmp5            ; <i32> [#uses=1]
        %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16           ; <i16> [#uses=1]
        ret i16 %tmp.upgrd.3
}

which can't get matched as a bswap.

This patch makes instcombine more sophisticated about removing truncating
casts, allowing it to turn this into:

define i16 @test2(i16 %a) {
        %tmp211 = lshr i16 %a, 8
        %tmp52 = shl i16 %a, 8
        %tmp.upgrd.323 = or i16 %tmp211, %tmp52
        ret i16 %tmp.upgrd.323
}

which then matches as bswap.  This fixes bswap.ll and implements
InstCombine/cast2.ll:test[12].  This also implements cast elimination of
add/sub.

llvm-svn: 34870
2007-03-03 05:27:34 +00:00
Chris Lattner 05e93d7f05 new testcase: instcombine should remove all the casts.
llvm-svn: 34869
2007-03-03 05:24:06 +00:00
Nick Lewycky db42295ff2 Translate bit operations to English.
llvm-svn: 34868
2007-03-03 03:14:40 +00:00
Chris Lattner c1991789c5 instcombine doesn't do CSE, simplify unrelated detail
llvm-svn: 34867
2007-03-03 02:27:02 +00:00
Evan Cheng 3fd728596e Watch out for cases like this:
entry (0x8b056f0, LLVM BB @0x8b01b30, ID#0):
Live Ins: %r0 %r1 %r2 %r3
        %reg1032 = tMOVrr %r3<kill>
        %reg1033 = tMOVri8 1
        %reg1034 = tMOVri8 0
        tCMPi8 %reg1029<kill>, 0
        tBcc mbb<entry,0x8b06a10>, 0
    Successors according to CFG: 0x8b06980 0x8b06a10

entry (0x8b06980, LLVM BB @0x8b01b30, ID#12):
    Predecessors according to CFG: 0x8b056f0
        %reg1036 = tMOVrr %reg1034<kill>
    Successors according to CFG: 0x8b06a10

entry (0x8b06a10, LLVM BB @0x8b01b30, ID#13):
    Predecessors according to CFG: 0x8b056f0 0x8b06980
        %reg1024<dead> = tMOVrr %reg1030<kill>
        ...

reg1030 and r1 have already been joined. When reg1024 and reg1030 are joined,
r1 live range from function entry to the tMOVrr instruction are dead. Eliminate
r1 from the livein set of the entry BB, not the BB where the copy is.

llvm-svn: 34866
2007-03-03 02:18:00 +00:00
Chris Lattner 960a543037 add a top-level iteration loop to instcombine. This means that it will never
finish without combining something it is capable of.

llvm-svn: 34865
2007-03-03 02:04:50 +00:00
Reid Spencer c34dedf686 APIntify this pass.
llvm-svn: 34863
2007-03-03 00:48:31 +00:00
Reid Spencer 3588ab15d1 Add isPositive for symmetry with isNegative.
llvm-svn: 34862
2007-03-03 00:24:39 +00:00
Reid Spencer 53a3739c80 Finally get this patch right :)
Replace expensive getZExtValue() == 0 calls with isZero() calls.

llvm-svn: 34861
2007-03-02 23:51:25 +00:00
Reid Spencer ba547cbb2a Dang, I've done that twice now! Undo previous commit.
llvm-svn: 34860
2007-03-02 23:37:53 +00:00
Reid Spencer 558990e189 Use more efficient test for one value in a ConstantInt.
llvm-svn: 34859
2007-03-02 23:35:28 +00:00
Reid Spencer 29fe20a98b Guard against huge loop trip counts in an APInt safe way.
llvm-svn: 34858
2007-03-02 23:31:34 +00:00
Evan Cheng deaea25eb9 X86-64 VACOPY needs custom expansion. va_list is a struct { i32, i32, i8*, i8* }.
llvm-svn: 34857
2007-03-02 23:16:35 +00:00
Reid Spencer dec03a08d6 Make sure debug code is not evaluated in non-debug case.
llvm-svn: 34856
2007-03-02 23:15:21 +00:00
Reid Spencer 1e102971d2 1. Sort switch cases using APInt safe comparison.
2. Make sure debug output of APInt values is safe for all bit widths.

llvm-svn: 34855
2007-03-02 23:05:28 +00:00
Reid Spencer 43376a74af Use APInt safe isOne() method on ConstantInt instead of getZExtValue()==1
llvm-svn: 34854
2007-03-02 23:03:17 +00:00
Reid Spencer bb38d79ad6 Make sorting of ConstantInt be APInt clean through use of ult function.
llvm-svn: 34853
2007-03-02 23:01:14 +00:00
Reid Spencer 1825dd0d7c Fix ashr for bitwidths > 64. This is now validated up to 1024 bits.
llvm-svn: 34852
2007-03-02 22:39:11 +00:00
Anton Korobeynikov e41e3fc74e Fix uninitialized use of variable. Remove tabs and fix identation.
llvm-svn: 34850
2007-03-02 22:19:41 +00:00
Anton Korobeynikov 57af2a4f3b Simplify things
llvm-svn: 34849
2007-03-02 21:50:27 +00:00
Chris Lattner b15e2b182f Fix a significant algorithm problem with the instcombine worklist. removing
a value from the worklist required scanning the entire worklist to remove all
entries.  We now use a combination map+vector to prevent duplicates from
happening and prevent the scan.  This speeds up instcombine on a large file
from the llvm-gcc bootstrap from 189.7s to 4.84s in a debug build and from
5.04s to 1.37s in a release build.

llvm-svn: 34848
2007-03-02 21:28:56 +00:00
Chris Lattner 51f5457ad4 minor cleanup
llvm-svn: 34846
2007-03-02 19:59:19 +00:00
Chris Lattner c3b68788bb Fix PR1234 by working around a compiler bug.
llvm-svn: 34845
2007-03-02 18:16:29 +00:00
Evan Cheng 155ede21e0 Mark dead def as unused.
llvm-svn: 34844
2007-03-02 10:43:16 +00:00
Evan Cheng 9d615d1e70 Dead live-in detection bug.
llvm-svn: 34843
2007-03-02 10:41:15 +00:00
Evan Cheng b7bef1bc74 Add a new test case.
llvm-svn: 34842
2007-03-02 10:37:19 +00:00
Evan Cheng 6605c5dbee - Keep track all def and uses of stack slot available in register.
- Available value use may be deleted (e.g. noop move).

llvm-svn: 34841
2007-03-02 08:52:00 +00:00
Chris Lattner 870055ef79 testcase for PR1233
llvm-svn: 34840
2007-03-02 07:29:59 +00:00
Evan Cheng 08f2f0d145 Invalidate last use of a reused register if the use is a deleted noop copy.
llvm-svn: 34839
2007-03-02 05:41:42 +00:00
Chris Lattner 9c7e5e365d argument lowering should copy from the vreg shadows of live-in arguments
passed in registers, not directly from the pregs themselves.

llvm-svn: 34838
2007-03-02 05:12:29 +00:00
Chris Lattner fc2f52128a add a note
llvm-svn: 34837
2007-03-02 05:04:52 +00:00
Owen Anderson a0d8da67c1 Fix a typo.
llvm-svn: 34836
2007-03-02 05:03:07 +00:00
Reid Spencer cf8175617d Use a better algorithm for rounding sqrt results. Change the FIXME about
this to a NOTE: because pari/gp results start to get rounded incorrectly
after 192 bits of precision. APInt and pari/gp never differ by more than
1, but APInt is more accurate because it does not lose precision after 192
bits as does pari/gp.

llvm-svn: 34834
2007-03-02 04:21:55 +00:00
Nick Lewycky cf87f9eef5 Implement unionWith.
llvm-svn: 34833
2007-03-02 03:33:05 +00:00
Chris Lattner 4bd8cda3f0 switch the inliner from being recursive to being iterative.
llvm-svn: 34832
2007-03-02 03:11:20 +00:00
Reid Spencer e1336b4086 Fix an unequal bitwidth issue.
llvm-svn: 34831
2007-03-02 02:59:25 +00:00
Chris Lattner 73f2825957 grammaro
llvm-svn: 34830
2007-03-02 02:57:34 +00:00
Evan Cheng 934405cf03 Make it 64-bit safe.
llvm-svn: 34829
2007-03-02 02:31:37 +00:00
Reid Spencer c44bdae16b Add a FIXME
llvm-svn: 34828
2007-03-02 02:01:34 +00:00
Reid Spencer 91643aa96f Fix a typo.
llvm-svn: 34826
2007-03-02 01:31:31 +00:00
Reid Spencer c442c84c8f Fix a problem where shifting by 64-bits leads to incorrect results on PPC
but not on X86 becuase shift by word size is "undefined".

llvm-svn: 34825
2007-03-02 01:19:42 +00:00
Dale Johannesen 32bc81341b eliminate unnecessary reset of SP in epilog on darwin
llvm-svn: 34824
2007-03-02 01:17:17 +00:00
Reid Spencer 197adfaa0a Reverse a premature commital.
llvm-svn: 34822
2007-03-02 00:31:39 +00:00
Reid Spencer 2e54a15943 Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
Constant::isNullValue() in situations where it is possible.

llvm-svn: 34821
2007-03-02 00:28:52 +00:00
Reid Spencer 3f770e4afd Add a non-virtual test for zero, isZero, and rename isUnitValue isOne.
These will be used in upcoming patches to avoid virtual function call when
the client knows it is a ConstantInt.

llvm-svn: 34820
2007-03-02 00:27:06 +00:00
Reid Spencer 76b2ce19fc Add an abs() function to get the absolute value.
llvm-svn: 34819
2007-03-01 23:37:09 +00:00
Reid Spencer 1b8dfcbaaa Combine two lines that can be.
llvm-svn: 34818
2007-03-01 23:30:25 +00:00
Reid Spencer 1700b52b8b Remove virtual keyword from method that doesn't need to be virtual.
llvm-svn: 34817
2007-03-01 23:20:52 +00:00
Reid Spencer caace8cffd Make it possible to create an SCEVUnknown from an APInt as well as an int.
llvm-svn: 34816
2007-03-01 22:28:51 +00:00
Reid Spencer fa63226751 Although probably not necessary, guard against a potential assertion by
using isNullValue() instead of getZExtValue() == 0.

llvm-svn: 34815
2007-03-01 21:54:37 +00:00
Reid Spencer 17797076ef Use isUnitValue() instead of getZExtValue() == 1 which will prevent an
assert if the ConstantInt's value is large.

llvm-svn: 34814
2007-03-01 21:51:23 +00:00
Reid Spencer 9c61acc450 Add an isUnitValue method for comparison against 1. This just follows a
common pattern with isNullValue, isAllOnesValue, etc. It also helps to
prevent things like getZExtValue() == 1, which could assert for large
bitwidths.

llvm-svn: 34813
2007-03-01 21:50:41 +00:00
Owen Anderson 90db545350 Use GCC intrinsics when available, and use smarter fallbacks when not.
llvm-svn: 34812
2007-03-01 21:16:30 +00:00
Reid Spencer bbd97b1edb Clarify the use of getValue/getSExtValue/getZExtValue and add the new
APInt constructor.

llvm-svn: 34811
2007-03-01 21:05:33 +00:00
Reid Spencer 5b0548de77 Use APInt conversion to string so the result is correct regardless of the
bit width of the ConstantInt being converted.

llvm-svn: 34810
2007-03-01 21:00:32 +00:00
Reid Spencer 07761199e0 Make output for ConstantInt construction correct for any bitwidth.
llvm-svn: 34809
2007-03-01 20:55:43 +00:00
Reid Spencer 4326cf5c51 Use the APInt versions of the bit-wise conversions of float/double to int
and back. While this is not strictly necessary, it does pave the way for
future changes in casting. It should now be possible to improve vector
casting to deal with un-equal fp/int sizes.

llvm-svn: 34808
2007-03-01 20:44:23 +00:00
Reid Spencer 022e05fdab Add doubleToBits and floatToBits methods.
llvm-svn: 34807
2007-03-01 20:39:01 +00:00
Reid Spencer a9e6e31db6 Use modern variable name. ConstantUnsignedInt is long since dead. No
functional change with this patch.

llvm-svn: 34806
2007-03-01 20:27:41 +00:00
Jim Laskey 82af5943d1 Emit eh filter info.
llvm-svn: 34805
2007-03-01 20:26:43 +00:00
Jim Laskey 6458e6acb9 Collect eh filter info.
llvm-svn: 34804
2007-03-01 20:25:32 +00:00
Reid Spencer fa80a0e8a2 Use a simpler constructor for ConstantInt.
llvm-svn: 34803
2007-03-01 20:25:31 +00:00
Jim Laskey d5453d7b56 Lower eh filter intrinsic.
llvm-svn: 34802
2007-03-01 20:24:30 +00:00
Jim Laskey 14c5842a91 Add eh filter intrinsic.
llvm-svn: 34801
2007-03-01 20:23:39 +00:00
Reid Spencer f762893b9b Add bitsToDouble and bitsToFloat methods for re-interpretation of bits as FP.
llvm-svn: 34800
2007-03-01 20:06:51 +00:00
Reid Spencer df30e2a68b Wrap a long line.
llvm-svn: 34799
2007-03-01 19:48:16 +00:00
Reid Spencer b973047147 Avoid a potential assert out if the loop increment is > 64 bits.
llvm-svn: 34798
2007-03-01 19:45:00 +00:00
Reid Spencer 8ad254df8c Regenerate.
llvm-svn: 34797
2007-03-01 19:41:47 +00:00
Reid Spencer 24f1a0e78f The 64-bit constructor for ConstantInt changes from int64_t to uint64_t.
This caused a warning for construction with -1. Avoid the warning by using
-1ULL instead.

llvm-svn: 34796
2007-03-01 19:33:52 +00:00
Reid Spencer fad3f247e4 Construct ConstantInt with simpler constructor.
llvm-svn: 34795
2007-03-01 19:32:33 +00:00
Reid Spencer 666ea0d046 Use a simpler constructor when constructing ConstantInt. Also, replace
verbose code to sext/trunc or zext/trunc and APInt with new methods on
that class.

llvm-svn: 34794
2007-03-01 19:32:01 +00:00
Reid Spencer a127633716 Use a simpler constructor when constructing ConstantInst.
llvm-svn: 34793
2007-03-01 19:31:12 +00:00
Reid Spencer d1bbfa5aa6 Drop the ConstantInt(const Type&, const APInt&) constructor. It is
redundant and more verbose than the ConstantInt(const APInt&) constructor.

llvm-svn: 34792
2007-03-01 19:30:34 +00:00
Reid Spencer 2f6ad4d3c3 Make the static table of results in sqrt const.
llvm-svn: 34791
2007-03-01 17:47:31 +00:00
Reid Spencer 6ba8edc789 Fix last night's 445.gobmk breakage which was caused by comparison of
APInt's of unequal bitwidth.

llvm-svn: 34790
2007-03-01 17:17:21 +00:00
Reid Spencer 742d1704e1 Add methods for bit width modification: sextOrTrunc, zextOrTrunc.
llvm-svn: 34789
2007-03-01 17:15:32 +00:00
Anton Korobeynikov af8be4458f Ensure that fastcall'ed function is correctly mangled & stack is
properly aligned

llvm-svn: 34788
2007-03-01 16:29:22 +00:00
Nicolas Geoffray 75ab9799df Implemented the frameaddress intrinsic for PPC.
llvm-svn: 34787
2007-03-01 13:11:38 +00:00
Evan Cheng 105fb1e0dd Delete register scavenger when done with it.
llvm-svn: 34786
2007-03-01 10:23:33 +00:00
Evan Cheng 2c0fd3ee4c Use a spilled free callee-saved register as scratch register.
llvm-svn: 34785
2007-03-01 08:57:52 +00:00
Evan Cheng 27bc565497 Add a version of FindUnusedReg that restrict search to a specific set of registers.
llvm-svn: 34784
2007-03-01 08:56:24 +00:00
Evan Cheng 6f059e3e0a - Track which callee-saved registers are spilled.
- Some code clean up.

llvm-svn: 34783
2007-03-01 08:26:31 +00:00
Reid Spencer 6a44033465 Remove the "isSigned" parameters from ConstantRange. It turns out they
are not needed as the results are the same with or without it.

Patch by Nicholas Lewycky.

llvm-svn: 34782
2007-03-01 07:54:15 +00:00