diff options
| author | 2016-02-03 05:46:57 -0800 | |
|---|---|---|
| committer | 2016-02-08 22:59:13 -0800 | |
| commit | 40bcb9356f951af2db4b9b671511841eedf59427 (patch) | |
| tree | 0d46c2a097fe925cedc8e6eb72d3ccd5997399cf | |
| parent | 009a195c5507ddc799cf7a52927b0ac02aa7f7e6 (diff) | |
Some clean-up for the handling of HSelect in LSE
Use $noinline and throwing an Exception for doing no-inlining in
the test.
Also create reference info early for HSelect if it has reference
type, which may help the pre-existence-based alias analysis.
Change-Id: Ia825058a457b049f87a13087bb78f5233513e0a8
| -rw-r--r-- | compiler/optimizing/load_store_elimination.cc | 6 | ||||
| -rw-r--r-- | test/530-checker-lse/src/Main.java | 25 |
2 files changed, 14 insertions, 17 deletions
diff --git a/compiler/optimizing/load_store_elimination.cc b/compiler/optimizing/load_store_elimination.cc index 9a97f54d54..8eaac0bbd3 100644 --- a/compiler/optimizing/load_store_elimination.cc +++ b/compiler/optimizing/load_store_elimination.cc @@ -61,7 +61,7 @@ class ReferenceInfo : public ArenaObject<kArenaAllocMisc> { (use->IsStaticFieldSet() && (reference_ == use->InputAt(1))) || (use->IsUnresolvedStaticFieldSet() && (reference_ == use->InputAt(0))) || (use->IsArraySet() && (reference_ == use->InputAt(2)))) { - // reference_ is merged to a phi/HSelect, passed to a callee, or stored to heap. + // reference_ is merged to HPhi/HSelect, passed to a callee, or stored to heap. // reference_ isn't the only name that can refer to its value anymore. is_singleton_ = false; is_singleton_and_not_returned_ = false; @@ -458,6 +458,10 @@ class HeapLocationCollector : public HGraphVisitor { CreateReferenceInfoForReferenceType(instruction); } + void VisitSelect(HSelect* instruction) OVERRIDE { + CreateReferenceInfoForReferenceType(instruction); + } + void VisitDeoptimize(HDeoptimize* instruction ATTRIBUTE_UNUSED) OVERRIDE { may_deoptimize_ = true; } diff --git a/test/530-checker-lse/src/Main.java b/test/530-checker-lse/src/Main.java index d647683869..4d6ea06fe0 100644 --- a/test/530-checker-lse/src/Main.java +++ b/test/530-checker-lse/src/Main.java @@ -664,28 +664,19 @@ public class Main { System.out.println("testFinalizableByForcingGc() failed to force gc."); } - /// CHECK-START: int Main.testHSelect(boolean) load_store_elimination (before) + /// CHECK-START: int Main.$noinline$testHSelect(boolean) load_store_elimination (before) /// CHECK: InstanceFieldSet /// CHECK: Select - /// CHECK-START: int Main.testHSelect(boolean) load_store_elimination (after) + /// CHECK-START: int Main.$noinline$testHSelect(boolean) load_store_elimination (after) /// CHECK: InstanceFieldSet /// CHECK: Select // Test that HSelect creates alias. - public static int testHSelect(boolean b) { - // Disable inlining. - System.out.print(""); - System.out.print(""); - System.out.print(""); - System.out.print(""); - System.out.print(""); - System.out.print(""); - System.out.print(""); - System.out.print(""); - System.out.print(""); - System.out.print(""); - + public static int $noinline$testHSelect(boolean b) { + if (sFlag) { + throw new Error(); + } TestClass obj = new TestClass(); TestClass obj2 = null; obj.i = 0xdead; @@ -754,6 +745,8 @@ public class Main { assertIntEquals(test23(false), 5); assertFloatEquals(test24(), 8.0f); testFinalizableByForcingGc(); - assertIntEquals(testHSelect(true), 0xdead); + assertIntEquals($noinline$testHSelect(true), 0xdead); } + + static boolean sFlag; } |