Commit Graph

35187 Commits

Author SHA1 Message Date
Jay Foad bcbdbfb345 Fix http://llvm.org/PR6028, an assertion failure when an UndefValue of
integer type is used.

llvm-svn: 93509
2010-01-15 08:32:58 +00:00
Bob Wilson 1a234c0aee Change pre-regalloc tail duplication to only duplicate indirect branch blocks.
The pre-regalloc pass caused some regressions in both compile time and
performance of the generated code, and it did not improve performance, except
for indirect branches.  I also moved the check for single-block loops to speed
up the common case when running the taildup pass before reg allocation.

llvm-svn: 93505
2010-01-15 06:29:17 +00:00
Victor Hernandez 5d6551816b Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.

llvm-svn: 93504
2010-01-15 03:37:48 +00:00
Dale Johannesen 0e7e55da1d Lower FrameIndex operand of DEBUG_VALUE (specially) and
print it as a comment on X86.

llvm-svn: 93499
2010-01-15 01:54:55 +00:00
Anton Korobeynikov cefa7addc8 Fix cmp emission on msp430: we definitely should turn stuff like
"icmp lhs, rhs" into "cmp rhs, lhs". This should fix PR5979.

llvm-svn: 93496
2010-01-15 01:29:49 +00:00
Devang Patel 89880c8224 Do not use AT_specification die for static variables. It confuses gdb.
llvm-svn: 93494
2010-01-15 01:12:22 +00:00
Jim Grosbach 4f1b0ded75 fix 80-column violations
llvm-svn: 93487
2010-01-15 00:36:15 +00:00
Jim Grosbach 2e3abd7e82 Fix 80 column violations and clean up whitespace
llvm-svn: 93484
2010-01-15 00:32:47 +00:00
Devang Patel 2108ee075f Do not emit multiple AT_container_type attributes.
We need to find a better way to emit this info.

llvm-svn: 93481
2010-01-15 00:26:31 +00:00
Jim Grosbach 029fbd984b Name change for consistency. No functional change.
llvm-svn: 93480
2010-01-15 00:22:18 +00:00
Jim Grosbach d0860d6e02 EmitAtomicCmpSwap() custome inserter needs to delete the MI passed in. EmitAtomicBinary() already does this.
llvm-svn: 93479
2010-01-15 00:18:34 +00:00
Jeffrey Yasskin 3aa70b2c4f Teach PPC how to replaceMachineCodeForFunction correctly. (Fixes
JITTest.FunctionIsRecompiledAndRelinked.)

llvm-svn: 93475
2010-01-14 23:15:26 +00:00
Eric Christopher f567e1b426 Pad my commit stats by reducing indentation in this now separate
commit.

llvm-svn: 93473
2010-01-14 23:00:10 +00:00
Johnny Chen 0f45f4f849 Added 16-bit Thumb Load/Store immediate instructions with encoding bits so that
the disassembler can properly decode Load/Store register/immediate instructions.

llvm-svn: 93471
2010-01-14 22:42:17 +00:00
Chris Lattner f29c0b6880 Split the TargetAsmParser "ParseInstruction" interface in half:
the new ParseInstruction method just parses and returns a list of
target operands.  A new MatchInstruction interface is used to
turn the operand list into an MCInst.

This requires new/deleting all the operands, but it also gives 
targets the ability to use polymorphic operands if they want to. 

llvm-svn: 93469
2010-01-14 22:21:20 +00:00
Anton Korobeynikov abf4ef0ee1 Remove pseudo-MI in custom inserter.
llvm-svn: 93467
2010-01-14 22:09:11 +00:00
Dale Johannesen b297cdd937 Fix a comment.
llvm-svn: 93463
2010-01-14 21:50:17 +00:00
Eric Christopher 35dd9e8e1d Few minor changes that were requested. No functional change.
llvm-svn: 93462
2010-01-14 21:48:00 +00:00
Jim Grosbach 9ae81816bc Add comment explaining the necessity of r93456
llvm-svn: 93459
2010-01-14 21:38:31 +00:00
Chris Lattner 77fd677111 prune #includes in TargetAsmParser.h
Pass in SMLoc of instr opcode into ParseInstruction.
Make AsmToken be a class, not a struct.

llvm-svn: 93457
2010-01-14 21:32:45 +00:00
Jim Grosbach 0868567fc3 Dwarf EH prepare needs to be run after SjLj prepare. Otherwise,
catch info can get misplaced when a selector ends up more than one block
removed from the parent invoke(s). This could happen when a landing pad is
shared by multiple invokes and is also a target of a normal edge from
elsewhere.

llvm-svn: 93456
2010-01-14 21:22:16 +00:00
Chris Lattner ecc8eece7d introduce MCParsedAsmOperand
llvm-svn: 93455
2010-01-14 21:21:40 +00:00
Chris Lattner 872501b6e0 introduce the MCParsedAsmOperand class.
llvm-svn: 93454
2010-01-14 21:20:55 +00:00
Evan Cheng 8e670ee381 Small tweak to inline cost computation. Ext of i/fcmp results are mostly optimized away in codegen.
llvm-svn: 93453
2010-01-14 21:04:31 +00:00
Anton Korobeynikov 105682dc96 Remove spurious semicolon.
Patch by Diego Iastrubni!

llvm-svn: 93450
2010-01-14 20:19:51 +00:00
Victor Hernandez 8296da7b56 In debug builds, assert that function-local metadata has only 1 parent function
llvm-svn: 93449
2010-01-14 20:12:34 +00:00
Eric Christopher f3ac066418 Reduce the inlining cost of functions that contain calls to easily,
and frequently optimized functions.

llvm-svn: 93448
2010-01-14 20:12:34 +00:00
Victor Hernandez 572218b53b Simplify code that chooses when to enumerate function-local metadata operands
llvm-svn: 93446
2010-01-14 19:54:11 +00:00
Victor Hernandez 36aee30dfb Avoid modifying ValueEnumerator's MD ValueList by choosing which function-local MD to write based on the function currently being written
llvm-svn: 93441
2010-01-14 19:38:44 +00:00
Jakob Stoklund Olesen 0ca14e4498 ARM "l" constraint for inline asm means R0-R7, also for Thumb2.
This is consistent with llvm-gcc's arm/constraints.md.

Certain instructions (e.g. CBZ, CBNZ) require a low register, even in Thumb2
mode.

llvm-svn: 93436
2010-01-14 18:19:56 +00:00
Dan Gohman dd5286dc63 Fix a codegen abort seen in 483.xalancbmk.
llvm-svn: 93417
2010-01-14 03:08:49 +00:00
Victor Hernandez 6c730dea6f In WriteFunction(), write function-local metadata before we write the instructions, so instruction's references to metadata are fully resolved by the time they get written.
llvm-svn: 93403
2010-01-14 01:50:08 +00:00
Victor Hernandez 61e6e829c6 Fix printing of function-local metadata in AsmWriter
llvm-svn: 93402
2010-01-14 01:47:37 +00:00
Victor Hernandez b816154268 Clean up unnecessary return and brackets
llvm-svn: 93401
2010-01-14 01:46:02 +00:00
Victor Hernandez 8c85e25589 Add MDNode::getFunction(), which figures out the metadata's function, if it has function that it is local to.
llvm-svn: 93400
2010-01-14 01:45:14 +00:00
Jakob Stoklund Olesen bff090648b Don't fold insufficiently aligned ldr/str into ldm/stm instructions.
An unaligned ldr causes a trap, and is then emulated by the kernel with
awesome performance. The darwin kernel does not emulate unaligned ldm/stm
Thumb2 instructions, so don't generate them.

This fixes the miscompilation of Multisource/Applications/JM/lencod for Thumb2.

Generating unaligned ldr/str pairs from a 16-bit aligned memcpy is probably
also a bad idea, but that is beyond the scope of this patch.

llvm-svn: 93393
2010-01-14 00:54:10 +00:00
Chris Lattner 3eb76c23dd this is an SSE-specific issue.
llvm-svn: 93373
2010-01-13 23:29:11 +00:00
Chris Lattner fb534d97b5 X86 if conversion + tail merging issues from PR6032.
llvm-svn: 93372
2010-01-13 23:28:40 +00:00
Bill Wendling ad7a5b07a7 When the visitSub method was split into visitSub and visitFSub, this xform was
added to the FSub version. However, the original version of this xform guarded
against doing this for floating point (!Op0->getType()->isFPOrFPVector()).

This is causing LLVM to perform incorrect xforms for code like:

void func(double *rhi, double *rlo, double xh, double xl, double yh, double yl){
  double mh, ml;
  double c = 134217729.0;
  double up, u1, u2, vp, v1, v2;
        
  up = xh*c;
  u1 = (xh - up) + up;
  u2 = xh - u1;
        
  vp = yh*c;
  v1 = (yh - vp) + vp;
  v2 = yh - v1;
        
  mh = xh*yh;
  ml = (((u1*v1 - mh) + (u1*v2)) + (u2*v1)) + (u2*v2);
  ml += xh*yl + xl*yh;
        
  *rhi = mh + ml;
  *rlo = (mh - (*rhi)) + ml;
}

The last line was optimized away, but rl is intended to be the difference
between the infinitely precise result of mh + ml and after it has been rounded
to double precision.

llvm-svn: 93369
2010-01-13 23:23:17 +00:00
Chris Lattner ccbeed2af4 fix ELF section mangling stuff for weak symbols to not use
obsolete Mangler interfaces.

llvm-svn: 93356
2010-01-13 21:29:21 +00:00
Victor Hernandez 9c203e362a Fix comment typo
llvm-svn: 93355
2010-01-13 21:25:04 +00:00
Chris Lattner b9d1f5a006 tidy
llvm-svn: 93352
2010-01-13 21:21:29 +00:00
Chris Lattner 51d6cc4bdb reduce duplicate mangling logic by using MCSymbol::printMangledName.
llvm-svn: 93351
2010-01-13 21:12:34 +00:00
Chris Lattner 8361006264 expose a static function as a static method on the MCSymbol class.
llvm-svn: 93350
2010-01-13 21:09:59 +00:00
Johnny Chen b34888b6d0 Fixed a couple of places for Thumb MOV where encoding bits are underspecified.
llvm-svn: 93349
2010-01-13 21:00:26 +00:00
Jakob Stoklund Olesen fcf91ee403 Fix pasto
llvm-svn: 93342
2010-01-13 19:54:39 +00:00
Chris Lattner c5b7dcf552 stop the CBE from using deprecated Mangler stuff.
llvm-svn: 93341
2010-01-13 19:54:07 +00:00
Victor Hernandez b00a6beef6 Write function-local metadata as a metadata subblock of a funciton block
llvm-svn: 93339
2010-01-13 19:37:33 +00:00
Victor Hernandez cad7328d8c Enumerate function-local metadata (and its types and operands) only during function-incorporation, global metadata continues to be enumerated during creation of ValueEnumerator
llvm-svn: 93338
2010-01-13 19:36:16 +00:00
Victor Hernandez 108d3acb43 Parse function-local metadata inside function blocks
llvm-svn: 93337
2010-01-13 19:34:08 +00:00