Commit Graph

1923 Commits

Author SHA1 Message Date
David Greene
4afc509b7f Implement a !subst operation simmilar to $(subst) in GNU make to do
def/var/string substitution on generic pattern templates.  For example:

def Type;
def v4f32 : Type;
def TYPE : Type;

class GenType<Type t> {
  let type = !(subst TYPE, v4f32, t);
}

def TheType : GenType<TYPE>;


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71801 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 21:54:42 +00:00
David Greene
e6c27de069 Implement !cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 21:22:49 +00:00
David Greene
d418c1b768 Operation Enhancements
Create an OpInit class to serve as a base for all operation Inits.

Move parsing of operation constructs to separate functions and reference
from multiple places.

Add some commented out new operations.  Coming soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 20:54:48 +00:00
David Greene
ccf85ded58 Fix PR4207.
If we're resolving a list element access and we're given a VarInit,
return a new VarListElementInit referencing the VarInit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71787 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-14 20:38:52 +00:00
Dale Johannesen
3b895cfac9 Slightly improve generated code in a degenerate case.
Should remove a warning from MSVC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71603 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-12 22:32:29 +00:00
Duncan Sands
777d2306b3 Rename PaddedSize to AllocSize, in the hope that this
will make it more obvious what it represents, and stop
it being confused with the StoreSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 07:06:46 +00:00
Chris Lattner
c89146587a Change 'make install' to install tblgen, for better support of out-of-tree targets,
patch by Mikael Lepistö!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 17:32:47 +00:00
Argyrios Kyrtzidis
cd76240f3d Move the tablegen-produced DebugLoc handling into a AsmWriter::processDebugLoc function.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 13:55:51 +00:00
Mikhail Glushenkov
e031e4bcb9 A better error message.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 04:54:23 +00:00
Mikhail Glushenkov
e89331b93d The 'forward_as' property did not use its second argument.
See PR4159 for details. Patch by Martin Nowack!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71054 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 01:41:19 +00:00
David Greene
065f259ff5 Allow multiclass def names to contain "#NAME"" where TableGen replaces
#NAME# with the name of the defm instantiating the multiclass.  This is
useful for AVX instruction naming where a "V" prefix is standard
throughout the ISA.  For example:

multiclass SSE_AVX_Inst<...> {
   def SS : Instr<...>;
   def SD : Instr<...>;
   def PS : Instr<...>;
   def PD : Instr<...>;

   def V#NAME#SS : Instr<...>;
   def V#NAME#SD : Instr<...>;
   def V#NAME#PS : Instr<...>;
   def V#NAME#PD : Instr<...>;
}

defm ADD : SSE_AVX_Inst<...>;

Results in 

ADDSS
ADDSD
ADDPS
ADDPD

VADDSS
VADDSD
VADDPS
VADDPD


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 16:28:25 +00:00
Mikhail Glushenkov
f868156820 Fix incorrect code generation with ENV.
See PR4157 for details. Patch by Martin Nowack!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70973 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 12:34:34 +00:00
Mike Stump
fe095f39e7 Restore minor deletion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 18:40:41 +00:00
Argyrios Kyrtzidis
a26eae64dd Make DebugLoc independent of DwarfWriter.
-Replace DebugLocTuple's Source ID with CompileUnit's GlobalVariable*
-Remove DwarfWriter::getOrCreateSourceID
-Make necessary changes for the above (fix callsites, etc.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 23:22:31 +00:00
Jakob Stoklund Olesen
7afcc6aa27 Slightly change TableGen's definition of a register subclass.
A subclass is allowed to have a larger spill size than the superclass, and the
spill alignment must be a multiple of the superclass alignment. This causes
the following new subclass relations:

=== Alpha ===
F4RC -> F8RC

=== PPC ===
F4RC -> F8RC

=== SPU ===
R8C -> R16C -> R32C/R32FP -> R64C/R64FP -> GPRC/VECREG

=== X86 ===
FR32  -> FR64  -> VR128
RFP32 -> RFP64 -> RFP80

These subclass relations are consistent with the behaviour of -join-cross-class-copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 21:22:44 +00:00
Bob Wilson
440548dd1f Rename the CurMultiClass formal parameter of TGParser::AddSubMultiClass
so that it doesn't shadow the instance variable of the same name.
Make the parameter names in method declarations match the definitions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70502 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 18:26:19 +00:00
Bob Wilson
1d512df4a9 Remove unnecessary "class" keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70499 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 17:46:20 +00:00
Bob Wilson
293b13350c Change forward declaration of MultiClass to use the "struct" keyword instead
of "class", so that it matches the subsequent definition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-30 17:35:11 +00:00
Bill Wendling
98a366d547 Instead of passing in an unsigned value for the optimization level, use an enum,
which better identifies what the optimization is doing. And is more flexible for
future uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 23:29:43 +00:00
Bill Wendling
be8cc2a3de Second attempt:
Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to
use the old behavior, the flag is -O0. This change allows for finer-grained
control over which optimizations are run at different -O levels.

Most of this work was pretty mechanical. The majority of the fixes came from
verifying that a "fast" variable wasn't used anymore. The JIT still uses a
"Fast" flag. I'll change the JIT with a follow-up patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-29 00:15:41 +00:00
Bob Wilson
32558650ae Fix trailing whitespace and 80-col. violations in recent TableGen changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 19:41:44 +00:00
Bill Wendling
c69d56f115 r70270 isn't ready yet. Back this out. Sorry for the noise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70275 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 01:04:53 +00:00
Bill Wendling
2e9d5f912a Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to
use the old behavior, the flag is -O0. This change allows for finer-grained
control over which optimizations are run at different -O levels.

Most of this work was pretty mechanical. The majority of the fixes came from
verifying that a "fast" variable wasn't used anymore. The JIT still uses a
"Fast" flag. I'm not 100% sure if it's necessary to change it there...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-28 00:21:31 +00:00
Nate Begeman
9008ca6b6b 2nd attempt, fixing SSE4.1 issues and implementing feedback from duncan.
PR2957

ISD::VECTOR_SHUFFLE now stores an array of integers representing the shuffle
mask internal to the node, rather than taking a BUILD_VECTOR of ConstantSDNodes
as the shuffle mask.  A value of -1 represents UNDEF.

In addition to eliminating the creation of illegal BUILD_VECTORS just to 
represent shuffle masks, we are better about canonicalizing the shuffle mask,
resulting in substantially better code for some classes of shuffles.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 18:41:29 +00:00
David Greene
d34a73b3b7 Fix multiclass inheritance to limit value resolution to new defs added
by base multiclasses.  Do not attempt to alter defs from previous base
multiclasses.  This fixes multiple multiclass inheritance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69974 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24 16:55:41 +00:00
Rafael Espindola
15684b2955 Revert 69952. Causes testsuite failures on linux x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69967 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24 12:40:33 +00:00
Nate Begeman
b706d29f9c PR2957
ISD::VECTOR_SHUFFLE now stores an array of integers representing the shuffle
mask internal to the node, rather than taking a BUILD_VECTOR of ConstantSDNodes
as the shuffle mask.  A value of -1 represents UNDEF.

In addition to eliminating the creation of illegal BUILD_VECTORS just to 
represent shuffle masks, we are better about canonicalizing the shuffle mask,
resulting in substantially better code for some classes of shuffles.

A clean up of x86 shuffle code, and some canonicalizing in DAGCombiner is next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-24 03:42:54 +00:00
David Greene
e8cf21e8e3 Make BinOps typed and require a type specifier for !nameconcat. This
allows binops to be used in typed contexts such as when passing
arguments to classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-23 21:25:15 +00:00
David Greene
5654613a01 Allow defm to inherit from multiple multiclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69832 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 22:17:51 +00:00
David Greene
c7cafcd815 Implement !nameconcat to concatenate strings and look up the resulting
name in the symbol table, returning an object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 20:18:10 +00:00
David Greene
de444af6bb Implement multiclass inheritance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 16:42:54 +00:00
Anton Korobeynikov
8d8fbf204d 'The "or die" is intended to catch the case where nm returned a
non-zero exit status, so nm will already have printed some error
messages.'

Patch by Jay Foad!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 16:04:14 +00:00
Evan Cheng
b306e38a2e One Mac OS X, just build with -O3 but without -fstrict-aliasing (which is kinda broken).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 22:16:40 +00:00
Mikhail Glushenkov
0941b0f655 Add some assertions.
Fixes segfaults in some corner cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 00:22:35 +00:00
Bob Wilson
1f595bb429 Use CallConvLower.h and TableGen descriptions of the calling conventions
for ARM.  Patch by Sandeep Patel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69371 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 19:07:39 +00:00
Bob Wilson
d305e707a6 Fix PR3994: LLVMMatchType arguments do not refer to absolute return value
and argument positions but only to the overloaded intrinsic parameters.
Keep a separate list of these overloaded parameters in CodeGenTarget.cpp
so they can be resolved easily.  Remove assertions from IntrinsicEmitter.cpp:
they were harmless but confusing, and the assertions elsewhere in TableGen
will catch any incorrect values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69316 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 21:51:05 +00:00
Chris Lattner
bfc0104c76 prove diagnostic -> group mapping information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 05:52:18 +00:00
Chris Lattner
9efac568f0 encode subgroups into the clang .inc file. -Wall now works!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 03:16:12 +00:00
Chris Lattner
d0d3494b2f start producing subgroup info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 00:53:25 +00:00
Chris Lattner
a0ed8ca233 make sure that empty diag groups get known by clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 22:33:02 +00:00
Chris Lattner
2f8c1d5fbc implement support for writing out diagnostic group tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69219 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 20:55:08 +00:00
Chris Lattner
9371c33611 use UppercaseString instead of EmitAllCaps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 20:16:12 +00:00
Chris Lattner
457cde4d45 use escape string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 20:13:18 +00:00
Chris Lattner
ac9e7da69c rename -gen-clang-diags-options -> -gen-clang-diag-groups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 20:02:32 +00:00
Chris Lattner
a71c494cd8 don't infer diag class from parenting relations, make it an explicit field
in the record.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 16:55:46 +00:00
Chris Lattner
5b66c04f33 include the default mapping in the clang diagnostic .inc files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 16:43:18 +00:00
Chris Lattner
f1624aa4dc minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69152 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 06:26:49 +00:00
Dan Gohman
88c7af096b Rename COPY_TO_SUBCLASS to COPY_TO_REGCLASS, and generalize
it accordingly. Thanks to Jakob Stoklund Olesen for pointing
out how this might be useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 21:06:25 +00:00
Dan Gohman
f8c7394781 Add a new TargetInstrInfo MachineInstr opcode, COPY_TO_SUBCLASS.
This will be used to replace things like X86's MOV32to32_.

Enhance ScheduleDAGSDNodesEmit to be more flexible and robust
in the presense of subregister superclasses and subclasses. It
can now cope with the definition of a virtual register being in
a subclass of a use.

Re-introduce the code for recording register superreg classes and
subreg classes. This is needed because when subreg extracts and
inserts get coalesced away, the virtual registers are left in
the correct subclass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 15:38:05 +00:00
Dan Gohman
8a17870da4 Generalize getRegisterClassForRegister to handle registers
in multiple classes in the case that the classes are all
in subset/superset relations. This function is used by the
fast-isel emitter, which always wants the super-most set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-13 15:24:11 +00:00