Foundation for Quick LLVM compiler

Ready for review - probably better get this cleaned up and
checked in even though much work remains.

Basic conversion from MIR to GreenlandIR and from GreenlandIR
back to LIR.  Support sufficient to run Fibonacci test.

Note some structural changes in MIR to support this work:
    o  retaining incoming label for phi nodes
    o  constant propagation
    o  include object reference detection in type inference pass

Change-Id: I8ba63c73e76d071aa40cae0f744e598b96f68699
diff --git a/build/Android.common.mk b/build/Android.common.mk
index bcac723..064aa52 100644
--- a/build/Android.common.mk
+++ b/build/Android.common.mk
@@ -28,11 +28,17 @@
 ART_USE_GREENLAND_COMPILER := false
 endif
 
+ifneq ($(wildcard art/USE_QUICK_COMPILER),)
+ART_USE_QUICK_COMPILER := true
+else
+ART_USE_QUICK_COMPILER := false
+endif
+
 ifeq ($(filter-out true,$(ART_USE_LLVM_COMPILER) $(ART_USE_GREENLAND_COMPILER)),)
 $(error Cannot enable art-greenland and art-llvm compiler simultaneously!)
 endif
 
-ifeq ($(filter true,$(ART_USE_LLVM_COMPILER) $(ART_USE_GREENLAND_COMPILER)),true)
+ifeq ($(filter true,$(ART_USE_LLVM_COMPILER) $(ART_USE_GREENLAND_COMPILER) $(ART_USE_QUICK_COMPILER)),true)
 ART_REQUIRE_LLVM := true
 else
 ART_REQUIRE_LLVM := false
diff --git a/build/Android.executable.mk b/build/Android.executable.mk
index 9305d4d..3f0280b 100644
--- a/build/Android.executable.mk
+++ b/build/Android.executable.mk
@@ -26,6 +26,10 @@
   ART_EXECUTABLES_CFLAGS += -DART_USE_GREENLAND_COMPILER=1
 endif
 
+ifeq ($(ART_USE_QUICK_COMPILER),true)
+  ART_EXECUTABLES_CFLAGS += -DART_USE_QUICK_COMPILER=1
+endif
+
 # $(1): executable ("d" will be appended for debug version)
 # $(2): source
 # $(3): target or host
diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk
index 63c4b60..96f6dc3 100644
--- a/build/Android.gtest.mk
+++ b/build/Android.gtest.mk
@@ -28,6 +28,10 @@
   ART_TEST_CFLAGS += -DART_USE_GREENLAND_COMPILER=1
 endif
 
+ifeq ($(ART_USE_QUICK_COMPILER),true)
+  ART_TEST_CFLAGS += -DART_USE_QUICK_COMPILER=1
+endif
+
 # $(1): target or host
 # $(2): file name
 define build-art-test
diff --git a/build/Android.libart-compiler.mk b/build/Android.libart-compiler.mk
index a899341..f27ddaa 100644
--- a/build/Android.libart-compiler.mk
+++ b/build/Android.libart-compiler.mk
@@ -27,6 +27,12 @@
 	src/oat/jni/arm/calling_convention_arm.cc \
 	src/oat/jni/x86/calling_convention_x86.cc
 
+ifeq ($(ART_USE_QUICK_COMPILER), true)
+LIBART_COMPILER_COMMON_SRC_FILES += \
+	src/greenland/ir_builder.cc \
+	src/greenland/intrinsic_helper.cc
+endif
+
 LIBART_COMPILER_ARM_SRC_FILES += \
 	$(LIBART_COMPILER_COMMON_SRC_FILES) \
 	src/compiler/codegen/arm/ArchUtility.cc \
@@ -117,16 +123,39 @@
     LOCAL_CFLAGS += -D__mips_hard_float
   endif
 
+  ifeq ($(ART_USE_QUICK_COMPILER), true)
+    LOCAL_CFLAGS += -DART_USE_QUICK_COMPILER
+  endif
+
   LOCAL_C_INCLUDES += $(ART_C_INCLUDES)
+
+  ifeq ($(ART_USE_QUICK_COMPILER), true)
+    LOCAL_STATIC_LIBRARIES += \
+      libLLVMBitWriter \
+      libLLVMBitReader \
+      libLLVMCore \
+      libLLVMSupport
+  endif
+
   ifeq ($$(art_target_or_host),target)
     LOCAL_SHARED_LIBRARIES += libstlport
   else # host
     LOCAL_LDLIBS := -ldl -lpthread
   endif
   ifeq ($$(art_target_or_host),target)
+    ifeq ($(ART_USE_QUICK_COMPILER), true)
+      LOCAL_SHARED_LIBRARIES += libcutils
+      include $(LLVM_GEN_INTRINSICS_MK)
+      include $(LLVM_DEVICE_BUILD_MK)
+    endif
     include $(BUILD_SHARED_LIBRARY)
   else # host
     LOCAL_IS_HOST_MODULE := true
+    ifeq ($(ART_USE_QUICK_COMPILER), true)
+      LOCAL_STATIC_LIBRARIES += libcutils
+      include $(LLVM_GEN_INTRINSICS_MK)
+      include $(LLVM_HOST_BUILD_MK)
+    endif
     include $(BUILD_HOST_SHARED_LIBRARY)
   endif
 
diff --git a/build/Android.libart.mk b/build/Android.libart.mk
index b5cc6a0..01fa42b 100644
--- a/build/Android.libart.mk
+++ b/build/Android.libart.mk
@@ -23,6 +23,10 @@
   LIBART_CFLAGS += -DART_USE_GREENLAND_COMPILER=1
 endif
 
+ifeq ($(ART_USE_QUICK_COMPILER),true)
+  LIBART_CFLAGS += -DART_USE_QUICK_COMPILER=1
+endif
+
 # $(1): target or host
 # $(2): ndebug or debug
 define build-libart