Commit Graph

25407 Commits

Author SHA1 Message Date
Duncan Sands
49c18cce97 Use DAG.getIntPtrConstant rather than DAG.getConstant
with TLI.getPointerTy for a small simplification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57837 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20 16:14:43 +00:00
Duncan Sands
7e49822875 Always use either MVT::i1 or getSetCCResultType for
the condition of a SELECT node.  Make sure that the
correct extension type (any-, sign- or zero-extend)
is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20 16:13:04 +00:00
Duncan Sands
ef5b199905 Formatting - no functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20 16:06:47 +00:00
Duncan Sands
f6e29499ac Don't use a random type for the select condition,
use an MVT::i1 and simplify the code while there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57833 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20 16:04:57 +00:00
Duncan Sands
ed294c46da Have X86 custom lowering for LegalizeTypes use
LowerOperation if it doesn't know what else to do.
This methods should probably be factorized some,
but this is good enough for the moment.  Have
LowerATOMIC_BINARY_64 use EXTRACT_ELEMENT rather
than assuming the operand is a BUILD_PAIR (if it
is then getNode will automagically simplify the
EXTRACT_ELEMENT).  This way LowerATOMIC_BINARY_64
usable from LegalizeTypes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57831 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20 15:56:33 +00:00
Bill Wendling
a1dc602542 Set N->OperandList to 0 after deletion. Otherwise, it's possible that it will
be either deleted or referenced afterwards.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57786 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-19 20:51:12 +00:00
Bill Wendling
181b627f62 Fix comment. Other formatting changes. No functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57785 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-19 20:34:04 +00:00
Duncan Sands
0e3da1def4 Vector shuffle mask elements may be "undef". Handle
this everywhere in LegalizeTypes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57783 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-19 15:00:25 +00:00
Duncan Sands
94989acaab Use a legal integer type for vector shuffle mask
elements.  Otherwise LegalizeTypes will, reasonably
enough, legalize the mask, which may result in it
no longer being a BUILD_VECTOR node (LegalizeDAG
simply ignores the legality or not of vector masks).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-19 14:58:05 +00:00
Chris Lattner
2a0b96c2c7 Reapply r57699 with a fix to not crash on asms with multiple results. Unlike
the previous patch this one actually passes make check.

"Fix PR2356 on PowerPC: if we have an input and output that are tied together
that have different sizes (e.g. i32 and i64) make sure to reserve registers for
the bigger operand."



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57771 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18 18:49:30 +00:00
Dan Gohman
668aff6623 Don't truncate GlobalAddress offsets to int in debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57770 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18 18:22:42 +00:00
Evan Cheng
4ed4329c37 By min, I mean max.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18 05:21:37 +00:00
Evan Cheng
99fe34b9b2 When creating intervals, leave min(1, numdefs) holes after each instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57765 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18 05:18:55 +00:00
Dan Gohman
6520e20e4f Teach DAGCombine to fold constant offsets into GlobalAddress nodes,
and add a TargetLowering hook for it to use to determine when this
is legal (i.e. not in PIC mode, etc.)

This allows instruction selection to emit folded constant offsets
in more cases, such as the included testcase, eliminating the need
for explicit arithmetic instructions.

This eliminates the need for the C++ code in X86ISelDAGToDAG.cpp
that attempted to achieve the same effect, but wasn't as effective.

Also, fix handling of offsets in GlobalAddressSDNodes in several
places, including changing GlobalAddressSDNode's offset from
int to int64_t.

The Mips, Alpha, Sparc, and CellSPU targets appear to be
unaware of GlobalAddress offsets currently, so set the hook to
false on those targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18 02:06:02 +00:00
Dan Gohman
95915730de Revert r57699. It's causing regressions in
test/CodeGen/X86/2008-09-17-inline-asm-1.ll
and a few others, and it breaks the llvm-gcc build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57747 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18 01:03:45 +00:00
Dan Gohman
cb747c558c This is now partly done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57734 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 21:39:27 +00:00
Dan Gohman
97b38270cf This is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57733 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 21:38:40 +00:00
Dan Gohman
c227734855 Factor out the code for mapping LLVM IR condition opcodes to
ISD condition opcodes into helper functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57726 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 21:16:08 +00:00
Evan Cheng
109a5626e7 Add implicit defs of XMM8 to XMM15 on 32-bit call instructions. While this is not technically true, it tells tblgen that these instructions "clobber" the entire XMM register file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57723 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 21:02:22 +00:00
Evan Cheng
af42fe36ac Fix PR2898. Spiller delete a store for reuse before it knows for sure the reuse happened.
Patch by Lang Hames!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57720 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 20:56:41 +00:00
Chris Lattner
cfc14c153a add support for 128 bit aggregates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57715 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 19:59:51 +00:00
Bill Wendling
a9f0cc4ced The Dwarf writer was comparing mangled and unmangled names for C++ code when we
have an unreachable block in a function. This was triggering the assert. This is
a horrid hack to cover this up.

Oh! for a good debug info architecture!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57714 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 18:48:57 +00:00
Mon P Wang
c4d1021ead Added MemIntrinsicNode which is useful to represent target intrinsics that
touches memory and need an associated MemOperand


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57712 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 18:22:58 +00:00
Dan Gohman
8c1a6ca22a Factor out the code for mapping LLVM IR condition opcodes to
ISD condition opcodes into helper functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57710 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 18:18:45 +00:00
Chris Lattner
1fa7198f36 add support for 128 bit inputs on both x86-64 and x86-32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57709 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 18:15:05 +00:00
Chris Lattner
3d0c4c4657 Fix a bug where the x86 backend would reject 64-bit r constraints when
in 32-bit mode instead of assigning a register pair.  This has nothing to
do with PR2356, but I happened to notice it while working on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57704 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 17:59:52 +00:00
Chris Lattner
0c52644cd8 Fix PR2356 on PowerPC: if we have an input and output that are tied together
that have different sizes (e.g. i32 and i64) make sure to reserve registers for
the bigger operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57699 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 17:52:49 +00:00
Evan Cheng
4b299d4ebd Fix lfence and mfence encoding. These look like MRM5r and MRM6r instructions except they do not have any operands. The RegModRM byte is encoded with register number 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57692 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 17:14:20 +00:00
Evan Cheng
244911bdee getX86RegNum has long been moved to X86RegisterInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57691 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 17:12:18 +00:00
Chris Lattner
81249c95ce refactor some code into a helper method, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57690 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 17:05:25 +00:00
Chris Lattner
6bdcda3d3e Keep track of *which* input constraint matches an output
constraint.  Reject asms where an output has multiple
input constraints tied to it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 16:47:46 +00:00
Chris Lattner
58f15c482a add an assert so that PR2356 explodes instead of running off an
array.  Improve some minor comments, refactor some helpers in
AsmOperandInfo.  No functionality change for valid code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57686 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 16:21:11 +00:00
Evan Cheng
6784598895 Fix a very subtle spiller bug: UpdateKills should not forget to track defs of aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57673 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 06:16:07 +00:00
Chris Lattner
abec474236 add some simple hacky long double support for the CBE. This
should work for intel long double, but ppc long double aborts
in convert.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57672 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 06:11:48 +00:00
Dan Gohman
63f97201dc Fun x86 encoding tricks: when adding an immediate value of 128,
use a SUB instruction instead of an ADD, because -128 can be
encoded in an 8-bit signed immediate field, while +128 can't be.
This avoids the need for a 32-bit immediate field in this case.

A similar optimization applies to 64-bit adds with 0x80000000,
with the 32-bit signed immediate field.

To support this, teach tablegen how to handle 64-bit constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57663 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 01:33:43 +00:00
Dan Gohman
74feef261a Define patterns for shld and shrd that match immediate
shift counts, and patterns that match dynamic shift counts
when the subtract is obscured by a truncate node.

Add DAGCombiner support for recognizing rotate patterns
when the shift counts are defined by truncate nodes.

Fix and simplify the code for commuting shld and shrd
instructions to work even when the given instruction doesn't
have a parent, and when the caller needs a new instruction.

These changes allow LLVM to use the shld, shrd, rol, and ror
instructions on x86 to replace equivalent code using two
shifts and an or in many more cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57662 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 01:23:35 +00:00
Dan Gohman
a1fcd77ccf Use 0 instead of false to return a null pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57660 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17 00:56:52 +00:00
Dan Gohman
f522068412 Trim #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57649 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 20:18:31 +00:00
Chris Lattner
cc4ba7834f fix typo noticed by sdt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57644 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 17:02:50 +00:00
Gabor Greif
023f84ecaf Introduce a typing refinenement on tagged data
using the 'volatile' qualifier. This should not have any operational consequences
on code, because tags should always be stripped off (giving a non-volatile pointer)
before dereferencing. The new qualification is there to catch some attempts to use
tagged pointers in a context where an untagged pointer is appropriate.

Notably this approach does not catch dereferencing of tagged pointers, but helps
in separating the two concepts a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57641 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 15:33:02 +00:00
Duncan Sands
e79f5ef4e7 Fix warnings about mb/me being potentially used
uninitialized in these functions with gcc-4.3.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57635 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 13:02:33 +00:00
Duncan Sands
ddbe5cbb10 Fix "large integer implicitly truncated to unsigned type"
warning on x86-64 with gcc-4.3.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57634 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 09:14:58 +00:00
Chris Lattner
a354825650 add some notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57631 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 07:04:06 +00:00
Chris Lattner
c74092ba8f add some notes and a file to collect unimplemented features in the
x86 backend.  These will all be answered with "patches welcome", so
a PR doesn't help drive them along.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57630 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 06:46:12 +00:00
Chris Lattner
0d5d05b553 mark some targets as experimental. Andrew, if you think that Alpha is
basically working, feel free to remove the tag.  The other targets have
really basic things that break them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57628 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 06:16:50 +00:00
Chris Lattner
d3745476de Verify prefetch arguments, PR2576.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57626 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 06:00:36 +00:00
Chris Lattner
868510328f apply Eli's patch for PR2165 and provide a testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57625 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 05:26:51 +00:00
Dan Gohman
8e8b8a223c Const-ify several TargetInstrInfo methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57622 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 01:49:15 +00:00
Dan Gohman
fcab2bd2f3 Remove an unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57621 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 01:47:47 +00:00
Dan Gohman
9a8af451a3 Fix Instruction::isIdenticalTo and isSameOperationAs to recognize
additional information in Loads, Stores, Calls, Invokes,
InsertValueInsts, and ExtractValueInsts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 01:24:45 +00:00
Dan Gohman
131161bc6e Rename AliasSet to SubRegs, to reflect changes in the surrounding code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57618 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 01:06:18 +00:00
Dan Gohman
7ddcadc7ee Move the include of MachineLocation.h into MachineModuleInfo.h
because it declares a std::vector<MachineMove>, and strict
concept checking requires the definition of MachineMove to be
available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57617 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 00:20:14 +00:00
Dan Gohman
b382c4dc23 Fix a subtle bug in DeadMachineInstructionElim's liveness
computation. A def of a register doesn't necessarily kill
live super-registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57614 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 00:11:23 +00:00
Dan Gohman
a7250ddc28 Fix the predicate for memop64 to be a regular load, not just
an unindexed load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57612 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-16 00:03:00 +00:00
Dan Gohman
2276a7bc8e Teach instcombine's visitLoad to scan back several instructions
to find opportunities for store-to-load forwarding or load CSE,
in the same way that visitStore scans back to do DSE. Also, define
a new helper function for testing whether the addresses of two
memory accesses are known to have the same value, and use it in
both visitStore and visitLoad.

These two changes allow instcombine to eliminate loads in code
produced by front-ends that frequently emit obviously redundant
addressing for memory references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57608 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 23:19:35 +00:00
Dan Gohman
95c2cc51eb Correct the name of isTrapping in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57606 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 22:56:21 +00:00
Anton Korobeynikov
d13726f1e9 Also properly handle linking of strong alias and weak global
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57595 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 20:10:50 +00:00
Anton Korobeynikov
e655e37032 Properly handle linking of strong alias with weak function, this fixes PR2883
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57594 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 20:10:08 +00:00
Dan Gohman
2b6c3d9ff1 Fix a missing space after the return type in invoke statements.
This fixes PR2894.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57589 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 18:02:08 +00:00
Chris Lattner
3b364cb986 move PR1941 here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 16:33:52 +00:00
Chris Lattner
db03983238 move PR1604 here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57582 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 16:06:03 +00:00
Chris Lattner
f4fee2a976 move PR1488 into this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57579 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 16:02:15 +00:00
Nuno Lopes
8a5f34776e regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57577 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 12:05:02 +00:00
Nuno Lopes
f2bd650fdf fix memleak in GetForwardRefForGlobal()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57576 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 12:04:36 +00:00
Nuno Lopes
f05ff66a22 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57575 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 11:20:21 +00:00
Nuno Lopes
ee87b3b6d9 fix memleak in getTypeVal()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57574 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 11:19:34 +00:00
Nuno Lopes
6ec8a25b27 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57573 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 11:11:12 +00:00
Nuno Lopes
0ecaf52796 fix memleak in ResolveTypeTo()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 11:10:21 +00:00
Dan Gohman
3358629380 Now that predicates can be composed, simplify several of
the predicates by extending simple predicates to create
more complex predicates instead of duplicating the logic
for the simple predicates.

This doesn't reduce much redundancy in DAGISelEmitter.cpp's
generated source yet; that will require improvements to
DAGISelEmitter.cpp's instruction sorting, to make it more
effectively group nodes with similar predicates together.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57565 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 06:50:19 +00:00
Chris Lattner
740e709d0d regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 06:16:57 +00:00
Chris Lattner
c7e3069bfa Fix the .ll grammar rules to allow any type before an 'i32', not just an
integer type.  Invalid things like 'float 42' are now rejected by the
semantic analysis in the productions not the parser.  This fixes PR2733.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 06:16:45 +00:00
Chris Lattner
f9078f99d9 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57559 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 06:03:48 +00:00
Chris Lattner
22b92e3b86 Eliminate the "IntType ::= INTTYPE" production, just use
INTTYPE everywhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57558 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 06:03:37 +00:00
Chris Lattner
b7fe708b32 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57557 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 05:53:25 +00:00
Chris Lattner
241ab47ac1 add support for folding immediates into stores when they
are due to argument passing in calls.  This is significant because
it hits all immediate arguments to calls on x86-32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57556 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 05:38:32 +00:00
Chris Lattner
438949aa9d fold immediates into stores in simple cases, this produces diffs like
this:

-	movl	$0, %eax
-	movl	%eax, _yy_n_chars
+	movl	$0, _yy_n_chars




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57555 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 05:30:52 +00:00
Chris Lattner
d53886bb48 fold compare of null pointer into compare with 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57553 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 05:18:04 +00:00
Chris Lattner
160f6cc209 Some minor cleanups:
1. Compute action in X86SelectSelect based on MVT instead of type.
2. Use TLI.getValueType(..) instead of MVT::getVT(..) because the former
   handles pointers and the later doesn't.
3. Don't pass TLI into isTypeLegal, since it already has access to it as 
   an ivar.

#2 gives fast isel some minor new functionality: handling load/stores of
pointers.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57552 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 05:07:36 +00:00
Chris Lattner
45ac17f521 Use switch on VT instead of Type* comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57551 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 04:32:45 +00:00
Chris Lattner
51ccb3deba Use X86FastEmitCompare for FCMP_OEQ and FCMP_UNE: it doesn't
change the generated code, but makes the code simpler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57550 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 04:29:23 +00:00
Chris Lattner
9a08a61d79 refactor compare emission out into a new X86FastEmitCompare method,
which makes it easy to share the compare/imm folding logic with 'setcc'.
This shaves a bunch of instructions off the common select case, which
happens a lot in llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57549 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 04:26:38 +00:00
Chris Lattner
0e13c78347 Fold immediates into compares when possible, producing "cmp $4, %eax" instead of
loading 4 into a register and then doing the compare.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57548 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 04:13:29 +00:00
Chris Lattner
709d829d3c more minor refactoring of X86SelectBranch, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57547 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 04:02:26 +00:00
Chris Lattner
871d246fd4 factor buildmi calls in X86SelectBranch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57546 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 03:58:05 +00:00
Chris Lattner
8aeeeb9d24 factor some more BuildMI's in X86SelectCmp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57545 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 03:52:54 +00:00
Chris Lattner
54aebde0be factor some BuildMI calls, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 03:47:17 +00:00
Dan Gohman
26367472a2 Adjust whitespace in debug messages to be more consistent
with other debug messages.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57543 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 02:57:38 +00:00
Evan Cheng
7f04268176 - Add target lowering hooks that specify which setcc conditions are illegal,
i.e. conditions that cannot be checked with a single instruction. For example,
SETONE and SETUEQ on x86.
- Teach legalizer to implement *illegal* setcc as a and / or of a number of
legal setcc nodes. For now, only implement FP conditions. e.g. SETONE is
implemented as SETO & SETNE, SETUEQ is SETUO | SETEQ.
- Move x86 target over.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57542 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 02:05:31 +00:00
Dan Gohman
dd5b58ad7b FastISel support for exception-handling constructs.
- Move the EH landing-pad code and adjust it so that it works
   with FastISel as well as with SDISel.
 - Add FastISel support for @llvm.eh.exception and
   @llvm.eh.selector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57539 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 23:54:11 +00:00
Daniel Dunbar
76dea9547d Prevent assert when using '"' in names (via hexadecimal).
Update LangRef to mention \xx quoting in names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 23:51:43 +00:00
Daniel Dunbar
cad3580e99 Change getLLVMName to use raw_ostream & PrintLLVMName.
- Avoids duplicated quotification code.
 - Remove QuoteNameIfNeeded.
 - No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57537 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 23:28:09 +00:00
Dale Johannesen
2194d46624 Accept -march=i586, because gcc does (a synonym
for pentium).  Fixes
gcc.target/i386/20000720-1.c
gcc.target/i386/pr26826.c



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57528 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 22:06:33 +00:00
Evan Cheng
0329466b6b Rename LoadX to LoadExt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57526 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 21:26:46 +00:00
Jim Grosbach
2642196a65 Update ARM Insn encoding to get endian-ness to match the documentation (31-0 left to right)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 20:36:24 +00:00
Dan Gohman
b8cab9227a Fix command-line option printing to print two spaces where needed,
instead of requiring all "short description" strings to begin with
two spaces. This makes these strings less mysterious, and it fixes
some cases where short description strings mistakenly did not
begin with two spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 20:25:08 +00:00
Evan Cheng
403006205f Combine (fcmp cc0 x, y) | (fcmp cc1 x, y) into a single fcmp when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 18:44:08 +00:00
Evan Cheng
4990b257dd - Somehow I forgot about one / une.
- Renumber fcmp predicates to match their icmp counterparts.
- Try swapping operands to expose more optimization opportunities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 18:13:38 +00:00
Evan Cheng
552e3be775 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57508 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 17:15:39 +00:00
Evan Cheng
8db90725cb Optimize anding of two fcmp into a single fcmp if the operands are the same. e.g. uno && ueq -> ueq
ord && olt -> olt
     ord && ueq -> oeq


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57507 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 17:15:11 +00:00
Nuno Lopes
c8ed902298 little optimization: reuse getPointerToGlobalIfAvailable(CGV) value in emitGlobals()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57484 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 10:04:52 +00:00