Commit Graph

39128 Commits

Author SHA1 Message Date
Dan Gohman
e4977cf750 Make structs and arrays first-class types, and add assembly
and bitcode support for the extractvalue and insertvalue
instructions and constant expressions.

Note that this does not yet include CodeGen support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 01:55:30 +00:00
Dan Gohman
8f8e269270 Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51467 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 01:52:21 +00:00
Bill Wendling
f3061f8210 Remove warnings about comparison between signed and unsigned expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 01:29:08 +00:00
Dale Johannesen
9bca583f9d Allow for switch with no cases. Was causing fault
in gcc.dg/pr27531-1.c.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 01:01:31 +00:00
Evan Cheng
b1938263c7 Bug: rcpps can only folds a load if the address is 16-byte aligned. Fixed many 'ps' load folding patterns in X86InstrSSE.td which are missing the proper alignment checks.
Also fixed some 80 col. violations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51462 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:37:07 +00:00
Dan Gohman
e4569943d9 Add more IR support for the new extractvalue and insertvalue
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:36:11 +00:00
Dan Gohman
4fa2a3f0ef Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:34:04 +00:00
Dan Gohman
399101a599 Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51459 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:17:26 +00:00
Dale Johannesen
bbcb34cafb Put const weak stuff in appropriate section on Darwin.
g++.dg/abi/key2.C



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51458 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:16:59 +00:00
Dale Johannesen
ed1ec3aa6b Make LTO expect common and weak to be represented differently.
Reading .bc files from before that change will no longer work.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51457 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:15:10 +00:00
Dan Gohman
31e5bdccf2 Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51456 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:12:03 +00:00
Evan Cheng
5bbaf01b84 X86CodeEmitter should not set PIC style to None at initialization time. This will break codegen if relocation model is changed to PIC_ later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51455 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 23:55:24 +00:00
Dan Gohman
b64aa119d8 Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51452 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 23:43:22 +00:00
Dan Gohman
890c31cfcc Add a polygen grammar definition for LLVM assembly language.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 22:45:03 +00:00
Dan Gohman
fdfef0da6b Recognize the "default" keyword, which is documented in LangRef.html
and supported in the grammar, in the lexer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51448 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 22:30:09 +00:00
Evan Cheng
d86323efc9 Add a couple of test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51441 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 21:19:19 +00:00
David Greene
abe93d95e8 When rewriting defs and uses after spilling, don't set the weight of a
live interval to infinity if the instruction being rewritten is an
original remat def instruction.  We were only checking against the clone
of the remat def which doesn't actually appear in the IR at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51440 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 21:16:33 +00:00
David Greene
cff860801e Don't attempt to update SpillSlotToUsesMap for stack slots that aren't
generated by the spiller.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51439 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 21:12:21 +00:00
Gabor Greif
785c6af979 transform more loops to iterator form, detabify
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51436 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 19:24:54 +00:00
Evan Cheng
c36c0ab44b Add missing patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 18:56:56 +00:00
Gabor Greif
b074f80d8e Suppress warnings about missing placement delete. This should now be std-conformant even if compiled with exceptions on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51429 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 13:16:42 +00:00
Gabor Greif
de2d74b213 Rewrite operand loops to use iterators. This shrinks .o file (at gcc4.0.1 -O3 x86) substantially (>500 bytes). Reason still unknown.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 06:43:33 +00:00
Chris Lattner
687a4cb295 fix an off-by-one error in my previous patch, don't treat the callee as a incoming arg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51422 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 06:29:38 +00:00
Chris Lattner
f6a048c3a8 Add support for multiple-return values in inline asm. This should
get inline asm working as well as it did previously with the CBE
with the new MRV support for inline asm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51420 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 06:19:37 +00:00
Chris Lattner
ea21ad4926 Fix PR2267, by allowing indirect outputs to be intermixed
with normal outputs.  Testcase here: 
test/CodeGen/X86/asm-indirect-mem.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 04:46:38 +00:00
Chris Lattner
9c287c2ab4 testcase for PR2267
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51408 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 04:45:22 +00:00
Chris Lattner
05a24e5efe Free and vaarg are not really volatile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 03:23:06 +00:00
Chris Lattner
19d9d4364e rewrite the validity checking for memory promotion to be simpler,
more aggressive, and more correct.  Verify that we only attempt to
promote loads and stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 03:22:42 +00:00
Chris Lattner
64a4c11e2f minor edits
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 03:06:14 +00:00
Chris Lattner
29d929363d Use 'continue' to reduce nesting in this loop. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51399 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 00:53:38 +00:00
Dan Gohman
ddc4ee82b5 Add a Type::isSingleValueType method. This will be used by code
that currently uses Type::isFirstClassType and depends on it
returning false for struct or array types.

This commit doesn't change the behavior of Type::isFirstClassType.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51396 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 23:35:53 +00:00
Evan Cheng
f4ea510371 Fix PR2343. An *interesting* coalescer bug.
BB1:                                                                                                                                                  
  vr1025 = copy vr1024                                                                                                                                
  ..                                                                                                                                                  
BB2:                                                                                                                                                  
  vr1024 = op                                                                                                                                         
         = op vr1025                                                                                                                                     
  <loop eventually branch back to BB1>

Even though vr1025 is copied from vr1024, it's not safe to coalesced them since live range of vr1025 intersects the def of vr1024. This happens when vr1025 is assigned the value of the previous iteration of vr1024 in the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 22:34:12 +00:00
Bill Wendling
40db5d4539 Follow-up to the reverting of r51218. This puts the checks out-of-line. Because
they aren't in the header file, systems with a <string> header file that isn't
64-bit clean shouldn't warn if #including Path.h and specifying
-Wshorten-64-to-32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51393 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 21:20:07 +00:00
Gabor Greif
0263140c9e update a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 18:57:33 +00:00
Gabor Greif
97e378e554 adapt to new API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51387 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 18:30:15 +00:00
Evan Cheng
03dace82f4 Rename -no-lazy to -disable-lazy-compilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51386 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 18:20:21 +00:00
Nate Begeman
f049e07eb8 Fix a couple issues with the JIT and multiple modules:
1. The "JITState" object creates a PassManager with the ModuleProvider that the
   jit is created with.  If the ModuleProvider is removed and deleted, the
   PassManager is invalid.

2. The Global maps in the JIT were not invalidated with a ModuleProvider was 
   removed.  This could lead to a case where the Module would be freed, and a 
   new Module with Globals at the same addresses could return invalid results.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 16:34:48 +00:00
Gabor Greif
a3f334362f resurrect lost tests by renaming them to not end with .tr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51375 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 14:48:24 +00:00
Gabor Greif
33e456d5f3 suppress gcc3.4.6's <no value returned> warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51372 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 14:07:30 +00:00
Dan Gohman
010ee2d955 When LSR is replacing an instruction, call
ScalarEvolution::deleteValueFromRecords on it before doing the
replaceAllUsesWith, because ScalarEvolution looks at the instruction's
users to find SCEV references to the instruction's SCEV object in its
internal maps.

Move all of LSR's loop-related state clearing after processing the loop
and before cleaning up dead PHI nodes. This eliminates all of LSR's SCEV
references just before the calls to ScalarEvolution::deleteValueFromRecords
so that when ScalarEvolution drops its own SCEV references, the reference
counts will reach zero and the SCEVs will be deleted immediately.

These changes fix some compiler aborts involving ScalarEvolution holding
onto and reusing SCEV objects for instructions that have been deleted.
No regression test unfortunately; because the symptoms were due to
dangling pointers, reduced testcases ended up being fairly arbitrary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-21 00:54:12 +00:00
Bill Wendling
55384a853c Reverting r51218 because of breakage on PPC32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51358 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 23:54:27 +00:00
Gabor Greif
5edf210bdf Eliminate questionable syntax for stdin redirection. This probably also speeds things up a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 22:07:21 +00:00
Chris Lattner
eb0fdc150a Fix PR2346 by marking vaarg as volatile so that licm doesn't try to
hoist them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51356 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 22:05:28 +00:00
Dan Gohman
7a9708b984 Oops, commit the version of this test that actually works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51351 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 21:19:36 +00:00
Dan Gohman
f35c8822a3 Port SelectionDAG's ComputeNumSignBits-using code to instcombine,
now that instcombine also has ComputeNumSignBits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51350 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 21:01:12 +00:00
Gabor Greif
f6cadc440c sabre brings to my attention that the 'tr' suffix is also obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 21:00:03 +00:00
Dan Gohman
c84941be0a Port the fix for the select operator from instcombine's
ComputeNumSignBits to SelectionDAG's ComputeNumSignBits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51348 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 20:59:51 +00:00
Dan Gohman
1fdfa6aabf Code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51345 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 20:56:33 +00:00
Chris Lattner
5568e94dbf Clarify that and/or/xor/sdiv etc all allow vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51335 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 20:48:21 +00:00
Chris Lattner
305915b8f6 Clarify copyright transfer when you don't own the copyright of
the contributed code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51329 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 20:06:53 +00:00