Commit Graph

46159 Commits

Author SHA1 Message Date
Daniel Dunbar e49df9b58f Change CodeGenModule GlobalDeclMap to directly reference globals
instead of mapping the decl to a bitcast of the global to the correct
type.
 
 - GetAddrOf{Function,GlobalVar} introduce the bitcast on every use now.

 - This solves a problem where a dangling pointer could be introduced
   by the RAUW done when replacing a forward or tentative
   definition. See testcase for more details.

 - Fixes <rdar://problem/6108358>

llvm-svn: 54211
2008-07-30 16:32:24 +00:00
Matthijs Kooijman be31571ca5 Document BasicBlock::Create.
llvm-svn: 54210
2008-07-30 12:53:14 +00:00
Matthijs Kooijman ca4ffaabcd Not that using stream headers other than iostream is allowed.
llvm-svn: 54209
2008-07-30 12:14:10 +00:00
Mon P Wang 2c839d4b1e Added support for overloading intrinsics (atomics) based on pointers
to different address spaces.  This alters the naming scheme for those
intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32

llvm-svn: 54195
2008-07-30 04:36:53 +00:00
Eli Friedman 4736916aa6 Another SCEV issue from PR2607; essentially the same issue, but this
time applying to the implicit comparison in smin expressions. The 
correct way to transform an inequality into the opposite 
inequality, either signed or unsigned, is with a not expression.

I looked through the SCEV code, and I don't think there are any more 
occurrences of this issue.

llvm-svn: 54194
2008-07-30 04:36:32 +00:00
Owen Anderson e9a0bae238 More fixes for corner cases when remapping live range indices.
llvm-svn: 54186
2008-07-30 00:22:56 +00:00
Owen Anderson 1aebe49ae7 When merging live intervals, we also need to merge in any live ranges that are inputs to two-address instructions
that themselves define a range we already care about.

llvm-svn: 54185
2008-07-30 00:21:16 +00:00
Eli Friedman 5ae90441c4 Fix for PR2607: SCEV miscomputing the loop count for loops with an
SGT exit condition.  Essentially, the correct way to flip an inequality 
in 2's complement is the not operator, not the negation operator.  
That said, the difference only affects cases involving INT_MIN.

Also, enhance the pre-test search logic to be a bit smarter about 
inequalities flipped with a not operator, so it can eliminate the smax 
from the iteration count for simple loops.

llvm-svn: 54184
2008-07-30 00:04:08 +00:00
Ted Kremenek 8cf5045012 Fix regression in range highlighting in HTML output.
llvm-svn: 54181
2008-07-29 23:35:38 +00:00
Daniel Dunbar 9c426524f8 Rework codegen emission of globals
- No (intended) functionality change.

 - Primary purpose is to clearly separate (lazy) construction of
   globals that are a forward declaration or tentative definition from
   those that are the final definition.

 - Lazy construction is now encapsulated in
   GetAddrOf{Function,GlobalVar} while final definitions are
   constructed in EmitGlobal{Function,Var}Definition.
 
 - External interface for dealing with globals is now limited to
   EmitGlobal and GetAddrOf{Function,GlobalVar}.

 - Also updated helper functions dealing with statics, annotations,
   and ctors to be private.

llvm-svn: 54179
2008-07-29 23:18:29 +00:00
Owen Anderson 6b1cc46fee When merging a PHI operand's live interval into the PHI's live interval, we need to merge over all liveranges in
the operand's interval that share the relevant value number, not just the range that immediately precedes the PHI.

llvm-svn: 54174
2008-07-29 21:17:08 +00:00
Owen Anderson 2532e75933 Don't decrement the BB remap when we don't need to.
llvm-svn: 54173
2008-07-29 21:15:44 +00:00
Duncan Sands fa4120530e Fix PR2609. If a label is deleted, then it needs
to be marked invalid regardless of whether it is
a debug, an exception handling or (hopefully) a
GC label.

llvm-svn: 54172
2008-07-29 20:56:02 +00:00
Bruno Cardoso Lopes 2a24157364 Changed some methods order.
llvm-svn: 54169
2008-07-29 19:29:50 +00:00
Nate Begeman 82f1925708 Fix broken CellSPU lowering, re-instate braces in Legalize
llvm-svn: 54168
2008-07-29 19:07:27 +00:00
Bruno Cardoso Lopes e683bbabc7 Added floating point lowering for select.
llvm-svn: 54167
2008-07-29 19:05:28 +00:00
Duncan Sands 078791bab3 Set the executable bit - means it can actually
be run when installing on sparc sun.  Set the
mime type to text/x-sh while there.

llvm-svn: 54165
2008-07-29 18:31:42 +00:00
Nate Begeman d63495ff25 Disable a fix in the previous patch, since it breaks CellSPU.
The CellSPU codegen is broken, but needs to be fixed before we can
put this back in.

llvm-svn: 54164
2008-07-29 18:28:31 +00:00
Steve Naroff 873bd8497a Fix incomplete implementation for rewriting protocol refs.
<rdar://problem/6108127> clang ObjC rewriter: no translation of id <proto>

llvm-svn: 54163
2008-07-29 18:15:38 +00:00
Daniel Dunbar 837fd272f8 Fix codegen of chained declarations
- Killed useless CodeGenModule::EmitGlobalVarDeclarator, instead just
   recurse on any ScopedDecl.
 - Fix for <rdar://problem/6093838>

llvm-svn: 54162
2008-07-29 17:47:36 +00:00
Nate Begeman fecbc8cff1 Add vector shifts to the IR, patch by Eli Friedman.
CodeGen & Clang work coming next.

llvm-svn: 54161
2008-07-29 15:49:41 +00:00
Matthijs Kooijman 98b5c16e3b Add -unroll-allow-partial command line option that enabled the loop unroller to
partially unroll a loop when fully unrolling would not fit under the threshold.

Patch by Mikael Lepistö.

llvm-svn: 54160
2008-07-29 13:21:23 +00:00
Matthijs Kooijman fd3070459b Restructure ArgumentPromotion a bit. Instead of just having a single boolean
that says "unconditional loads from this argument are safe", we now keep track
of the safety per set of indices from which loads happen. This prevents
ArgPromotion from promoting loads that aren't really valid. As an added effect,
this will now disregard the the type of the indices passed to a GEP, so
"load GEP %A, i32 1" and "load GEP %A, i64 1" will result in a single argument,
not two.

This fixes PR2598, for which a testcase has been added as well.

llvm-svn: 54159
2008-07-29 10:00:13 +00:00
Matthijs Kooijman 3d5d6f90e0 Improve bugpoint output a bit by outputting the actual instructions instead of
just it's name, which is often empty. Also remove a newline from the output
that wasn't really needed.

llvm-svn: 54158
2008-07-29 08:55:30 +00:00
Matthijs Kooijman 0446862796 Add a GetElementPtrInst::getIndexedType that accepts uint64_t's instead of just Value*'s.
llvm-svn: 54157
2008-07-29 08:46:11 +00:00
Evan Cheng bf83579b30 Fix for PR2578. Do not split off a block whose size is less than FreeRangeHeader::getMinBlockSize(). Patch by Damien.
llvm-svn: 54152
2008-07-29 07:38:32 +00:00
Chris Lattner 373351725f add a crazy idea
llvm-svn: 54151
2008-07-29 03:46:33 +00:00
Dan Gohman 43105328d3 Revert 54147.
llvm-svn: 54148
2008-07-29 01:02:18 +00:00
Dan Gohman 26ec56c75c Add x86 isel patterns to match what would be a ZERO_EXTEND_INREG operation,
which is represented in codegen as an 'and' operation. This matches them
with movz instructions, instead of leaving them to be matched by and
instructions with an immediate field.

llvm-svn: 54147
2008-07-28 22:18:25 +00:00
Dan Gohman 804c95df52 Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.

Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.

Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.

llvm-svn: 54146
2008-07-28 21:51:04 +00:00
Owen Anderson 813bf7af7f Don't remove volatile loads. Thanks to Duncan for noticing this one.
llvm-svn: 54144
2008-07-28 20:52:42 +00:00
Bill Wendling c5d24d64cf Remove extra lines
llvm-svn: 54143
2008-07-28 20:50:25 +00:00
Bruno Cardoso Lopes 98bda587e1 Disable gp_rel relocation for constant pools access for now.
llvm-svn: 54142
2008-07-28 19:26:25 +00:00
Duncan Sands 87c83704d3 Since build_vector is a variadic node, the number
of operands should be -1 not 0.

llvm-svn: 54141
2008-07-28 19:17:21 +00:00
Duncan Sands b6bc41a0ba This is not a binary file.
llvm-svn: 54140
2008-07-28 19:16:31 +00:00
Bruno Cardoso Lopes bcaf6e5243 Added floating point lowering for setcc and brcond.
Fixed COMM asm directive usage.
ConstantPool using custom FourByteConstantSection.

llvm-svn: 54139
2008-07-28 19:11:24 +00:00
Duncan Sands ced7c7220e Test this differently: I saw this test fail
because opt exited while llvm-as was still
writing to the pipe, causing it to get a
SIGPIPE.  It seems best to change things to
avoid the race altogether.

llvm-svn: 54138
2008-07-28 19:09:01 +00:00
Bill Wendling ac3cf6657b Don't build with 4.0.
llvm-svn: 54137
2008-07-28 18:45:36 +00:00
Dan Gohman 24b3ce1db6 Fix a typo in a comment.
llvm-svn: 54136
2008-07-28 18:43:51 +00:00
Dan Gohman 42912d1a1e Reword a comment to be less ambiguous.
llvm-svn: 54135
2008-07-28 18:42:57 +00:00
Dan Gohman c9fe8b64ed Fix a bashism in TestRunner.sh.
llvm-svn: 54134
2008-07-28 18:41:03 +00:00
Owen Anderson 3f3389745d Add support for eliminating stores that store the same value that was just loaded.
This fixes PR2599.

llvm-svn: 54133
2008-07-28 16:14:26 +00:00
Owen Anderson d70cf1d5ae Fix a subtle bug when removing instructions from memdep. In very specific
circumstances we could end up remapping a dependee to the same instruction 
that we're trying to remove.  Handle this properly by just falling back to
a conservative solution.

llvm-svn: 54132
2008-07-28 16:00:58 +00:00
Bill Wendling d4c8cbd776 Remove <iostream> include.
llvm-svn: 54131
2008-07-27 23:18:30 +00:00
Dan Gohman 41a0f71c05 Don't use reinterpret_cast when it isn't needed.
llvm-svn: 54130
2008-07-27 23:12:19 +00:00
Dan Gohman 68e45a361b Make the ScheduleDAG's GraphRoot edge be blue and dashed too, like
the SelectionDAG's.

llvm-svn: 54129
2008-07-27 22:46:49 +00:00
Dan Gohman 2ce6f2ad5e Rename SDOperand to SDValue.
llvm-svn: 54128
2008-07-27 21:46:04 +00:00
Dan Gohman 91e5dcb680 Tidy SDNode::use_iterator, and complete the transition to have it
parallel its analogue, Value::value_use_iterator. The operator* method
now returns the user, rather than the use.

llvm-svn: 54127
2008-07-27 20:43:25 +00:00
Dan Gohman 108c58aef4 Fix embedded CRLF characters.
llvm-svn: 54125
2008-07-27 18:37:58 +00:00
Dan Gohman bb5f43ed4d Rename isOnlyUseOf to isOnlyUserOf.
llvm-svn: 54124
2008-07-27 18:06:42 +00:00