Remove unnecessary #include.
[oota-llvm.git] / lib / CodeGen / README.txt
index 419f885feed67198f73b9161a22f7142e5a98957..33e207ff8c8c3f16015901d2d26940ebb208f295 100644 (file)
@@ -143,21 +143,59 @@ load [T + 7]
 ...
 load [T + 15]
 //===---------------------------------------------------------------------===//
-Tail merging issue:
-When we're trying to merge the tails of predecessors of a block I, and there
-are more than 2 predecessors, we don't do it optimally.  Suppose predecessors
-are A,B,C where B and C have 5 instructions in common, and A has 2 in common
-with B or C.  We want to get:
-A:
-  jmp C3
-B:
-  jmp C2
-C:
-C2:  3 common to B and C but not A
-C3:  2 common to all 3
-You get this if B and C are merged first, but currently it might randomly decide
-to merge A and B first, which results in not sharing the C2 instructions.  We 
-could look at all N*(N-1) combinations of predecessors and merge the ones with
-the most instructions in common first.  Usually that will be fast, but it 
-could get slow on big graphs (e.g. large switches tend to have blocks with many 
-predecessors).
+
+It's not always a good idea to choose rematerialization over spilling. If all
+the load / store instructions would be folded then spilling is cheaper because
+it won't require new live intervals / registers. See 2003-05-31-LongShifts for
+an example.
+
+//===---------------------------------------------------------------------===//
+
+With a copying garbage collector, derived pointers must not be retained across
+collector safe points; the collector could move the objects and invalidate the
+derived pointer. This is bad enough in the first place, but safe points can
+crop up unpredictably. Consider:
+
+        %array = load { i32, [0 x %obj] }** %array_addr
+        %nth_el = getelementptr { i32, [0 x %obj] }* %array, i32 0, i32 %n
+        %old = load %obj** %nth_el
+        %z = div i64 %x, %y
+        store %obj* %new, %obj** %nth_el
+
+If the i64 division is lowered to a libcall, then a safe point will (must)
+appear for the call site. If a collection occurs, %array and %nth_el no longer
+point into the correct object.
+
+The fix for this is to copy address calculations so that dependent pointers
+are never live across safe point boundaries. But the loads cannot be copied
+like this if there was an intervening store, so may be hard to get right.
+
+Only a concurrent mutator can trigger a collection at the libcall safe point.
+So single-threaded programs do not have this requirement, even with a copying
+collector. Still, LLVM optimizations would probably undo a front-end's careful
+work.
+
+//===---------------------------------------------------------------------===//
+
+The ocaml frametable structure supports liveness information. It would be good
+to support it.
+
+//===---------------------------------------------------------------------===//
+
+The FIXME in ComputeCommonTailLength in BranchFolding.cpp needs to be
+revisited. The check is there to work around a misuse of directives in inline
+assembly.
+
+//===---------------------------------------------------------------------===//
+
+It would be good to detect collector/target compatibility instead of silently
+doing the wrong thing.
+
+//===---------------------------------------------------------------------===//
+
+It would be really nice to be able to write patterns in .td files for copies,
+which would eliminate a bunch of explicit predicates on them (e.g. no side 
+effects).  Once this is in place, it would be even better to have tblgen 
+synthesize the various copy insertion/inspection methods in TargetInstrInfo.
+
+//===---------------------------------------------------------------------===//