Subzero: Partial implementation of global initializers.

This is still missing a couple things:

1. It only supports flat arrays and zeroinitializers.  Arrays of structs are not yet supported.

2. Initializers can't yet contain relocatables, e.g. the address of another global.Mod

Some changes are made to work around an llvm-mc assembler bug.  When assembling using intel syntax, llvm-mc doesn't correctly parse symbolic constants or add relocation entries in some circumstances.  Call instructions work, and use in a memory operand works, e.g. mov eax, [ArrayBase+4*ecx].  To work around this, we adjust legalize() to not allow ConstantRelocatable by default, except for memory operands and when called from lowerCall(), so the relocatable ends up being the source operand of a mov instruction.  Then, the mov emit routine actually emits an lea instruction for such moves.

A few lit tests needed to be adjusted to make szdiff work properly with respect to global initializers.

In the new cross test, the driver calls test code that returns a pointer to an array with a global initializer, and the driver compares the arrays returned by llc and Subzero.

BUG= none
R=jvoung@chromium.org

Review URL: https://codereview.chromium.org/358013003
diff --git a/src/IceTargetLowering.h b/src/IceTargetLowering.h
index dbb9a42..ddb66fa 100644
--- a/src/IceTargetLowering.h
+++ b/src/IceTargetLowering.h
@@ -199,6 +199,29 @@
   TargetLowering &operator=(const TargetLowering &) LLVM_DELETED_FUNCTION;
 };
 
+// TargetGlobalInitLowering is used for "lowering" global
+// initializers.  It is separated out from TargetLowering because it
+// does not require a Cfg.
+class TargetGlobalInitLowering {
+public:
+  static TargetGlobalInitLowering *createLowering(TargetArch Target,
+                                                  GlobalContext *Ctx);
+  // TODO: Allow relocations to be represented as part of the Data.
+  virtual void lower(const IceString &Name, SizeT Align, bool IsInternal,
+                     bool IsConst, bool IsZeroInitializer, SizeT Size,
+                     const char *Data, bool DisableTranslation) = 0;
+
+protected:
+  TargetGlobalInitLowering(GlobalContext *Ctx) : Ctx(Ctx) {}
+  GlobalContext *Ctx;
+
+private:
+  TargetGlobalInitLowering(const TargetGlobalInitLowering &)
+  LLVM_DELETED_FUNCTION;
+  TargetGlobalInitLowering &
+  operator=(const TargetGlobalInitLowering &) LLVM_DELETED_FUNCTION;
+};
+
 } // end of namespace Ice
 
 #endif // SUBZERO_SRC_ICETARGETLOWERING_H