Merge "Callee/caller save logic in register allocator."
diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc
index f56e446..672e55e 100644
--- a/compiler/optimizing/code_generator_arm.cc
+++ b/compiler/optimizing/code_generator_arm.cc
@@ -17,6 +17,7 @@
#include "code_generator_arm.h"
#include "arch/arm/instruction_set_features_arm.h"
+#include "code_generator_utils.h"
#include "entrypoints/quick/quick_entrypoints.h"
#include "gc/accounting/card_table.h"
#include "intrinsics.h"
@@ -347,11 +348,11 @@
}
void CodeGeneratorARM::DumpCoreRegister(std::ostream& stream, int reg) const {
- stream << ArmManagedRegister::FromCoreRegister(Register(reg));
+ stream << Register(reg);
}
void CodeGeneratorARM::DumpFloatingPointRegister(std::ostream& stream, int reg) const {
- stream << ArmManagedRegister::FromSRegister(SRegister(reg));
+ stream << SRegister(reg);
}
size_t CodeGeneratorARM::SaveCoreRegister(size_t stack_index, uint32_t reg_id) {
@@ -2185,11 +2186,134 @@
}
}
+void InstructionCodeGeneratorARM::DivRemOneOrMinusOne(HBinaryOperation* instruction) {
+ DCHECK(instruction->IsDiv() || instruction->IsRem());
+ DCHECK(instruction->GetResultType() == Primitive::kPrimInt);
+
+ LocationSummary* locations = instruction->GetLocations();
+ Location second = locations->InAt(1);
+ DCHECK(second.IsConstant());
+
+ Register out = locations->Out().AsRegister<Register>();
+ Register dividend = locations->InAt(0).AsRegister<Register>();
+ int32_t imm = second.GetConstant()->AsIntConstant()->GetValue();
+ DCHECK(imm == 1 || imm == -1);
+
+ if (instruction->IsRem()) {
+ __ LoadImmediate(out, 0);
+ } else {
+ if (imm == 1) {
+ __ Mov(out, dividend);
+ } else {
+ __ rsb(out, dividend, ShifterOperand(0));
+ }
+ }
+}
+
+void InstructionCodeGeneratorARM::DivRemByPowerOfTwo(HBinaryOperation* instruction) {
+ DCHECK(instruction->IsDiv() || instruction->IsRem());
+ DCHECK(instruction->GetResultType() == Primitive::kPrimInt);
+
+ LocationSummary* locations = instruction->GetLocations();
+ Location second = locations->InAt(1);
+ DCHECK(second.IsConstant());
+
+ Register out = locations->Out().AsRegister<Register>();
+ Register dividend = locations->InAt(0).AsRegister<Register>();
+ Register temp = locations->GetTemp(0).AsRegister<Register>();
+ int32_t imm = second.GetConstant()->AsIntConstant()->GetValue();
+ int32_t abs_imm = std::abs(imm);
+ DCHECK(IsPowerOfTwo(abs_imm));
+ int ctz_imm = CTZ(abs_imm);
+
+ if (ctz_imm == 1) {
+ __ Lsr(temp, dividend, 32 - ctz_imm);
+ } else {
+ __ Asr(temp, dividend, 31);
+ __ Lsr(temp, temp, 32 - ctz_imm);
+ }
+ __ add(out, temp, ShifterOperand(dividend));
+
+ if (instruction->IsDiv()) {
+ __ Asr(out, out, ctz_imm);
+ if (imm < 0) {
+ __ rsb(out, out, ShifterOperand(0));
+ }
+ } else {
+ __ ubfx(out, out, 0, ctz_imm);
+ __ sub(out, out, ShifterOperand(temp));
+ }
+}
+
+void InstructionCodeGeneratorARM::GenerateDivRemWithAnyConstant(HBinaryOperation* instruction) {
+ DCHECK(instruction->IsDiv() || instruction->IsRem());
+ DCHECK(instruction->GetResultType() == Primitive::kPrimInt);
+
+ LocationSummary* locations = instruction->GetLocations();
+ Location second = locations->InAt(1);
+ DCHECK(second.IsConstant());
+
+ Register out = locations->Out().AsRegister<Register>();
+ Register dividend = locations->InAt(0).AsRegister<Register>();
+ Register temp1 = locations->GetTemp(0).AsRegister<Register>();
+ Register temp2 = locations->GetTemp(1).AsRegister<Register>();
+ int64_t imm = second.GetConstant()->AsIntConstant()->GetValue();
+
+ int64_t magic;
+ int shift;
+ CalculateMagicAndShiftForDivRem(imm, false /* is_long */, &magic, &shift);
+
+ __ LoadImmediate(temp1, magic);
+ __ smull(temp2, temp1, dividend, temp1);
+
+ if (imm > 0 && magic < 0) {
+ __ add(temp1, temp1, ShifterOperand(dividend));
+ } else if (imm < 0 && magic > 0) {
+ __ sub(temp1, temp1, ShifterOperand(dividend));
+ }
+
+ if (shift != 0) {
+ __ Asr(temp1, temp1, shift);
+ }
+
+ if (instruction->IsDiv()) {
+ __ sub(out, temp1, ShifterOperand(temp1, ASR, 31));
+ } else {
+ __ sub(temp1, temp1, ShifterOperand(temp1, ASR, 31));
+ // TODO: Strength reduction for mls.
+ __ LoadImmediate(temp2, imm);
+ __ mls(out, temp1, temp2, dividend);
+ }
+}
+
+void InstructionCodeGeneratorARM::GenerateDivRemConstantIntegral(HBinaryOperation* instruction) {
+ DCHECK(instruction->IsDiv() || instruction->IsRem());
+ DCHECK(instruction->GetResultType() == Primitive::kPrimInt);
+
+ LocationSummary* locations = instruction->GetLocations();
+ Location second = locations->InAt(1);
+ DCHECK(second.IsConstant());
+
+ int32_t imm = second.GetConstant()->AsIntConstant()->GetValue();
+ if (imm == 0) {
+ // Do not generate anything. DivZeroCheck would prevent any code to be executed.
+ } else if (imm == 1 || imm == -1) {
+ DivRemOneOrMinusOne(instruction);
+ } else if (IsPowerOfTwo(std::abs(imm))) {
+ DivRemByPowerOfTwo(instruction);
+ } else {
+ DCHECK(imm <= -2 || imm >= 2);
+ GenerateDivRemWithAnyConstant(instruction);
+ }
+}
+
void LocationsBuilderARM::VisitDiv(HDiv* div) {
LocationSummary::CallKind call_kind = LocationSummary::kNoCall;
if (div->GetResultType() == Primitive::kPrimLong) {
// pLdiv runtime call.
call_kind = LocationSummary::kCall;
+ } else if (div->GetResultType() == Primitive::kPrimInt && div->InputAt(1)->IsConstant()) {
+ // sdiv will be replaced by other instruction sequence.
} else if (div->GetResultType() == Primitive::kPrimInt &&
!codegen_->GetInstructionSetFeatures().HasDivideInstruction()) {
// pIdivmod runtime call.
@@ -2200,7 +2324,20 @@
switch (div->GetResultType()) {
case Primitive::kPrimInt: {
- if (codegen_->GetInstructionSetFeatures().HasDivideInstruction()) {
+ if (div->InputAt(1)->IsConstant()) {
+ locations->SetInAt(0, Location::RequiresRegister());
+ locations->SetInAt(1, Location::RegisterOrConstant(div->InputAt(1)));
+ locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+ int32_t abs_imm = std::abs(div->InputAt(1)->AsIntConstant()->GetValue());
+ if (abs_imm <= 1) {
+ // No temp register required.
+ } else {
+ locations->AddTemp(Location::RequiresRegister());
+ if (!IsPowerOfTwo(abs_imm)) {
+ locations->AddTemp(Location::RequiresRegister());
+ }
+ }
+ } else if (codegen_->GetInstructionSetFeatures().HasDivideInstruction()) {
locations->SetInAt(0, Location::RequiresRegister());
locations->SetInAt(1, Location::RequiresRegister());
locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
@@ -2244,7 +2381,9 @@
switch (div->GetResultType()) {
case Primitive::kPrimInt: {
- if (codegen_->GetInstructionSetFeatures().HasDivideInstruction()) {
+ if (second.IsConstant()) {
+ GenerateDivRemConstantIntegral(div);
+ } else if (codegen_->GetInstructionSetFeatures().HasDivideInstruction()) {
__ sdiv(out.AsRegister<Register>(),
first.AsRegister<Register>(),
second.AsRegister<Register>());
@@ -2296,8 +2435,11 @@
// Most remainders are implemented in the runtime.
LocationSummary::CallKind call_kind = LocationSummary::kCall;
- if (rem->GetResultType() == Primitive::kPrimInt &&
- codegen_->GetInstructionSetFeatures().HasDivideInstruction()) {
+ if (rem->GetResultType() == Primitive::kPrimInt && rem->InputAt(1)->IsConstant()) {
+ // sdiv will be replaced by other instruction sequence.
+ call_kind = LocationSummary::kNoCall;
+ } else if ((rem->GetResultType() == Primitive::kPrimInt)
+ && codegen_->GetInstructionSetFeatures().HasDivideInstruction()) {
// Have hardware divide instruction for int, do it with three instructions.
call_kind = LocationSummary::kNoCall;
}
@@ -2306,7 +2448,20 @@
switch (type) {
case Primitive::kPrimInt: {
- if (codegen_->GetInstructionSetFeatures().HasDivideInstruction()) {
+ if (rem->InputAt(1)->IsConstant()) {
+ locations->SetInAt(0, Location::RequiresRegister());
+ locations->SetInAt(1, Location::RegisterOrConstant(rem->InputAt(1)));
+ locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
+ int32_t abs_imm = std::abs(rem->InputAt(1)->AsIntConstant()->GetValue());
+ if (abs_imm <= 1) {
+ // No temp register required.
+ } else {
+ locations->AddTemp(Location::RequiresRegister());
+ if (!IsPowerOfTwo(abs_imm)) {
+ locations->AddTemp(Location::RequiresRegister());
+ }
+ }
+ } else if (codegen_->GetInstructionSetFeatures().HasDivideInstruction()) {
locations->SetInAt(0, Location::RequiresRegister());
locations->SetInAt(1, Location::RequiresRegister());
locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
@@ -2363,7 +2518,9 @@
Primitive::Type type = rem->GetResultType();
switch (type) {
case Primitive::kPrimInt: {
- if (codegen_->GetInstructionSetFeatures().HasDivideInstruction()) {
+ if (second.IsConstant()) {
+ GenerateDivRemConstantIntegral(rem);
+ } else if (codegen_->GetInstructionSetFeatures().HasDivideInstruction()) {
Register reg1 = first.AsRegister<Register>();
Register reg2 = second.AsRegister<Register>();
Register temp = locations->GetTemp(0).AsRegister<Register>();
diff --git a/compiler/optimizing/code_generator_arm.h b/compiler/optimizing/code_generator_arm.h
index 1a498e1..2edbcf8 100644
--- a/compiler/optimizing/code_generator_arm.h
+++ b/compiler/optimizing/code_generator_arm.h
@@ -189,6 +189,10 @@
Label* true_target,
Label* false_target,
Label* always_true_target);
+ void DivRemOneOrMinusOne(HBinaryOperation* instruction);
+ void DivRemByPowerOfTwo(HBinaryOperation* instruction);
+ void GenerateDivRemWithAnyConstant(HBinaryOperation* instruction);
+ void GenerateDivRemConstantIntegral(HBinaryOperation* instruction);
ArmAssembler* const assembler_;
CodeGeneratorARM* const codegen_;
diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc
index b1cb880..f51ea41 100644
--- a/compiler/optimizing/code_generator_arm64.cc
+++ b/compiler/optimizing/code_generator_arm64.cc
@@ -17,6 +17,7 @@
#include "code_generator_arm64.h"
#include "arch/arm64/instruction_set_features_arm64.h"
+#include "code_generator_utils.h"
#include "common_arm64.h"
#include "entrypoints/quick/quick_entrypoints.h"
#include "entrypoints/quick/quick_entrypoints_enum.h"
@@ -691,11 +692,11 @@
}
void CodeGeneratorARM64::DumpCoreRegister(std::ostream& stream, int reg) const {
- stream << Arm64ManagedRegister::FromXRegister(XRegister(reg));
+ stream << XRegister(reg);
}
void CodeGeneratorARM64::DumpFloatingPointRegister(std::ostream& stream, int reg) const {
- stream << Arm64ManagedRegister::FromDRegister(DRegister(reg));
+ stream << DRegister(reg);
}
void CodeGeneratorARM64::MoveConstant(CPURegister destination, HConstant* constant) {
@@ -1603,6 +1604,152 @@
#undef DEFINE_CONDITION_VISITORS
#undef FOR_EACH_CONDITION_INSTRUCTION
+void InstructionCodeGeneratorARM64::DivRemOneOrMinusOne(HBinaryOperation* instruction) {
+ DCHECK(instruction->IsDiv() || instruction->IsRem());
+
+ LocationSummary* locations = instruction->GetLocations();
+ Location second = locations->InAt(1);
+ DCHECK(second.IsConstant());
+
+ Register out = OutputRegister(instruction);
+ Register dividend = InputRegisterAt(instruction, 0);
+ int64_t imm = Int64FromConstant(second.GetConstant());
+ DCHECK(imm == 1 || imm == -1);
+
+ if (instruction->IsRem()) {
+ __ Mov(out, 0);
+ } else {
+ if (imm == 1) {
+ __ Mov(out, dividend);
+ } else {
+ __ Neg(out, dividend);
+ }
+ }
+}
+
+void InstructionCodeGeneratorARM64::DivRemByPowerOfTwo(HBinaryOperation* instruction) {
+ DCHECK(instruction->IsDiv() || instruction->IsRem());
+
+ LocationSummary* locations = instruction->GetLocations();
+ Location second = locations->InAt(1);
+ DCHECK(second.IsConstant());
+
+ Register out = OutputRegister(instruction);
+ Register dividend = InputRegisterAt(instruction, 0);
+ int64_t imm = Int64FromConstant(second.GetConstant());
+ int64_t abs_imm = std::abs(imm);
+ DCHECK(IsPowerOfTwo(abs_imm));
+ int ctz_imm = CTZ(abs_imm);
+
+ UseScratchRegisterScope temps(GetVIXLAssembler());
+ Register temp = temps.AcquireSameSizeAs(out);
+
+ if (instruction->IsDiv()) {
+ __ Add(temp, dividend, abs_imm - 1);
+ __ Cmp(dividend, 0);
+ __ Csel(out, temp, dividend, lt);
+ if (imm > 0) {
+ __ Asr(out, out, ctz_imm);
+ } else {
+ __ Neg(out, Operand(out, ASR, ctz_imm));
+ }
+ } else {
+ int bits = instruction->GetResultType() == Primitive::kPrimInt ? 32 : 64;
+ __ Asr(temp, dividend, bits - 1);
+ __ Lsr(temp, temp, bits - ctz_imm);
+ __ Add(out, dividend, temp);
+ __ And(out, out, abs_imm - 1);
+ __ Sub(out, out, temp);
+ }
+}
+
+void InstructionCodeGeneratorARM64::GenerateDivRemWithAnyConstant(HBinaryOperation* instruction) {
+ DCHECK(instruction->IsDiv() || instruction->IsRem());
+
+ LocationSummary* locations = instruction->GetLocations();
+ Location second = locations->InAt(1);
+ DCHECK(second.IsConstant());
+
+ Register out = OutputRegister(instruction);
+ Register dividend = InputRegisterAt(instruction, 0);
+ int64_t imm = Int64FromConstant(second.GetConstant());
+
+ Primitive::Type type = instruction->GetResultType();
+ DCHECK(type == Primitive::kPrimInt || type == Primitive::kPrimLong);
+
+ int64_t magic;
+ int shift;
+ CalculateMagicAndShiftForDivRem(imm, type == Primitive::kPrimLong /* is_long */, &magic, &shift);
+
+ UseScratchRegisterScope temps(GetVIXLAssembler());
+ Register temp = temps.AcquireSameSizeAs(out);
+
+ // temp = get_high(dividend * magic)
+ __ Mov(temp, magic);
+ if (type == Primitive::kPrimLong) {
+ __ Smulh(temp, dividend, temp);
+ } else {
+ __ Smull(temp.X(), dividend, temp);
+ __ Lsr(temp.X(), temp.X(), 32);
+ }
+
+ if (imm > 0 && magic < 0) {
+ __ Add(temp, temp, dividend);
+ } else if (imm < 0 && magic > 0) {
+ __ Sub(temp, temp, dividend);
+ }
+
+ if (shift != 0) {
+ __ Asr(temp, temp, shift);
+ }
+
+ if (instruction->IsDiv()) {
+ __ Sub(out, temp, Operand(temp, ASR, type == Primitive::kPrimLong ? 63 : 31));
+ } else {
+ __ Sub(temp, temp, Operand(temp, ASR, type == Primitive::kPrimLong ? 63 : 31));
+ // TODO: Strength reduction for msub.
+ Register temp_imm = temps.AcquireSameSizeAs(out);
+ __ Mov(temp_imm, imm);
+ __ Msub(out, temp, temp_imm, dividend);
+ }
+}
+
+void InstructionCodeGeneratorARM64::GenerateDivRemIntegral(HBinaryOperation* instruction) {
+ DCHECK(instruction->IsDiv() || instruction->IsRem());
+ Primitive::Type type = instruction->GetResultType();
+ DCHECK(type == Primitive::kPrimInt || Primitive::kPrimLong);
+
+ LocationSummary* locations = instruction->GetLocations();
+ Register out = OutputRegister(instruction);
+ Location second = locations->InAt(1);
+
+ if (second.IsConstant()) {
+ int64_t imm = Int64FromConstant(second.GetConstant());
+
+ if (imm == 0) {
+ // Do not generate anything. DivZeroCheck would prevent any code to be executed.
+ } else if (imm == 1 || imm == -1) {
+ DivRemOneOrMinusOne(instruction);
+ } else if (IsPowerOfTwo(std::abs(imm))) {
+ DivRemByPowerOfTwo(instruction);
+ } else {
+ DCHECK(imm <= -2 || imm >= 2);
+ GenerateDivRemWithAnyConstant(instruction);
+ }
+ } else {
+ Register dividend = InputRegisterAt(instruction, 0);
+ Register divisor = InputRegisterAt(instruction, 1);
+ if (instruction->IsDiv()) {
+ __ Sdiv(out, dividend, divisor);
+ } else {
+ UseScratchRegisterScope temps(GetVIXLAssembler());
+ Register temp = temps.AcquireSameSizeAs(out);
+ __ Sdiv(temp, dividend, divisor);
+ __ Msub(out, temp, divisor, dividend);
+ }
+ }
+}
+
void LocationsBuilderARM64::VisitDiv(HDiv* div) {
LocationSummary* locations =
new (GetGraph()->GetArena()) LocationSummary(div, LocationSummary::kNoCall);
@@ -1610,7 +1757,7 @@
case Primitive::kPrimInt:
case Primitive::kPrimLong:
locations->SetInAt(0, Location::RequiresRegister());
- locations->SetInAt(1, Location::RequiresRegister());
+ locations->SetInAt(1, Location::RegisterOrConstant(div->InputAt(1)));
locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
break;
@@ -1631,7 +1778,7 @@
switch (type) {
case Primitive::kPrimInt:
case Primitive::kPrimLong:
- __ Sdiv(OutputRegister(div), InputRegisterAt(div, 0), InputRegisterAt(div, 1));
+ GenerateDivRemIntegral(div);
break;
case Primitive::kPrimFloat:
@@ -2454,7 +2601,7 @@
case Primitive::kPrimInt:
case Primitive::kPrimLong:
locations->SetInAt(0, Location::RequiresRegister());
- locations->SetInAt(1, Location::RequiresRegister());
+ locations->SetInAt(1, Location::RegisterOrConstant(rem->InputAt(1)));
locations->SetOut(Location::RequiresRegister(), Location::kNoOutputOverlap);
break;
@@ -2479,14 +2626,7 @@
switch (type) {
case Primitive::kPrimInt:
case Primitive::kPrimLong: {
- UseScratchRegisterScope temps(GetVIXLAssembler());
- Register dividend = InputRegisterAt(rem, 0);
- Register divisor = InputRegisterAt(rem, 1);
- Register output = OutputRegister(rem);
- Register temp = temps.AcquireSameSizeAs(output);
-
- __ Sdiv(temp, dividend, divisor);
- __ Msub(output, temp, divisor, dividend);
+ GenerateDivRemIntegral(rem);
break;
}
diff --git a/compiler/optimizing/code_generator_arm64.h b/compiler/optimizing/code_generator_arm64.h
index 8aeea54..0dc0918 100644
--- a/compiler/optimizing/code_generator_arm64.h
+++ b/compiler/optimizing/code_generator_arm64.h
@@ -163,6 +163,11 @@
vixl::Label* true_target,
vixl::Label* false_target,
vixl::Label* always_true_target);
+ void DivRemOneOrMinusOne(HBinaryOperation* instruction);
+ void DivRemByPowerOfTwo(HBinaryOperation* instruction);
+ void GenerateDivRemWithAnyConstant(HBinaryOperation* instruction);
+ void GenerateDivRemIntegral(HBinaryOperation* instruction);
+
Arm64Assembler* const assembler_;
CodeGeneratorARM64* const codegen_;
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc
index 2848a48..0212da1 100644
--- a/compiler/optimizing/code_generator_x86.cc
+++ b/compiler/optimizing/code_generator_x86.cc
@@ -340,11 +340,11 @@
}
void CodeGeneratorX86::DumpCoreRegister(std::ostream& stream, int reg) const {
- stream << X86ManagedRegister::FromCpuRegister(Register(reg));
+ stream << Register(reg);
}
void CodeGeneratorX86::DumpFloatingPointRegister(std::ostream& stream, int reg) const {
- stream << X86ManagedRegister::FromXmmRegister(XmmRegister(reg));
+ stream << XmmRegister(reg);
}
size_t CodeGeneratorX86::SaveCoreRegister(size_t stack_index, uint32_t reg_id) {
diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc
index e633970..63d6846 100644
--- a/compiler/optimizing/code_generator_x86_64.cc
+++ b/compiler/optimizing/code_generator_x86_64.cc
@@ -396,11 +396,11 @@
}
void CodeGeneratorX86_64::DumpCoreRegister(std::ostream& stream, int reg) const {
- stream << X86_64ManagedRegister::FromCpuRegister(Register(reg));
+ stream << Register(reg);
}
void CodeGeneratorX86_64::DumpFloatingPointRegister(std::ostream& stream, int reg) const {
- stream << X86_64ManagedRegister::FromXmmRegister(FloatRegister(reg));
+ stream << FloatRegister(reg);
}
size_t CodeGeneratorX86_64::SaveCoreRegister(size_t stack_index, uint32_t reg_id) {
diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc
index f5c630b..7ea1240 100644
--- a/compiler/optimizing/graph_visualizer.cc
+++ b/compiler/optimizing/graph_visualizer.cc
@@ -24,8 +24,56 @@
#include "register_allocator.h"
#include "ssa_liveness_analysis.h"
+#include <cctype>
+#include <sstream>
+
namespace art {
+static bool HasWhitespace(const char* str) {
+ DCHECK(str != nullptr);
+ while (str[0] != 0) {
+ if (isspace(str[0])) {
+ return true;
+ }
+ str++;
+ }
+ return false;
+}
+
+class StringList {
+ public:
+ // Create an empty list
+ StringList() : is_empty_(true) {}
+
+ // Construct StringList from a linked list. List element class T
+ // must provide methods `GetNext` and `Dump`.
+ template<class T>
+ explicit StringList(T* first_entry) : StringList() {
+ for (T* current = first_entry; current != nullptr; current = current->GetNext()) {
+ current->Dump(NewEntryStream());
+ }
+ }
+
+ std::ostream& NewEntryStream() {
+ if (is_empty_) {
+ is_empty_ = false;
+ } else {
+ sstream_ << ",";
+ }
+ return sstream_;
+ }
+
+ private:
+ bool is_empty_;
+ std::ostringstream sstream_;
+
+ friend std::ostream& operator<<(std::ostream& os, const StringList& list);
+};
+
+std::ostream& operator<<(std::ostream& os, const StringList& list) {
+ return os << "[" << list.sstream_.str() << "]";
+}
+
/**
* HGraph visitor to generate a file suitable for the c1visualizer tool and IRHydra.
*/
@@ -125,76 +173,84 @@
output_<< std::endl;
}
- void DumpLocation(Location location) {
+ void DumpLocation(std::ostream& stream, const Location& location) {
if (location.IsRegister()) {
- codegen_.DumpCoreRegister(output_, location.reg());
+ codegen_.DumpCoreRegister(stream, location.reg());
} else if (location.IsFpuRegister()) {
- codegen_.DumpFloatingPointRegister(output_, location.reg());
+ codegen_.DumpFloatingPointRegister(stream, location.reg());
} else if (location.IsConstant()) {
- output_ << "constant";
+ stream << "#";
HConstant* constant = location.GetConstant();
if (constant->IsIntConstant()) {
- output_ << " " << constant->AsIntConstant()->GetValue();
+ stream << constant->AsIntConstant()->GetValue();
} else if (constant->IsLongConstant()) {
- output_ << " " << constant->AsLongConstant()->GetValue();
+ stream << constant->AsLongConstant()->GetValue();
}
} else if (location.IsInvalid()) {
- output_ << "invalid";
+ stream << "invalid";
} else if (location.IsStackSlot()) {
- output_ << location.GetStackIndex() << "(sp)";
+ stream << location.GetStackIndex() << "(sp)";
} else if (location.IsFpuRegisterPair()) {
- codegen_.DumpFloatingPointRegister(output_, location.low());
- output_ << " and ";
- codegen_.DumpFloatingPointRegister(output_, location.high());
+ codegen_.DumpFloatingPointRegister(stream, location.low());
+ stream << "|";
+ codegen_.DumpFloatingPointRegister(stream, location.high());
} else if (location.IsRegisterPair()) {
- codegen_.DumpCoreRegister(output_, location.low());
- output_ << " and ";
- codegen_.DumpCoreRegister(output_, location.high());
+ codegen_.DumpCoreRegister(stream, location.low());
+ stream << "|";
+ codegen_.DumpCoreRegister(stream, location.high());
} else if (location.IsUnallocated()) {
- output_ << "<U>";
+ stream << "unallocated";
} else {
DCHECK(location.IsDoubleStackSlot());
- output_ << "2x" << location.GetStackIndex() << "(sp)";
+ stream << "2x" << location.GetStackIndex() << "(sp)";
}
}
+ std::ostream& StartAttributeStream(const char* name = nullptr) {
+ if (name == nullptr) {
+ output_ << " ";
+ } else {
+ DCHECK(!HasWhitespace(name)) << "Checker does not allow spaces in attributes";
+ output_ << " " << name << ":";
+ }
+ return output_;
+ }
+
void VisitParallelMove(HParallelMove* instruction) OVERRIDE {
- output_ << " (";
+ StartAttributeStream("liveness") << instruction->GetLifetimePosition();
+ StringList moves;
for (size_t i = 0, e = instruction->NumMoves(); i < e; ++i) {
MoveOperands* move = instruction->MoveOperandsAt(i);
- DumpLocation(move->GetSource());
- output_ << " -> ";
- DumpLocation(move->GetDestination());
- if (i + 1 != e) {
- output_ << ", ";
- }
+ std::ostream& str = moves.NewEntryStream();
+ DumpLocation(str, move->GetSource());
+ str << "->";
+ DumpLocation(str, move->GetDestination());
}
- output_ << ")";
- output_ << " (liveness: " << instruction->GetLifetimePosition() << ")";
+ StartAttributeStream("moves") << moves;
}
void VisitIntConstant(HIntConstant* instruction) OVERRIDE {
- output_ << " " << instruction->GetValue();
+ StartAttributeStream() << instruction->GetValue();
}
void VisitLongConstant(HLongConstant* instruction) OVERRIDE {
- output_ << " " << instruction->GetValue();
+ StartAttributeStream() << instruction->GetValue();
}
void VisitFloatConstant(HFloatConstant* instruction) OVERRIDE {
- output_ << " " << instruction->GetValue();
+ StartAttributeStream() << instruction->GetValue();
}
void VisitDoubleConstant(HDoubleConstant* instruction) OVERRIDE {
- output_ << " " << instruction->GetValue();
+ StartAttributeStream() << instruction->GetValue();
}
void VisitPhi(HPhi* phi) OVERRIDE {
- output_ << " " << phi->GetRegNumber();
+ StartAttributeStream("reg") << phi->GetRegNumber();
}
void VisitMemoryBarrier(HMemoryBarrier* barrier) OVERRIDE {
- output_ << " " << barrier->GetBarrierKind();
+ StartAttributeStream("kind") << barrier->GetBarrierKind();
}
bool IsPass(const char* name) {
@@ -203,65 +259,65 @@
void PrintInstruction(HInstruction* instruction) {
output_ << instruction->DebugName();
- instruction->Accept(this);
if (instruction->InputCount() > 0) {
- output_ << " [ ";
- for (HInputIterator inputs(instruction); !inputs.Done(); inputs.Advance()) {
- output_ << GetTypeId(inputs.Current()->GetType()) << inputs.Current()->GetId() << " ";
+ StringList inputs;
+ for (HInputIterator it(instruction); !it.Done(); it.Advance()) {
+ inputs.NewEntryStream() << GetTypeId(it.Current()->GetType()) << it.Current()->GetId();
}
- output_ << "]";
+ StartAttributeStream() << inputs;
}
+ instruction->Accept(this);
if (instruction->HasEnvironment()) {
- output_ << " (env:";
+ StringList envs;
for (HEnvironment* environment = instruction->GetEnvironment();
environment != nullptr;
environment = environment->GetParent()) {
- output_ << " [ ";
+ StringList vregs;
for (size_t i = 0, e = environment->Size(); i < e; ++i) {
HInstruction* insn = environment->GetInstructionAt(i);
if (insn != nullptr) {
- output_ << GetTypeId(insn->GetType()) << insn->GetId() << " ";
+ vregs.NewEntryStream() << GetTypeId(insn->GetType()) << insn->GetId();
} else {
- output_ << " _ ";
+ vregs.NewEntryStream() << "_";
}
}
- output_ << "]";
+ envs.NewEntryStream() << vregs;
}
- output_ << ")";
+ StartAttributeStream("env") << envs;
}
if (IsPass(SsaLivenessAnalysis::kLivenessPassName)
&& is_after_pass_
&& instruction->GetLifetimePosition() != kNoLifetime) {
- output_ << " (liveness: " << instruction->GetLifetimePosition();
+ StartAttributeStream("liveness") << instruction->GetLifetimePosition();
if (instruction->HasLiveInterval()) {
- output_ << " ";
- const LiveInterval& interval = *instruction->GetLiveInterval();
- interval.Dump(output_);
+ LiveInterval* interval = instruction->GetLiveInterval();
+ StartAttributeStream("ranges") << StringList(interval->GetFirstRange());
+ StartAttributeStream("uses") << StringList(interval->GetFirstUse());
+ StartAttributeStream("env_uses") << StringList(interval->GetFirstEnvironmentUse());
+ StartAttributeStream("is_fixed") << interval->IsFixed();
+ StartAttributeStream("is_split") << interval->IsSplit();
+ StartAttributeStream("is_low") << interval->IsLowInterval();
+ StartAttributeStream("is_high") << interval->IsHighInterval();
}
- output_ << ")";
} else if (IsPass(RegisterAllocator::kRegisterAllocatorPassName) && is_after_pass_) {
+ StartAttributeStream("liveness") << instruction->GetLifetimePosition();
LocationSummary* locations = instruction->GetLocations();
if (locations != nullptr) {
- output_ << " ( ";
+ StringList inputs;
for (size_t i = 0; i < instruction->InputCount(); ++i) {
- DumpLocation(locations->InAt(i));
- output_ << " ";
+ DumpLocation(inputs.NewEntryStream(), locations->InAt(i));
}
- output_ << ")";
- if (locations->Out().IsValid()) {
- output_ << " -> ";
- DumpLocation(locations->Out());
- }
+ std::ostream& attr = StartAttributeStream("locations");
+ attr << inputs << "->";
+ DumpLocation(attr, locations->Out());
}
- output_ << " (liveness: " << instruction->GetLifetimePosition() << ")";
} else if (IsPass(LICM::kLoopInvariantCodeMotionPassName)
|| IsPass(HDeadCodeElimination::kFinalDeadCodeEliminationPassName)) {
- output_ << " ( loop_header:";
HLoopInformation* info = instruction->GetBlock()->GetLoopInformation();
if (info == nullptr) {
- output_ << "null )";
+ StartAttributeStream("loop") << "none";
} else {
- output_ << "B" << info->GetHeader()->GetBlockId() << " )";
+ StartAttributeStream("loop") << "B" << info->GetHeader()->GetBlockId();
}
}
}
@@ -281,7 +337,7 @@
output_ << bci << " " << num_uses << " "
<< GetTypeId(instruction->GetType()) << instruction->GetId() << " ";
PrintInstruction(instruction);
- output_ << kEndInstructionMarker << std::endl;
+ output_ << " " << kEndInstructionMarker << std::endl;
}
}
diff --git a/compiler/optimizing/ssa_liveness_analysis.h b/compiler/optimizing/ssa_liveness_analysis.h
index 5ee44a8..ce4bbd4 100644
--- a/compiler/optimizing/ssa_liveness_analysis.h
+++ b/compiler/optimizing/ssa_liveness_analysis.h
@@ -76,7 +76,7 @@
}
void Dump(std::ostream& stream) const {
- stream << "[" << start_ << ", " << end_ << ")";
+ stream << start_ << "-" << end_;
}
LiveRange* Dup(ArenaAllocator* allocator) const {
diff --git a/compiler/utils/arm/assembler_arm.h b/compiler/utils/arm/assembler_arm.h
index 313f365..dee8287 100644
--- a/compiler/utils/arm/assembler_arm.h
+++ b/compiler/utils/arm/assembler_arm.h
@@ -398,6 +398,8 @@
Condition cond = AL) = 0;
virtual void mls(Register rd, Register rn, Register rm, Register ra,
Condition cond = AL) = 0;
+ virtual void smull(Register rd_lo, Register rd_hi, Register rn, Register rm,
+ Condition cond = AL) = 0;
virtual void umull(Register rd_lo, Register rd_hi, Register rn, Register rm,
Condition cond = AL) = 0;
diff --git a/compiler/utils/arm/assembler_arm32.cc b/compiler/utils/arm/assembler_arm32.cc
index 9579691..6e165fc 100644
--- a/compiler/utils/arm/assembler_arm32.cc
+++ b/compiler/utils/arm/assembler_arm32.cc
@@ -200,6 +200,13 @@
}
+void Arm32Assembler::smull(Register rd_lo, Register rd_hi, Register rn,
+ Register rm, Condition cond) {
+ // Assembler registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
+ EmitMulOp(cond, B23 | B22, rd_lo, rd_hi, rn, rm);
+}
+
+
void Arm32Assembler::umull(Register rd_lo, Register rd_hi, Register rn,
Register rm, Condition cond) {
// Assembler registers rd_lo, rd_hi, rn, rm are encoded as rd, rn, rm, rs.
diff --git a/compiler/utils/arm/assembler_arm32.h b/compiler/utils/arm/assembler_arm32.h
index b922d66..55ec7b4 100644
--- a/compiler/utils/arm/assembler_arm32.h
+++ b/compiler/utils/arm/assembler_arm32.h
@@ -90,6 +90,8 @@
Condition cond = AL) OVERRIDE;
void mls(Register rd, Register rn, Register rm, Register ra,
Condition cond = AL) OVERRIDE;
+ void smull(Register rd_lo, Register rd_hi, Register rn, Register rm,
+ Condition cond = AL) OVERRIDE;
void umull(Register rd_lo, Register rd_hi, Register rn, Register rm,
Condition cond = AL) OVERRIDE;
diff --git a/compiler/utils/arm/assembler_arm32_test.cc b/compiler/utils/arm/assembler_arm32_test.cc
index 4a0ae0b..efd517b 100644
--- a/compiler/utils/arm/assembler_arm32_test.cc
+++ b/compiler/utils/arm/assembler_arm32_test.cc
@@ -293,12 +293,29 @@
f();
}
+ // NOTE: Only support simple test like "aaa=bbb"
+ bool EvalFilterString(std::string filter) {
+ if (filter.compare("") == 0) {
+ return false;
+ }
+
+ size_t equal_sign_index = filter.find('=');
+ if (equal_sign_index == std::string::npos) {
+ EXPECT_TRUE(false) << "Unsupported filter string.";
+ }
+
+ std::string lhs = filter.substr(0, equal_sign_index);
+ std::string rhs = filter.substr(equal_sign_index + 1, std::string::npos);
+ return lhs.compare(rhs) == 0;
+ }
+
void TemplateHelper(std::function<void(arm::Register)> f, int depth ATTRIBUTE_UNUSED,
- bool without_pc,
- std::string fmt, std::ostringstream& oss) {
+ bool without_pc, std::string fmt, std::string filter,
+ std::ostringstream& oss) {
std::vector<arm::Register*> registers = without_pc ? GetRegistersWithoutPC() : GetRegisters();
for (auto reg : registers) {
std::string after_reg = fmt;
+ std::string after_reg_filter = filter;
std::string reg_string = GetRegName<RegisterView::kUsePrimaryName>(*reg);
size_t reg_index;
@@ -308,14 +325,23 @@
after_reg.replace(reg_index, strlen(reg_token), reg_string);
}
+ while ((reg_index = after_reg_filter.find(reg_token)) != std::string::npos) {
+ after_reg_filter.replace(reg_index, strlen(reg_token), reg_string);
+ }
+ if (EvalFilterString(after_reg_filter)) {
+ continue;
+ }
+
ExecuteAndPrint([&] () { f(*reg); }, after_reg, oss);
}
}
void TemplateHelper(std::function<void(const arm::ShifterOperand&)> f, int depth ATTRIBUTE_UNUSED,
- bool without_pc ATTRIBUTE_UNUSED, std::string fmt, std::ostringstream& oss) {
+ bool without_pc ATTRIBUTE_UNUSED, std::string fmt, std::string filter,
+ std::ostringstream& oss) {
for (const arm::ShifterOperand& shift : GetShiftOperands()) {
std::string after_shift = fmt;
+ std::string after_shift_filter = filter;
std::string shift_string = GetShiftString(shift);
size_t shift_index;
@@ -323,30 +349,48 @@
after_shift.replace(shift_index, ConstexprStrLen(SHIFT_TOKEN), shift_string);
}
+ while ((shift_index = after_shift_filter.find(SHIFT_TOKEN)) != std::string::npos) {
+ after_shift_filter.replace(shift_index, ConstexprStrLen(SHIFT_TOKEN), shift_string);
+ }
+ if (EvalFilterString(after_shift_filter)) {
+ continue;
+ }
+
ExecuteAndPrint([&] () { f(shift); }, after_shift, oss);
}
}
void TemplateHelper(std::function<void(arm::Condition)> f, int depth ATTRIBUTE_UNUSED,
- bool without_pc ATTRIBUTE_UNUSED, std::string fmt, std::ostringstream& oss) {
+ bool without_pc ATTRIBUTE_UNUSED, std::string fmt, std::string filter,
+ std::ostringstream& oss) {
for (arm::Condition c : GetConditions()) {
std::string after_cond = fmt;
+ std::string after_cond_filter = filter;
size_t cond_index = after_cond.find(COND_TOKEN);
if (cond_index != std::string::npos) {
after_cond.replace(cond_index, ConstexprStrLen(IMM1_TOKEN), GetConditionString(c));
}
+ cond_index = after_cond_filter.find(COND_TOKEN);
+ if (cond_index != std::string::npos) {
+ after_cond_filter.replace(cond_index, ConstexprStrLen(IMM1_TOKEN), GetConditionString(c));
+ }
+ if (EvalFilterString(after_cond_filter)) {
+ continue;
+ }
+
ExecuteAndPrint([&] () { f(c); }, after_cond, oss);
}
}
template <typename... Args>
void TemplateHelper(std::function<void(arm::Register, Args...)> f, int depth, bool without_pc,
- std::string fmt, std::ostringstream& oss) {
+ std::string fmt, std::string filter, std::ostringstream& oss) {
std::vector<arm::Register*> registers = without_pc ? GetRegistersWithoutPC() : GetRegisters();
for (auto reg : registers) {
std::string after_reg = fmt;
+ std::string after_reg_filter = filter;
std::string reg_string = GetRegName<RegisterView::kUsePrimaryName>(*reg);
size_t reg_index;
@@ -356,17 +400,26 @@
after_reg.replace(reg_index, strlen(reg_token), reg_string);
}
+ while ((reg_index = after_reg_filter.find(reg_token)) != std::string::npos) {
+ after_reg_filter.replace(reg_index, strlen(reg_token), reg_string);
+ }
+ if (EvalFilterString(after_reg_filter)) {
+ continue;
+ }
+
auto lambda = [&] (Args... args) { f(*reg, args...); }; // NOLINT [readability/braces] [4]
TemplateHelper(std::function<void(Args...)>(lambda), depth + 1, without_pc,
- after_reg, oss);
+ after_reg, after_reg_filter, oss);
}
}
template <typename... Args>
void TemplateHelper(std::function<void(const arm::ShifterOperand&, Args...)> f, int depth,
- bool without_pc, std::string fmt, std::ostringstream& oss) {
+ bool without_pc, std::string fmt, std::string filter,
+ std::ostringstream& oss) {
for (const arm::ShifterOperand& shift : GetShiftOperands()) {
std::string after_shift = fmt;
+ std::string after_shift_filter = filter;
std::string shift_string = GetShiftString(shift);
size_t shift_index;
@@ -374,26 +427,42 @@
after_shift.replace(shift_index, ConstexprStrLen(SHIFT_TOKEN), shift_string);
}
+ while ((shift_index = after_shift_filter.find(SHIFT_TOKEN)) != std::string::npos) {
+ after_shift_filter.replace(shift_index, ConstexprStrLen(SHIFT_TOKEN), shift_string);
+ }
+ if (EvalFilterString(after_shift_filter)) {
+ continue;
+ }
+
auto lambda = [&] (Args... args) { f(shift, args...); }; // NOLINT [readability/braces] [4]
TemplateHelper(std::function<void(Args...)>(lambda), depth, without_pc,
- after_shift, oss);
+ after_shift, after_shift_filter, oss);
}
}
template <typename... Args>
void TemplateHelper(std::function<void(arm::Condition, Args...)> f, int depth, bool without_pc,
- std::string fmt, std::ostringstream& oss) {
+ std::string fmt, std::string filter, std::ostringstream& oss) {
for (arm::Condition c : GetConditions()) {
std::string after_cond = fmt;
+ std::string after_cond_filter = filter;
size_t cond_index = after_cond.find(COND_TOKEN);
if (cond_index != std::string::npos) {
after_cond.replace(cond_index, ConstexprStrLen(IMM1_TOKEN), GetConditionString(c));
}
+ cond_index = after_cond_filter.find(COND_TOKEN);
+ if (cond_index != std::string::npos) {
+ after_cond_filter.replace(cond_index, ConstexprStrLen(IMM1_TOKEN), GetConditionString(c));
+ }
+ if (EvalFilterString(after_cond_filter)) {
+ continue;
+ }
+
auto lambda = [&] (Args... args) { f(c, args...); }; // NOLINT [readability/braces] [4]
TemplateHelper(std::function<void(Args...)>(lambda), depth, without_pc,
- after_cond, oss);
+ after_cond, after_cond_filter, oss);
}
}
@@ -421,13 +490,13 @@
template <typename... Args>
void GenericTemplateHelper(std::function<void(Args...)> f, bool without_pc,
- std::string fmt, std::string test_name) {
+ std::string fmt, std::string test_name, std::string filter) {
first_ = false;
WarnOnCombinations(CountHelper<Args...>(without_pc));
std::ostringstream oss;
- TemplateHelper(f, 0, without_pc, fmt, oss);
+ TemplateHelper(f, 0, without_pc, fmt, filter, oss);
oss << "\n"; // Trailing newline.
@@ -436,26 +505,26 @@
template <typename... Args>
void T2Helper(void (arm::Arm32Assembler::*f)(Args...), bool without_pc, std::string fmt,
- std::string test_name) {
- GenericTemplateHelper(GetBoundFunction2(f), without_pc, fmt, test_name);
+ std::string test_name, std::string filter = "") {
+ GenericTemplateHelper(GetBoundFunction2(f), without_pc, fmt, test_name, filter);
}
template <typename... Args>
void T3Helper(void (arm::Arm32Assembler::*f)(Args...), bool without_pc, std::string fmt,
- std::string test_name) {
- GenericTemplateHelper(GetBoundFunction3(f), without_pc, fmt, test_name);
+ std::string test_name, std::string filter = "") {
+ GenericTemplateHelper(GetBoundFunction3(f), without_pc, fmt, test_name, filter);
}
template <typename... Args>
void T4Helper(void (arm::Arm32Assembler::*f)(Args...), bool without_pc, std::string fmt,
- std::string test_name) {
- GenericTemplateHelper(GetBoundFunction4(f), without_pc, fmt, test_name);
+ std::string test_name, std::string filter = "") {
+ GenericTemplateHelper(GetBoundFunction4(f), without_pc, fmt, test_name, filter);
}
template <typename... Args>
void T5Helper(void (arm::Arm32Assembler::*f)(Args...), bool without_pc, std::string fmt,
- std::string test_name) {
- GenericTemplateHelper(GetBoundFunction5(f), without_pc, fmt, test_name);
+ std::string test_name, std::string filter = "") {
+ GenericTemplateHelper(GetBoundFunction5(f), without_pc, fmt, test_name, filter);
}
private:
@@ -565,15 +634,18 @@
}
TEST_F(AssemblerArm32Test, Mla) {
- T5Helper(&arm::Arm32Assembler::mla, true, "mla{cond} {reg1}, {reg2}, {reg3}, {reg4}", "mul");
+ T5Helper(&arm::Arm32Assembler::mla, true, "mla{cond} {reg1}, {reg2}, {reg3}, {reg4}", "mla");
}
-/* TODO: Needs support to filter out register combinations, as rdhi must not be equal to rdlo.
TEST_F(AssemblerArm32Test, Umull) {
T5Helper(&arm::Arm32Assembler::umull, true, "umull{cond} {reg1}, {reg2}, {reg3}, {reg4}",
- "umull");
+ "umull", "{reg1}={reg2}"); // Skip the cases where reg1 == reg2.
}
-*/
+
+TEST_F(AssemblerArm32Test, Smull) {
+ T5Helper(&arm::Arm32Assembler::smull, true, "smull{cond} {reg1}, {reg2}, {reg3}, {reg4}",
+ "smull", "{reg1}={reg2}"); // Skip the cases where reg1 == reg2.
+}
TEST_F(AssemblerArm32Test, Sdiv) {
T4Helper(&arm::Arm32Assembler::sdiv, true, "sdiv{cond} {reg1}, {reg2}, {reg3}", "sdiv");
@@ -655,9 +727,10 @@
T4Helper(&arm::Arm32Assembler::rsc, true, "rsc{cond} {reg1}, {reg2}, {shift}", "rsc");
}
-/* TODO: Needs support to filter out register combinations, as reg1 must not be equal to reg3.
+/* TODO: Need better filter support.
TEST_F(AssemblerArm32Test, Strex) {
- RRRCWithoutPCHelper(&arm::Arm32Assembler::strex, "strex{cond} {reg1}, {reg2}, [{reg3}]", "strex");
+ T4Helper(&arm::Arm32Assembler::strex, "strex{cond} {reg1}, {reg2}, [{reg3}]", "strex",
+ "{reg1}={reg2}||{reg1}={reg3}"); // Skip the cases where reg1 == reg2 || reg1 == reg3.
}
*/
diff --git a/compiler/utils/arm/assembler_thumb2.cc b/compiler/utils/arm/assembler_thumb2.cc
index 3b42f63..e7cf26e 100644
--- a/compiler/utils/arm/assembler_thumb2.cc
+++ b/compiler/utils/arm/assembler_thumb2.cc
@@ -238,6 +238,24 @@
}
+void Thumb2Assembler::smull(Register rd_lo, Register rd_hi, Register rn,
+ Register rm, Condition cond) {
+ CheckCondition(cond);
+
+ uint32_t op1 = 0U /* 0b000; */;
+ uint32_t op2 = 0U /* 0b0000 */;
+ int32_t encoding = B31 | B30 | B29 | B28 | B27 | B25 | B24 | B23 |
+ op1 << 20 |
+ op2 << 4 |
+ static_cast<uint32_t>(rd_lo) << 12 |
+ static_cast<uint32_t>(rd_hi) << 8 |
+ static_cast<uint32_t>(rn) << 16 |
+ static_cast<uint32_t>(rm);
+
+ Emit32(encoding);
+}
+
+
void Thumb2Assembler::umull(Register rd_lo, Register rd_hi, Register rn,
Register rm, Condition cond) {
CheckCondition(cond);
@@ -740,13 +758,6 @@
return true;
}
- // Check for MOV with an ROR.
- if (opcode == MOV && so.IsRegister() && so.IsShift() && so.GetShift() == ROR) {
- if (so.GetImmediate() != 0) {
- return true;
- }
- }
-
bool rn_is_valid = true;
// Check for single operand instructions and ADD/SUB.
@@ -792,6 +803,19 @@
}
}
+ // Check for register shift operand.
+ if (so.IsRegister() && so.IsShift()) {
+ if (opcode != MOV) {
+ return true;
+ }
+ // Check for MOV with an ROR.
+ if (so.GetShift() == ROR) {
+ if (so.GetImmediate() != 0) {
+ return true;
+ }
+ }
+ }
+
// The instruction can be encoded in 16 bits.
return false;
}
diff --git a/compiler/utils/arm/assembler_thumb2.h b/compiler/utils/arm/assembler_thumb2.h
index e33c240..17eae8b 100644
--- a/compiler/utils/arm/assembler_thumb2.h
+++ b/compiler/utils/arm/assembler_thumb2.h
@@ -112,6 +112,8 @@
Condition cond = AL) OVERRIDE;
void mls(Register rd, Register rn, Register rm, Register ra,
Condition cond = AL) OVERRIDE;
+ void smull(Register rd_lo, Register rd_hi, Register rn, Register rm,
+ Condition cond = AL) OVERRIDE;
void umull(Register rd_lo, Register rd_hi, Register rn, Register rm,
Condition cond = AL) OVERRIDE;
diff --git a/compiler/utils/arm/assembler_thumb2_test.cc b/compiler/utils/arm/assembler_thumb2_test.cc
index 5f5561a..733441b 100644
--- a/compiler/utils/arm/assembler_thumb2_test.cc
+++ b/compiler/utils/arm/assembler_thumb2_test.cc
@@ -89,23 +89,24 @@
EXPECT_TRUE(CheckTools());
}
+#define __ GetAssembler()->
TEST_F(AssemblerThumb2Test, Sbfx) {
- GetAssembler()->sbfx(arm::R0, arm::R1, 0, 1);
- GetAssembler()->sbfx(arm::R0, arm::R1, 0, 8);
- GetAssembler()->sbfx(arm::R0, arm::R1, 0, 16);
- GetAssembler()->sbfx(arm::R0, arm::R1, 0, 32);
+ __ sbfx(arm::R0, arm::R1, 0, 1);
+ __ sbfx(arm::R0, arm::R1, 0, 8);
+ __ sbfx(arm::R0, arm::R1, 0, 16);
+ __ sbfx(arm::R0, arm::R1, 0, 32);
- GetAssembler()->sbfx(arm::R0, arm::R1, 8, 1);
- GetAssembler()->sbfx(arm::R0, arm::R1, 8, 8);
- GetAssembler()->sbfx(arm::R0, arm::R1, 8, 16);
- GetAssembler()->sbfx(arm::R0, arm::R1, 8, 24);
+ __ sbfx(arm::R0, arm::R1, 8, 1);
+ __ sbfx(arm::R0, arm::R1, 8, 8);
+ __ sbfx(arm::R0, arm::R1, 8, 16);
+ __ sbfx(arm::R0, arm::R1, 8, 24);
- GetAssembler()->sbfx(arm::R0, arm::R1, 16, 1);
- GetAssembler()->sbfx(arm::R0, arm::R1, 16, 8);
- GetAssembler()->sbfx(arm::R0, arm::R1, 16, 16);
+ __ sbfx(arm::R0, arm::R1, 16, 1);
+ __ sbfx(arm::R0, arm::R1, 16, 8);
+ __ sbfx(arm::R0, arm::R1, 16, 16);
- GetAssembler()->sbfx(arm::R0, arm::R1, 31, 1);
+ __ sbfx(arm::R0, arm::R1, 31, 1);
const char* expected =
"sbfx r0, r1, #0, #1\n"
@@ -127,21 +128,21 @@
}
TEST_F(AssemblerThumb2Test, Ubfx) {
- GetAssembler()->ubfx(arm::R0, arm::R1, 0, 1);
- GetAssembler()->ubfx(arm::R0, arm::R1, 0, 8);
- GetAssembler()->ubfx(arm::R0, arm::R1, 0, 16);
- GetAssembler()->ubfx(arm::R0, arm::R1, 0, 32);
+ __ ubfx(arm::R0, arm::R1, 0, 1);
+ __ ubfx(arm::R0, arm::R1, 0, 8);
+ __ ubfx(arm::R0, arm::R1, 0, 16);
+ __ ubfx(arm::R0, arm::R1, 0, 32);
- GetAssembler()->ubfx(arm::R0, arm::R1, 8, 1);
- GetAssembler()->ubfx(arm::R0, arm::R1, 8, 8);
- GetAssembler()->ubfx(arm::R0, arm::R1, 8, 16);
- GetAssembler()->ubfx(arm::R0, arm::R1, 8, 24);
+ __ ubfx(arm::R0, arm::R1, 8, 1);
+ __ ubfx(arm::R0, arm::R1, 8, 8);
+ __ ubfx(arm::R0, arm::R1, 8, 16);
+ __ ubfx(arm::R0, arm::R1, 8, 24);
- GetAssembler()->ubfx(arm::R0, arm::R1, 16, 1);
- GetAssembler()->ubfx(arm::R0, arm::R1, 16, 8);
- GetAssembler()->ubfx(arm::R0, arm::R1, 16, 16);
+ __ ubfx(arm::R0, arm::R1, 16, 1);
+ __ ubfx(arm::R0, arm::R1, 16, 8);
+ __ ubfx(arm::R0, arm::R1, 16, 16);
- GetAssembler()->ubfx(arm::R0, arm::R1, 31, 1);
+ __ ubfx(arm::R0, arm::R1, 31, 1);
const char* expected =
"ubfx r0, r1, #0, #1\n"
@@ -163,7 +164,7 @@
}
TEST_F(AssemblerThumb2Test, Vmstat) {
- GetAssembler()->vmstat();
+ __ vmstat();
const char* expected = "vmrs APSR_nzcv, FPSCR\n";
@@ -171,10 +172,10 @@
}
TEST_F(AssemblerThumb2Test, ldrexd) {
- GetAssembler()->ldrexd(arm::R0, arm::R1, arm::R0);
- GetAssembler()->ldrexd(arm::R0, arm::R1, arm::R1);
- GetAssembler()->ldrexd(arm::R0, arm::R1, arm::R2);
- GetAssembler()->ldrexd(arm::R5, arm::R3, arm::R7);
+ __ ldrexd(arm::R0, arm::R1, arm::R0);
+ __ ldrexd(arm::R0, arm::R1, arm::R1);
+ __ ldrexd(arm::R0, arm::R1, arm::R2);
+ __ ldrexd(arm::R5, arm::R3, arm::R7);
const char* expected =
"ldrexd r0, r1, [r0]\n"
@@ -185,10 +186,10 @@
}
TEST_F(AssemblerThumb2Test, strexd) {
- GetAssembler()->strexd(arm::R9, arm::R0, arm::R1, arm::R0);
- GetAssembler()->strexd(arm::R9, arm::R0, arm::R1, arm::R1);
- GetAssembler()->strexd(arm::R9, arm::R0, arm::R1, arm::R2);
- GetAssembler()->strexd(arm::R9, arm::R5, arm::R3, arm::R7);
+ __ strexd(arm::R9, arm::R0, arm::R1, arm::R0);
+ __ strexd(arm::R9, arm::R0, arm::R1, arm::R1);
+ __ strexd(arm::R9, arm::R0, arm::R1, arm::R2);
+ __ strexd(arm::R9, arm::R5, arm::R3, arm::R7);
const char* expected =
"strexd r9, r0, r1, [r0]\n"
@@ -199,9 +200,9 @@
}
TEST_F(AssemblerThumb2Test, LdrdStrd) {
- GetAssembler()->ldrd(arm::R0, arm::Address(arm::R2, 8));
- GetAssembler()->ldrd(arm::R0, arm::Address(arm::R12));
- GetAssembler()->strd(arm::R0, arm::Address(arm::R2, 8));
+ __ ldrd(arm::R0, arm::Address(arm::R2, 8));
+ __ ldrd(arm::R0, arm::Address(arm::R12));
+ __ strd(arm::R0, arm::Address(arm::R2, 8));
const char* expected =
"ldrd r0, r1, [r2, #8]\n"
@@ -211,7 +212,6 @@
}
TEST_F(AssemblerThumb2Test, eor) {
-#define __ GetAssembler()->
__ eor(arm::R1, arm::R1, arm::ShifterOperand(arm::R0));
__ eor(arm::R1, arm::R0, arm::ShifterOperand(arm::R1));
__ eor(arm::R1, arm::R8, arm::ShifterOperand(arm::R0));
@@ -230,23 +230,47 @@
TEST_F(AssemblerThumb2Test, sub) {
__ subs(arm::R1, arm::R0, arm::ShifterOperand(42));
__ sub(arm::R1, arm::R0, arm::ShifterOperand(42));
+ __ subs(arm::R1, arm::R0, arm::ShifterOperand(arm::R2, arm::ASR, 31));
+ __ sub(arm::R1, arm::R0, arm::ShifterOperand(arm::R2, arm::ASR, 31));
const char* expected =
"subs r1, r0, #42\n"
- "subw r1, r0, #42\n";
+ "subw r1, r0, #42\n"
+ "subs r1, r0, r2, asr #31\n"
+ "sub r1, r0, r2, asr #31\n";
DriverStr(expected, "sub");
}
TEST_F(AssemblerThumb2Test, add) {
__ adds(arm::R1, arm::R0, arm::ShifterOperand(42));
__ add(arm::R1, arm::R0, arm::ShifterOperand(42));
+ __ adds(arm::R1, arm::R0, arm::ShifterOperand(arm::R2, arm::ASR, 31));
+ __ add(arm::R1, arm::R0, arm::ShifterOperand(arm::R2, arm::ASR, 31));
const char* expected =
"adds r1, r0, #42\n"
- "addw r1, r0, #42\n";
+ "addw r1, r0, #42\n"
+ "adds r1, r0, r2, asr #31\n"
+ "add r1, r0, r2, asr #31\n";
DriverStr(expected, "add");
}
+TEST_F(AssemblerThumb2Test, umull) {
+ __ umull(arm::R0, arm::R1, arm::R2, arm::R3);
+
+ const char* expected =
+ "umull r0, r1, r2, r3\n";
+ DriverStr(expected, "umull");
+}
+
+TEST_F(AssemblerThumb2Test, smull) {
+ __ smull(arm::R0, arm::R1, arm::R2, arm::R3);
+
+ const char* expected =
+ "smull r0, r1, r2, r3\n";
+ DriverStr(expected, "smull");
+}
+
TEST_F(AssemblerThumb2Test, StoreWordToThumbOffset) {
arm::StoreOperandType type = arm::kStoreWord;
int32_t offset = 4092;
diff --git a/runtime/base/unix_file/fd_file.cc b/runtime/base/unix_file/fd_file.cc
index f272d88..07cadc4 100644
--- a/runtime/base/unix_file/fd_file.cc
+++ b/runtime/base/unix_file/fd_file.cc
@@ -107,7 +107,7 @@
}
int FdFile::Close() {
- int result = TEMP_FAILURE_RETRY(close(fd_));
+ int result = close(fd_);
// Test here, so the file is closed and not leaked.
if (kCheckSafeUsage) {
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index 4bc9f98..852ba49 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -411,7 +411,7 @@
}
void SingleStepControl::VisitRoots(RootVisitor* visitor, const RootInfo& root_info) {
- visitor->VisitRootIfNonNull(reinterpret_cast<mirror::Object**>(&method_), root_info);
+ method_.VisitRootIfNonNull(visitor, root_info);
}
void SingleStepControl::AddDexPc(uint32_t dex_pc) {
@@ -2929,10 +2929,11 @@
if (!IsDebuggerActive()) {
return;
}
- StackHandleScope<1> handle_scope(Thread::Current());
+ Thread* const self = Thread::Current();
+ StackHandleScope<1> handle_scope(self);
Handle<mirror::Throwable> h_exception(handle_scope.NewHandle(exception_object));
std::unique_ptr<Context> context(Context::Create());
- CatchLocationFinder clf(Thread::Current(), h_exception, context.get());
+ CatchLocationFinder clf(self, h_exception, context.get());
clf.WalkStack(/* include_transitions */ false);
JDWP::EventLocation exception_throw_location;
SetEventLocation(&exception_throw_location, clf.GetThrowMethod(), clf.GetThrowDexPc());
@@ -3981,7 +3982,7 @@
Handle<mirror::Object> object_result = hs.NewHandle(is_object_result ? result.GetL() : nullptr);
Handle<mirror::Throwable> exception = hs.NewHandle(soa.Self()->GetException());
soa.Self()->ClearException();
- pReq->exception = gRegistry->Add(exception.Get());
+ pReq->exception = gRegistry->Add(exception);
if (pReq->exception != 0) {
VLOG(jdwp) << " JDWP invocation returning with exception=" << exception.Get()
<< " " << exception->Dump();
diff --git a/runtime/debugger.h b/runtime/debugger.h
index 789a0a4..811d345 100644
--- a/runtime/debugger.h
+++ b/runtime/debugger.h
@@ -109,8 +109,8 @@
return stack_depth_;
}
- mirror::ArtMethod* GetMethod() const {
- return method_;
+ mirror::ArtMethod* GetMethod() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ return method_.Read();
}
const std::set<uint32_t>& GetDexPcs() const {
@@ -138,7 +138,7 @@
// set of DEX pcs associated to the source line number where the suspension occurred.
// This is used to support SD_INTO and SD_OVER single-step depths so we detect when a single-step
// causes the execution of an instruction in a different method or at a different line number.
- mirror::ArtMethod* method_;
+ GcRoot<mirror::ArtMethod> method_;
std::set<uint32_t> dex_pcs_;
DISALLOW_COPY_AND_ASSIGN(SingleStepControl);
diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc
index 9006257..317106b 100644
--- a/runtime/interpreter/unstarted_runtime.cc
+++ b/runtime/interpreter/unstarted_runtime.cc
@@ -767,8 +767,12 @@
AbortTransactionOrFail(self, "String.getCharsNoCheck with null object");
return;
}
+ DCHECK_GE(start, 0);
+ DCHECK_GE(end, string->GetLength());
StackHandleScope<1> hs(self);
Handle<mirror::CharArray> h_char_array(hs.NewHandle(shadow_frame->GetVRegReference(arg_offset + 3)->AsCharArray()));
+ DCHECK_LE(index, h_char_array->GetLength());
+ DCHECK_LE(end - start, h_char_array->GetLength() - index);
string->GetChars(start, end, h_char_array, index);
}
@@ -785,6 +789,20 @@
result->SetC(string->CharAt(index));
}
+// This allows setting chars from the new style of String objects during compilation.
+static void UnstartedStringSetCharAt(
+ Thread* self, ShadowFrame* shadow_frame, JValue* result ATTRIBUTE_UNUSED, size_t arg_offset)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ jint index = shadow_frame->GetVReg(arg_offset + 1);
+ jchar c = shadow_frame->GetVReg(arg_offset + 2);
+ mirror::String* string = shadow_frame->GetVRegReference(arg_offset)->AsString();
+ if (string == nullptr) {
+ AbortTransactionOrFail(self, "String.setCharAt with null object");
+ return;
+ }
+ string->SetCharAt(index, c);
+}
+
// This allows creating the new style of String objects during compilation.
static void UnstartedStringFactoryNewStringFromChars(
Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset)
@@ -800,19 +818,51 @@
}
// This allows creating the new style of String objects during compilation.
+static void UnstartedStringFactoryNewStringFromString(
+ Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ mirror::String* to_copy = shadow_frame->GetVRegReference(arg_offset)->AsString();
+ if (to_copy == nullptr) {
+ AbortTransactionOrFail(self, "StringFactory.newStringFromString with null object");
+ return;
+ }
+ StackHandleScope<1> hs(self);
+ Handle<mirror::String> h_string(hs.NewHandle(to_copy));
+ Runtime* runtime = Runtime::Current();
+ gc::AllocatorType allocator = runtime->GetHeap()->GetCurrentAllocator();
+ result->SetL(mirror::String::AllocFromString<true>(self, h_string->GetLength(), h_string, 0,
+ allocator));
+}
+
+// This allows creating the new style of String objects during compilation.
static void UnstartedStringFastSubstring(
Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
jint start = shadow_frame->GetVReg(arg_offset + 1);
jint length = shadow_frame->GetVReg(arg_offset + 2);
+ DCHECK_GE(start, 0);
DCHECK_GE(length, 0);
StackHandleScope<1> hs(self);
Handle<mirror::String> h_string(hs.NewHandle(shadow_frame->GetVRegReference(arg_offset)->AsString()));
+ DCHECK_LE(start, h_string->GetLength());
+ DCHECK_LE(start + length, h_string->GetLength());
Runtime* runtime = Runtime::Current();
gc::AllocatorType allocator = runtime->GetHeap()->GetCurrentAllocator();
result->SetL(mirror::String::AllocFromString<true>(self, length, h_string, start, allocator));
}
+// This allows getting the char array for new style of String objects during compilation.
+static void UnstartedStringToCharArray(
+ Thread* self, ShadowFrame* shadow_frame, JValue* result, size_t arg_offset)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ mirror::String* string = shadow_frame->GetVRegReference(arg_offset)->AsString();
+ if (string == nullptr) {
+ AbortTransactionOrFail(self, "String.charAt with null object");
+ return;
+ }
+ result->SetL(string->ToCharArray(self));
+}
+
static void UnstartedJNIVMRuntimeNewUnpaddedArray(Thread* self,
mirror::ArtMethod* method ATTRIBUTE_UNUSED,
mirror::Object* receiver ATTRIBUTE_UNUSED,
@@ -1141,10 +1191,16 @@
&UnstartedStringGetCharsNoCheck },
{ "char java.lang.String.charAt(int)",
&UnstartedStringCharAt },
+ { "void java.lang.String.setCharAt(int, char)",
+ &UnstartedStringSetCharAt },
{ "java.lang.String java.lang.StringFactory.newStringFromChars(int, int, char[])",
&UnstartedStringFactoryNewStringFromChars },
+ { "java.lang.String java.lang.StringFactory.newStringFromString(java.lang.String)",
+ &UnstartedStringFactoryNewStringFromString },
{ "java.lang.String java.lang.String.fastSubstring(int, int)",
&UnstartedStringFastSubstring },
+ { "char[] java.lang.String.toCharArray()",
+ &UnstartedStringToCharArray },
};
for (auto& def : defs) {
@@ -1228,6 +1284,8 @@
std::string name(PrettyMethod(shadow_frame->GetMethod()));
const auto& iter = invoke_handlers_.find(name);
if (iter != invoke_handlers_.end()) {
+ // Clear out the result in case it's not zeroed out.
+ result->SetL(0);
(*iter->second)(self, shadow_frame, result, arg_offset);
} else {
// Not special, continue with regular interpreter execution.
@@ -1241,6 +1299,8 @@
std::string name(PrettyMethod(method));
const auto& iter = jni_handlers_.find(name);
if (iter != jni_handlers_.end()) {
+ // Clear out the result in case it's not zeroed out.
+ result->SetL(0);
(*iter->second)(self, method, receiver, args, result);
} else if (Runtime::Current()->IsActiveTransaction()) {
AbortTransactionF(self, "Attempt to invoke native method in non-started runtime: %s",
diff --git a/runtime/jdwp/jdwp_event.cc b/runtime/jdwp/jdwp_event.cc
index ab3f2e4..ff75268 100644
--- a/runtime/jdwp/jdwp_event.cc
+++ b/runtime/jdwp/jdwp_event.cc
@@ -32,6 +32,8 @@
#include "scoped_thread_state_change.h"
#include "thread-inl.h"
+#include "handle_scope-inl.h"
+
/*
General notes:
@@ -108,20 +110,32 @@
* Stuff to compare against when deciding if a mod matches. Only the
* values for mods valid for the event being evaluated will be filled in.
* The rest will be zeroed.
+ * Must be allocated on the stack only. This is enforced by removing the
+ * operator new.
*/
struct ModBasket {
- ModBasket() : pLoc(nullptr), thread(nullptr), locationClass(nullptr), exceptionClass(nullptr),
- caught(false), field(nullptr), thisPtr(nullptr) { }
+ explicit ModBasket(Thread* self)
+ : hs(self), pLoc(nullptr), thread(self),
+ locationClass(hs.NewHandle<mirror::Class>(nullptr)),
+ exceptionClass(hs.NewHandle<mirror::Class>(nullptr)),
+ caught(false),
+ field(nullptr),
+ thisPtr(hs.NewHandle<mirror::Object>(nullptr)) { }
- const EventLocation* pLoc; /* LocationOnly */
- std::string className; /* ClassMatch/ClassExclude */
- Thread* thread; /* ThreadOnly */
- mirror::Class* locationClass; /* ClassOnly */
- mirror::Class* exceptionClass; /* ExceptionOnly */
- bool caught; /* ExceptionOnly */
- ArtField* field; /* FieldOnly */
- mirror::Object* thisPtr; /* InstanceOnly */
+ StackHandleScope<3> hs;
+ const EventLocation* pLoc; /* LocationOnly */
+ std::string className; /* ClassMatch/ClassExclude */
+ Thread* const thread; /* ThreadOnly */
+ MutableHandle<mirror::Class> locationClass; /* ClassOnly */
+ MutableHandle<mirror::Class> exceptionClass; /* ExceptionOnly */
+ bool caught; /* ExceptionOnly */
+ ArtField* field; /* FieldOnly */
+ MutableHandle<mirror::Object> thisPtr; /* InstanceOnly */
/* nothing for StepOnly -- handled differently */
+
+ private:
+ DISALLOW_ALLOCATION(); // forbids allocation on the heap.
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ModBasket);
};
static bool NeedsFullDeoptimization(JdwpEventKind eventKind) {
@@ -457,7 +471,7 @@
}
break;
case MK_CLASS_ONLY:
- if (!Dbg::MatchType(basket.locationClass, pMod->classOnly.refTypeId)) {
+ if (!Dbg::MatchType(basket.locationClass.Get(), pMod->classOnly.refTypeId)) {
return false;
}
break;
@@ -478,7 +492,7 @@
break;
case MK_EXCEPTION_ONLY:
if (pMod->exceptionOnly.refTypeId != 0 &&
- !Dbg::MatchType(basket.exceptionClass, pMod->exceptionOnly.refTypeId)) {
+ !Dbg::MatchType(basket.exceptionClass.Get(), pMod->exceptionOnly.refTypeId)) {
return false;
}
if ((basket.caught && !pMod->exceptionOnly.caught) ||
@@ -497,7 +511,7 @@
}
break;
case MK_INSTANCE_ONLY:
- if (!Dbg::MatchInstance(pMod->instanceOnly.objectId, basket.thisPtr)) {
+ if (!Dbg::MatchInstance(pMod->instanceOnly.objectId, basket.thisPtr.Get())) {
return false;
}
break;
@@ -825,12 +839,11 @@
DCHECK(pLoc->method != nullptr);
DCHECK_EQ(pLoc->method->IsStatic(), thisPtr == nullptr);
- ModBasket basket;
+ ModBasket basket(Thread::Current());
basket.pLoc = pLoc;
- basket.locationClass = pLoc->method->GetDeclaringClass();
- basket.thisPtr = thisPtr;
- basket.thread = Thread::Current();
- basket.className = Dbg::GetClassName(basket.locationClass);
+ basket.locationClass.Assign(pLoc->method->GetDeclaringClass());
+ basket.thisPtr.Assign(thisPtr);
+ basket.className = Dbg::GetClassName(basket.locationClass.Get());
/*
* On rare occasions we may need to execute interpreted code in the VM
@@ -924,16 +937,15 @@
DCHECK_EQ(fieldValue != nullptr, is_modification);
DCHECK_EQ(field->IsStatic(), this_object == nullptr);
- ModBasket basket;
+ ModBasket basket(Thread::Current());
basket.pLoc = pLoc;
- basket.locationClass = pLoc->method->GetDeclaringClass();
- basket.thisPtr = this_object;
- basket.thread = Thread::Current();
- basket.className = Dbg::GetClassName(basket.locationClass);
+ basket.locationClass.Assign(pLoc->method->GetDeclaringClass());
+ basket.thisPtr.Assign(this_object);
+ basket.className = Dbg::GetClassName(basket.locationClass.Get());
basket.field = field;
if (InvokeInProgress()) {
- VLOG(jdwp) << "Not posting field event during invoke";
+ VLOG(jdwp) << "Not posting field event during invoke (" << basket.className << ")";
return;
}
@@ -975,7 +987,7 @@
uint8_t tag;
{
ScopedObjectAccessUnchecked soa(Thread::Current());
- tag = Dbg::TagFromObject(soa, basket.thisPtr);
+ tag = Dbg::TagFromObject(soa, basket.thisPtr.Get());
}
for (const JdwpEvent* pEvent : match_list) {
@@ -1028,8 +1040,7 @@
return;
}
- ModBasket basket;
- basket.thread = thread;
+ ModBasket basket(thread);
std::vector<JdwpEvent*> match_list;
const JdwpEventKind match_kind = (start) ? EK_THREAD_START : EK_THREAD_DEATH;
@@ -1106,18 +1117,15 @@
VLOG(jdwp) << "Unexpected: exception event with empty throw location";
}
- ModBasket basket;
+ ModBasket basket(Thread::Current());
basket.pLoc = pThrowLoc;
if (pThrowLoc->method != nullptr) {
- basket.locationClass = pThrowLoc->method->GetDeclaringClass();
- } else {
- basket.locationClass = nullptr;
+ basket.locationClass.Assign(pThrowLoc->method->GetDeclaringClass());
}
- basket.thread = Thread::Current();
- basket.className = Dbg::GetClassName(basket.locationClass);
- basket.exceptionClass = exception_object->GetClass();
+ basket.className = Dbg::GetClassName(basket.locationClass.Get());
+ basket.exceptionClass.Assign(exception_object->GetClass());
basket.caught = (pCatchLoc->method != 0);
- basket.thisPtr = thisPtr;
+ basket.thisPtr.Assign(thisPtr);
/* don't try to post an exception caused by the debugger */
if (InvokeInProgress()) {
@@ -1188,10 +1196,9 @@
void JdwpState::PostClassPrepare(mirror::Class* klass) {
DCHECK(klass != nullptr);
- ModBasket basket;
- basket.locationClass = klass;
- basket.thread = Thread::Current();
- basket.className = Dbg::GetClassName(basket.locationClass);
+ ModBasket basket(Thread::Current());
+ basket.locationClass.Assign(klass);
+ basket.className = Dbg::GetClassName(basket.locationClass.Get());
/* suppress class prep caused by debugger */
if (InvokeInProgress()) {
@@ -1214,7 +1221,7 @@
// debuggers seem to like that. There might be some advantage to honesty,
// since the class may not yet be verified.
int status = JDWP::CS_VERIFIED | JDWP::CS_PREPARED;
- JDWP::JdwpTypeTag tag = Dbg::GetTypeTag(basket.locationClass);
+ JDWP::JdwpTypeTag tag = Dbg::GetTypeTag(basket.locationClass.Get());
std::string temp;
std::string signature(basket.locationClass->GetDescriptor(&temp));
diff --git a/runtime/jdwp/object_registry.cc b/runtime/jdwp/object_registry.cc
index a42a58f..2b28f7d 100644
--- a/runtime/jdwp/object_registry.cc
+++ b/runtime/jdwp/object_registry.cc
@@ -36,17 +36,45 @@
}
JDWP::RefTypeId ObjectRegistry::AddRefType(mirror::Class* c) {
- return InternalAdd(c);
+ return Add(c);
+}
+
+JDWP::RefTypeId ObjectRegistry::AddRefType(Handle<mirror::Class> c_h) {
+ return Add(c_h);
}
JDWP::ObjectId ObjectRegistry::Add(mirror::Object* o) {
- return InternalAdd(o);
-}
-
-JDWP::ObjectId ObjectRegistry::InternalAdd(mirror::Object* o) {
if (o == nullptr) {
return 0;
}
+ Thread* const self = Thread::Current();
+ StackHandleScope<1> hs(self);
+ return InternalAdd(hs.NewHandle(o));
+}
+
+// Template instantiations must be declared below.
+template<class T>
+JDWP::ObjectId ObjectRegistry::Add(Handle<T> obj_h) {
+ if (obj_h.Get() == nullptr) {
+ return 0;
+ }
+ return InternalAdd(obj_h);
+}
+
+// Explicit template instantiation.
+template
+SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
+LOCKS_EXCLUDED(Locks::thread_list_lock_, Locks::thread_suspend_count_lock_)
+JDWP::ObjectId ObjectRegistry::Add(Handle<mirror::Object> obj_h);
+
+template
+SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
+LOCKS_EXCLUDED(Locks::thread_list_lock_, Locks::thread_suspend_count_lock_)
+JDWP::ObjectId ObjectRegistry::Add(Handle<mirror::Throwable> obj_h);
+
+template<class T>
+JDWP::ObjectId ObjectRegistry::InternalAdd(Handle<T> obj_h) {
+ CHECK(obj_h.Get() != nullptr);
Thread* const self = Thread::Current();
self->AssertNoPendingException();
@@ -55,9 +83,6 @@
Locks::thread_list_lock_->AssertNotHeld(self);
Locks::thread_suspend_count_lock_->AssertNotHeld(self);
- StackHandleScope<1> hs(self);
- Handle<mirror::Object> obj_h(hs.NewHandle(o));
-
// Call IdentityHashCode here to avoid a lock level violation between lock_ and monitor_lock.
int32_t identity_hash_code = obj_h->IdentityHashCode();
diff --git a/runtime/jdwp/object_registry.h b/runtime/jdwp/object_registry.h
index 27a4e55..4c149cd 100644
--- a/runtime/jdwp/object_registry.h
+++ b/runtime/jdwp/object_registry.h
@@ -23,6 +23,7 @@
#include <map>
#include "base/casts.h"
+#include "handle.h"
#include "jdwp/jdwp.h"
#include "safe_map.h"
@@ -65,11 +66,23 @@
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
LOCKS_EXCLUDED(Locks::thread_list_lock_,
Locks::thread_suspend_count_lock_);
+
JDWP::RefTypeId AddRefType(mirror::Class* c)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
LOCKS_EXCLUDED(Locks::thread_list_lock_,
Locks::thread_suspend_count_lock_);
+ template<class T>
+ JDWP::ObjectId Add(Handle<T> obj_h)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
+ LOCKS_EXCLUDED(Locks::thread_list_lock_,
+ Locks::thread_suspend_count_lock_);
+
+ JDWP::RefTypeId AddRefType(Handle<mirror::Class> c_h)
+ SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
+ LOCKS_EXCLUDED(Locks::thread_list_lock_,
+ Locks::thread_suspend_count_lock_);
+
template<typename T> T Get(JDWP::ObjectId id, JDWP::JdwpError* error)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
if (id == 0) {
@@ -98,7 +111,8 @@
jobject GetJObject(JDWP::ObjectId id) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
private:
- JDWP::ObjectId InternalAdd(mirror::Object* o)
+ template<class T>
+ JDWP::ObjectId InternalAdd(Handle<T> obj_h)
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_)
LOCKS_EXCLUDED(lock_,
Locks::thread_list_lock_,
diff --git a/test/441-checker-inliner/src/Main.java b/test/441-checker-inliner/src/Main.java
index 631b140..8894d4e 100644
--- a/test/441-checker-inliner/src/Main.java
+++ b/test/441-checker-inliner/src/Main.java
@@ -17,9 +17,9 @@
public class Main {
// CHECK-START: void Main.InlineVoid() inliner (before)
- // CHECK-DAG: [[Const42:i\d+]] IntConstant 42
+ // CHECK-DAG: <<Const42:i\d+>> IntConstant 42
// CHECK-DAG: InvokeStaticOrDirect
- // CHECK-DAG: InvokeStaticOrDirect [ [[Const42]] ]
+ // CHECK-DAG: InvokeStaticOrDirect [<<Const42>>]
// CHECK-START: void Main.InlineVoid() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
@@ -30,94 +30,94 @@
}
// CHECK-START: int Main.InlineParameter(int) inliner (before)
- // CHECK-DAG: [[Param:i\d+]] ParameterValue
- // CHECK-DAG: [[Result:i\d+]] InvokeStaticOrDirect [ [[Param]] ]
- // CHECK-DAG: Return [ [[Result]] ]
+ // CHECK-DAG: <<Param:i\d+>> ParameterValue
+ // CHECK-DAG: <<Result:i\d+>> InvokeStaticOrDirect [<<Param>>]
+ // CHECK-DAG: Return [<<Result>>]
// CHECK-START: int Main.InlineParameter(int) inliner (after)
- // CHECK-DAG: [[Param:i\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Param]] ]
+ // CHECK-DAG: <<Param:i\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Param>>]
public static int InlineParameter(int a) {
return returnParameter(a);
}
// CHECK-START: long Main.InlineWideParameter(long) inliner (before)
- // CHECK-DAG: [[Param:j\d+]] ParameterValue
- // CHECK-DAG: [[Result:j\d+]] InvokeStaticOrDirect [ [[Param]] ]
- // CHECK-DAG: Return [ [[Result]] ]
+ // CHECK-DAG: <<Param:j\d+>> ParameterValue
+ // CHECK-DAG: <<Result:j\d+>> InvokeStaticOrDirect [<<Param>>]
+ // CHECK-DAG: Return [<<Result>>]
// CHECK-START: long Main.InlineWideParameter(long) inliner (after)
- // CHECK-DAG: [[Param:j\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Param]] ]
+ // CHECK-DAG: <<Param:j\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Param>>]
public static long InlineWideParameter(long a) {
return returnWideParameter(a);
}
// CHECK-START: java.lang.Object Main.InlineReferenceParameter(java.lang.Object) inliner (before)
- // CHECK-DAG: [[Param:l\d+]] ParameterValue
- // CHECK-DAG: [[Result:l\d+]] InvokeStaticOrDirect [ [[Param]] ]
- // CHECK-DAG: Return [ [[Result]] ]
+ // CHECK-DAG: <<Param:l\d+>> ParameterValue
+ // CHECK-DAG: <<Result:l\d+>> InvokeStaticOrDirect [<<Param>>]
+ // CHECK-DAG: Return [<<Result>>]
// CHECK-START: java.lang.Object Main.InlineReferenceParameter(java.lang.Object) inliner (after)
- // CHECK-DAG: [[Param:l\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Param]] ]
+ // CHECK-DAG: <<Param:l\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Param>>]
public static Object InlineReferenceParameter(Object o) {
return returnReferenceParameter(o);
}
// CHECK-START: int Main.InlineInt() inliner (before)
- // CHECK-DAG: [[Result:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Result]] ]
+ // CHECK-DAG: <<Result:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Result>>]
// CHECK-START: int Main.InlineInt() inliner (after)
- // CHECK-DAG: [[Const4:i\d+]] IntConstant 4
- // CHECK-DAG: Return [ [[Const4]] ]
+ // CHECK-DAG: <<Const4:i\d+>> IntConstant 4
+ // CHECK-DAG: Return [<<Const4>>]
public static int InlineInt() {
return returnInt();
}
// CHECK-START: long Main.InlineWide() inliner (before)
- // CHECK-DAG: [[Result:j\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Result]] ]
+ // CHECK-DAG: <<Result:j\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Result>>]
// CHECK-START: long Main.InlineWide() inliner (after)
- // CHECK-DAG: [[Const8:j\d+]] LongConstant 8
- // CHECK-DAG: Return [ [[Const8]] ]
+ // CHECK-DAG: <<Const8:j\d+>> LongConstant 8
+ // CHECK-DAG: Return [<<Const8>>]
public static long InlineWide() {
return returnWide();
}
// CHECK-START: int Main.InlineAdd() inliner (before)
- // CHECK-DAG: [[Const3:i\d+]] IntConstant 3
- // CHECK-DAG: [[Const5:i\d+]] IntConstant 5
- // CHECK-DAG: [[Result:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Result]] ]
+ // CHECK-DAG: <<Const3:i\d+>> IntConstant 3
+ // CHECK-DAG: <<Const5:i\d+>> IntConstant 5
+ // CHECK-DAG: <<Result:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Result>>]
// CHECK-START: int Main.InlineAdd() inliner (after)
- // CHECK-DAG: [[Const3:i\d+]] IntConstant 3
- // CHECK-DAG: [[Const5:i\d+]] IntConstant 5
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Const3]] [[Const5]] ]
- // CHECK-DAG: Return [ [[Add]] ]
+ // CHECK-DAG: <<Const3:i\d+>> IntConstant 3
+ // CHECK-DAG: <<Const5:i\d+>> IntConstant 5
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Const3>>,<<Const5>>]
+ // CHECK-DAG: Return [<<Add>>]
public static int InlineAdd() {
return returnAdd(3, 5);
}
// CHECK-START: int Main.InlineFieldAccess() inliner (before)
- // CHECK-DAG: [[After:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[After]] ]
+ // CHECK-DAG: <<After:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<After>>]
// CHECK-START: int Main.InlineFieldAccess() inliner (after)
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Before:i\d+]] StaticFieldGet
- // CHECK-DAG: [[After:i\d+]] Add [ [[Before]] [[Const1]] ]
- // CHECK-DAG: StaticFieldSet [ {{l\d+}} [[After]] ]
- // CHECK-DAG: Return [ [[After]] ]
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Before:i\d+>> StaticFieldGet
+ // CHECK-DAG: <<After:i\d+>> Add [<<Before>>,<<Const1>>]
+ // CHECK-DAG: StaticFieldSet [{{l\d+}},<<After>>]
+ // CHECK-DAG: Return [<<After>>]
// CHECK-START: int Main.InlineFieldAccess() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
@@ -127,22 +127,22 @@
}
// CHECK-START: int Main.InlineWithControlFlow(boolean) inliner (before)
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Const3:i\d+]] IntConstant 3
- // CHECK-DAG: [[Const5:i\d+]] IntConstant 5
- // CHECK-DAG: [[Add:i\d+]] InvokeStaticOrDirect [ [[Const1]] [[Const3]] ]
- // CHECK-DAG: [[Sub:i\d+]] InvokeStaticOrDirect [ [[Const5]] [[Const3]] ]
- // CHECK-DAG: [[Phi:i\d+]] Phi [ [[Add]] [[Sub]] ]
- // CHECK-DAG: Return [ [[Phi]] ]
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Const3:i\d+>> IntConstant 3
+ // CHECK-DAG: <<Const5:i\d+>> IntConstant 5
+ // CHECK-DAG: <<Add:i\d+>> InvokeStaticOrDirect [<<Const1>>,<<Const3>>]
+ // CHECK-DAG: <<Sub:i\d+>> InvokeStaticOrDirect [<<Const5>>,<<Const3>>]
+ // CHECK-DAG: <<Phi:i\d+>> Phi [<<Add>>,<<Sub>>]
+ // CHECK-DAG: Return [<<Phi>>]
// CHECK-START: int Main.InlineWithControlFlow(boolean) inliner (after)
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Const3:i\d+]] IntConstant 3
- // CHECK-DAG: [[Const5:i\d+]] IntConstant 5
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Const1]] [[Const3]] ]
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[Const5]] [[Const3]] ]
- // CHECK-DAG: [[Phi:i\d+]] Phi [ [[Add]] [[Sub]] ]
- // CHECK-DAG: Return [ [[Phi]] ]
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Const3:i\d+>> IntConstant 3
+ // CHECK-DAG: <<Const5:i\d+>> IntConstant 5
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Const1>>,<<Const3>>]
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<Const5>>,<<Const3>>]
+ // CHECK-DAG: <<Phi:i\d+>> Phi [<<Add>>,<<Sub>>]
+ // CHECK-DAG: Return [<<Phi>>]
public static int InlineWithControlFlow(boolean cond) {
int x, const1, const3, const5;
diff --git a/test/442-checker-constant-folding/src/Main.java b/test/442-checker-constant-folding/src/Main.java
index 6699acd..c258db9 100644
--- a/test/442-checker-constant-folding/src/Main.java
+++ b/test/442-checker-constant-folding/src/Main.java
@@ -52,13 +52,13 @@
*/
// CHECK-START: int Main.IntNegation() constant_folding (before)
- // CHECK-DAG: [[Const42:i\d+]] IntConstant 42
- // CHECK-DAG: [[Neg:i\d+]] Neg [ [[Const42]] ]
- // CHECK-DAG: Return [ [[Neg]] ]
+ // CHECK-DAG: <<Const42:i\d+>> IntConstant 42
+ // CHECK-DAG: <<Neg:i\d+>> Neg [<<Const42>>]
+ // CHECK-DAG: Return [<<Neg>>]
// CHECK-START: int Main.IntNegation() constant_folding (after)
- // CHECK-DAG: [[ConstN42:i\d+]] IntConstant -42
- // CHECK-DAG: Return [ [[ConstN42]] ]
+ // CHECK-DAG: <<ConstN42:i\d+>> IntConstant -42
+ // CHECK-DAG: Return [<<ConstN42>>]
public static int IntNegation() {
int x, y;
@@ -73,14 +73,14 @@
*/
// CHECK-START: int Main.IntAddition1() constant_folding (before)
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Const2:i\d+]] IntConstant 2
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Const1]] [[Const2]] ]
- // CHECK-DAG: Return [ [[Add]] ]
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Const2:i\d+>> IntConstant 2
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Const1>>,<<Const2>>]
+ // CHECK-DAG: Return [<<Add>>]
// CHECK-START: int Main.IntAddition1() constant_folding (after)
- // CHECK-DAG: [[Const3:i\d+]] IntConstant 3
- // CHECK-DAG: Return [ [[Const3]] ]
+ // CHECK-DAG: <<Const3:i\d+>> IntConstant 3
+ // CHECK-DAG: Return [<<Const3>>]
public static int IntAddition1() {
int a, b, c;
@@ -96,18 +96,18 @@
*/
// CHECK-START: int Main.IntAddition2() constant_folding (before)
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Const2:i\d+]] IntConstant 2
- // CHECK-DAG: [[Const5:i\d+]] IntConstant 5
- // CHECK-DAG: [[Const6:i\d+]] IntConstant 6
- // CHECK-DAG: [[Add1:i\d+]] Add [ [[Const1]] [[Const2]] ]
- // CHECK-DAG: [[Add2:i\d+]] Add [ [[Const5]] [[Const6]] ]
- // CHECK-DAG: [[Add3:i\d+]] Add [ [[Add1]] [[Add2]] ]
- // CHECK-DAG: Return [ [[Add3]] ]
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Const2:i\d+>> IntConstant 2
+ // CHECK-DAG: <<Const5:i\d+>> IntConstant 5
+ // CHECK-DAG: <<Const6:i\d+>> IntConstant 6
+ // CHECK-DAG: <<Add1:i\d+>> Add [<<Const1>>,<<Const2>>]
+ // CHECK-DAG: <<Add2:i\d+>> Add [<<Const5>>,<<Const6>>]
+ // CHECK-DAG: <<Add3:i\d+>> Add [<<Add1>>,<<Add2>>]
+ // CHECK-DAG: Return [<<Add3>>]
// CHECK-START: int Main.IntAddition2() constant_folding (after)
- // CHECK-DAG: [[Const14:i\d+]] IntConstant 14
- // CHECK-DAG: Return [ [[Const14]] ]
+ // CHECK-DAG: <<Const14:i\d+>> IntConstant 14
+ // CHECK-DAG: Return [<<Const14>>]
public static int IntAddition2() {
int a, b, c;
@@ -127,14 +127,14 @@
*/
// CHECK-START: int Main.IntSubtraction() constant_folding (before)
- // CHECK-DAG: [[Const6:i\d+]] IntConstant 6
- // CHECK-DAG: [[Const2:i\d+]] IntConstant 2
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[Const6]] [[Const2]] ]
- // CHECK-DAG: Return [ [[Sub]] ]
+ // CHECK-DAG: <<Const6:i\d+>> IntConstant 6
+ // CHECK-DAG: <<Const2:i\d+>> IntConstant 2
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<Const6>>,<<Const2>>]
+ // CHECK-DAG: Return [<<Sub>>]
// CHECK-START: int Main.IntSubtraction() constant_folding (after)
- // CHECK-DAG: [[Const4:i\d+]] IntConstant 4
- // CHECK-DAG: Return [ [[Const4]] ]
+ // CHECK-DAG: <<Const4:i\d+>> IntConstant 4
+ // CHECK-DAG: Return [<<Const4>>]
public static int IntSubtraction() {
int a, b, c;
@@ -150,14 +150,14 @@
*/
// CHECK-START: long Main.LongAddition() constant_folding (before)
- // CHECK-DAG: [[Const1:j\d+]] LongConstant 1
- // CHECK-DAG: [[Const2:j\d+]] LongConstant 2
- // CHECK-DAG: [[Add:j\d+]] Add [ [[Const1]] [[Const2]] ]
- // CHECK-DAG: Return [ [[Add]] ]
+ // CHECK-DAG: <<Const1:j\d+>> LongConstant 1
+ // CHECK-DAG: <<Const2:j\d+>> LongConstant 2
+ // CHECK-DAG: <<Add:j\d+>> Add [<<Const1>>,<<Const2>>]
+ // CHECK-DAG: Return [<<Add>>]
// CHECK-START: long Main.LongAddition() constant_folding (after)
- // CHECK-DAG: [[Const3:j\d+]] LongConstant 3
- // CHECK-DAG: Return [ [[Const3]] ]
+ // CHECK-DAG: <<Const3:j\d+>> LongConstant 3
+ // CHECK-DAG: Return [<<Const3>>]
public static long LongAddition() {
long a, b, c;
@@ -173,14 +173,14 @@
*/
// CHECK-START: long Main.LongSubtraction() constant_folding (before)
- // CHECK-DAG: [[Const6:j\d+]] LongConstant 6
- // CHECK-DAG: [[Const2:j\d+]] LongConstant 2
- // CHECK-DAG: [[Sub:j\d+]] Sub [ [[Const6]] [[Const2]] ]
- // CHECK-DAG: Return [ [[Sub]] ]
+ // CHECK-DAG: <<Const6:j\d+>> LongConstant 6
+ // CHECK-DAG: <<Const2:j\d+>> LongConstant 2
+ // CHECK-DAG: <<Sub:j\d+>> Sub [<<Const6>>,<<Const2>>]
+ // CHECK-DAG: Return [<<Sub>>]
// CHECK-START: long Main.LongSubtraction() constant_folding (after)
- // CHECK-DAG: [[Const4:j\d+]] LongConstant 4
- // CHECK-DAG: Return [ [[Const4]] ]
+ // CHECK-DAG: <<Const4:j\d+>> LongConstant 4
+ // CHECK-DAG: Return [<<Const4>>]
public static long LongSubtraction() {
long a, b, c;
@@ -195,14 +195,14 @@
*/
// CHECK-START: int Main.StaticCondition() constant_folding (before)
- // CHECK-DAG: [[Const7:i\d+]] IntConstant 7
- // CHECK-DAG: [[Const2:i\d+]] IntConstant 2
- // CHECK-DAG: [[Cond:z\d+]] GreaterThanOrEqual [ [[Const7]] [[Const2]] ]
- // CHECK-DAG: If [ [[Cond]] ]
+ // CHECK-DAG: <<Const7:i\d+>> IntConstant 7
+ // CHECK-DAG: <<Const2:i\d+>> IntConstant 2
+ // CHECK-DAG: <<Cond:z\d+>> GreaterThanOrEqual [<<Const7>>,<<Const2>>]
+ // CHECK-DAG: If [<<Cond>>]
// CHECK-START: int Main.StaticCondition() constant_folding (after)
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: If [ [[Const1]] ]
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: If [<<Const1>>]
public static int StaticCondition() {
int a, b, c;
@@ -225,18 +225,18 @@
*/
// CHECK-START: int Main.JumpsAndConditionals(boolean) constant_folding (before)
- // CHECK-DAG: [[Const2:i\d+]] IntConstant 2
- // CHECK-DAG: [[Const5:i\d+]] IntConstant 5
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Const5]] [[Const2]] ]
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[Const5]] [[Const2]] ]
- // CHECK-DAG: [[Phi:i\d+]] Phi [ [[Add]] [[Sub]] ]
- // CHECK-DAG: Return [ [[Phi]] ]
+ // CHECK-DAG: <<Const2:i\d+>> IntConstant 2
+ // CHECK-DAG: <<Const5:i\d+>> IntConstant 5
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Const5>>,<<Const2>>]
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<Const5>>,<<Const2>>]
+ // CHECK-DAG: <<Phi:i\d+>> Phi [<<Add>>,<<Sub>>]
+ // CHECK-DAG: Return [<<Phi>>]
// CHECK-START: int Main.JumpsAndConditionals(boolean) constant_folding (after)
- // CHECK-DAG: [[Const3:i\d+]] IntConstant 3
- // CHECK-DAG: [[Const7:i\d+]] IntConstant 7
- // CHECK-DAG: [[Phi:i\d+]] Phi [ [[Const7]] [[Const3]] ]
- // CHECK-DAG: Return [ [[Phi]] ]
+ // CHECK-DAG: <<Const3:i\d+>> IntConstant 3
+ // CHECK-DAG: <<Const7:i\d+>> IntConstant 7
+ // CHECK-DAG: <<Phi:i\d+>> Phi [<<Const7>>,<<Const3>>]
+ // CHECK-DAG: Return [<<Phi>>]
public static int JumpsAndConditionals(boolean cond) {
int a, b, c;
@@ -254,192 +254,192 @@
*/
// CHECK-START: int Main.And0(int) constant_folding (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[And:i\d+]] And [ [[Arg]] [[Const0]] ]
- // CHECK-DAG: Return [ [[And]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<And:i\d+>> And [<<Arg>>,<<Const0>>]
+ // CHECK-DAG: Return [<<And>>]
// CHECK-START: int Main.And0(int) constant_folding (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
// CHECK-NOT: And
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: Return [<<Const0>>]
public static int And0(int arg) {
return arg & 0;
}
// CHECK-START: long Main.Mul0(long) constant_folding (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
- // CHECK-DAG: [[Mul:j\d+]] Mul [ [[Arg]] [[Const0]] ]
- // CHECK-DAG: Return [ [[Mul]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
+ // CHECK-DAG: <<Mul:j\d+>> Mul [<<Arg>>,<<Const0>>]
+ // CHECK-DAG: Return [<<Mul>>]
// CHECK-START: long Main.Mul0(long) constant_folding (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
// CHECK-NOT: Mul
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: Return [<<Const0>>]
public static long Mul0(long arg) {
return arg * 0;
}
// CHECK-START: int Main.OrAllOnes(int) constant_folding (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[ConstF:i\d+]] IntConstant -1
- // CHECK-DAG: [[Or:i\d+]] Or [ [[Arg]] [[ConstF]] ]
- // CHECK-DAG: Return [ [[Or]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<ConstF:i\d+>> IntConstant -1
+ // CHECK-DAG: <<Or:i\d+>> Or [<<Arg>>,<<ConstF>>]
+ // CHECK-DAG: Return [<<Or>>]
// CHECK-START: int Main.OrAllOnes(int) constant_folding (after)
- // CHECK-DAG: [[ConstF:i\d+]] IntConstant -1
+ // CHECK-DAG: <<ConstF:i\d+>> IntConstant -1
// CHECK-NOT: Or
- // CHECK-DAG: Return [ [[ConstF]] ]
+ // CHECK-DAG: Return [<<ConstF>>]
public static int OrAllOnes(int arg) {
return arg | -1;
}
// CHECK-START: long Main.Rem0(long) constant_folding (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
- // CHECK-DAG: [[DivZeroCheck:j\d+]] DivZeroCheck [ [[Arg]] ]
- // CHECK-DAG: [[Rem:j\d+]] Rem [ [[Const0]] [[DivZeroCheck]] ]
- // CHECK-DAG: Return [ [[Rem]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
+ // CHECK-DAG: <<DivZeroCheck:j\d+>> DivZeroCheck [<<Arg>>]
+ // CHECK-DAG: <<Rem:j\d+>> Rem [<<Const0>>,<<DivZeroCheck>>]
+ // CHECK-DAG: Return [<<Rem>>]
// CHECK-START: long Main.Rem0(long) constant_folding (after)
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
// CHECK-NOT: Rem
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: Return [<<Const0>>]
public static long Rem0(long arg) {
return 0 % arg;
}
// CHECK-START: int Main.Rem1(int) constant_folding (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Rem:i\d+]] Rem [ [[Arg]] [[Const1]] ]
- // CHECK-DAG: Return [ [[Rem]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Rem:i\d+>> Rem [<<Arg>>,<<Const1>>]
+ // CHECK-DAG: Return [<<Rem>>]
// CHECK-START: int Main.Rem1(int) constant_folding (after)
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
// CHECK-NOT: Rem
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: Return [<<Const0>>]
public static int Rem1(int arg) {
return arg % 1;
}
// CHECK-START: long Main.RemN1(long) constant_folding (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[ConstN1:j\d+]] LongConstant -1
- // CHECK-DAG: [[DivZeroCheck:j\d+]] DivZeroCheck [ [[Arg]] ]
- // CHECK-DAG: [[Rem:j\d+]] Rem [ [[Arg]] [[DivZeroCheck]] ]
- // CHECK-DAG: Return [ [[Rem]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<ConstN1:j\d+>> LongConstant -1
+ // CHECK-DAG: <<DivZeroCheck:j\d+>> DivZeroCheck [<<ConstN1>>]
+ // CHECK-DAG: <<Rem:j\d+>> Rem [<<Arg>>,<<DivZeroCheck>>]
+ // CHECK-DAG: Return [<<Rem>>]
// CHECK-START: long Main.RemN1(long) constant_folding (after)
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
// CHECK-NOT: Rem
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: Return [<<Const0>>]
public static long RemN1(long arg) {
return arg % -1;
}
// CHECK-START: int Main.Shl0(int) constant_folding (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Shl:i\d+]] Shl [ [[Const0]] [[Arg]] ]
- // CHECK-DAG: Return [ [[Shl]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Shl:i\d+>> Shl [<<Const0>>,<<Arg>>]
+ // CHECK-DAG: Return [<<Shl>>]
// CHECK-START: int Main.Shl0(int) constant_folding (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
// CHECK-NOT: Shl
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: Return [<<Const0>>]
public static int Shl0(int arg) {
return 0 << arg;
}
// CHECK-START: long Main.Shr0(int) constant_folding (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
- // CHECK-DAG: [[Shr:j\d+]] Shr [ [[Const0]] [[Arg]] ]
- // CHECK-DAG: Return [ [[Shr]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
+ // CHECK-DAG: <<Shr:j\d+>> Shr [<<Const0>>,<<Arg>>]
+ // CHECK-DAG: Return [<<Shr>>]
// CHECK-START: long Main.Shr0(int) constant_folding (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
// CHECK-NOT: Shr
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: Return [<<Const0>>]
public static long Shr0(int arg) {
return (long)0 >> arg;
}
// CHECK-START: long Main.SubSameLong(long) constant_folding (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Sub:j\d+]] Sub [ [[Arg]] [[Arg]] ]
- // CHECK-DAG: Return [ [[Sub]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Sub:j\d+>> Sub [<<Arg>>,<<Arg>>]
+ // CHECK-DAG: Return [<<Sub>>]
// CHECK-START: long Main.SubSameLong(long) constant_folding (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
// CHECK-NOT: Sub
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: Return [<<Const0>>]
public static long SubSameLong(long arg) {
return arg - arg;
}
// CHECK-START: int Main.UShr0(int) constant_folding (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[UShr:i\d+]] UShr [ [[Const0]] [[Arg]] ]
- // CHECK-DAG: Return [ [[UShr]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<UShr:i\d+>> UShr [<<Const0>>,<<Arg>>]
+ // CHECK-DAG: Return [<<UShr>>]
// CHECK-START: int Main.UShr0(int) constant_folding (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
// CHECK-NOT: UShr
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: Return [<<Const0>>]
public static int UShr0(int arg) {
return 0 >>> arg;
}
// CHECK-START: int Main.XorSameInt(int) constant_folding (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Xor:i\d+]] Xor [ [[Arg]] [[Arg]] ]
- // CHECK-DAG: Return [ [[Xor]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Xor:i\d+>> Xor [<<Arg>>,<<Arg>>]
+ // CHECK-DAG: Return [<<Xor>>]
// CHECK-START: int Main.XorSameInt(int) constant_folding (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
// CHECK-NOT: Xor
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: Return [<<Const0>>]
public static int XorSameInt(int arg) {
return arg ^ arg;
}
// CHECK-START: boolean Main.CmpFloatGreaterThanNaN(float) constant_folding (before)
- // CHECK-DAG: [[Arg:f\d+]] ParameterValue
- // CHECK-DAG: [[ConstNan:f\d+]] FloatConstant nan
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
+ // CHECK-DAG: <<Arg:f\d+>> ParameterValue
+ // CHECK-DAG: <<ConstNan:f\d+>> FloatConstant nan
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
// CHECK-DAG: IntConstant 1
- // CHECK-DAG: [[Cmp:i\d+]] Compare [ [[Arg]] [[ConstNan]] ]
- // CHECK-DAG: [[Le:z\d+]] LessThanOrEqual [ [[Cmp]] [[Const0]] ]
- // CHECK-DAG: If [ [[Le]] ]
+ // CHECK-DAG: <<Cmp:i\d+>> Compare [<<Arg>>,<<ConstNan>>]
+ // CHECK-DAG: <<Le:z\d+>> LessThanOrEqual [<<Cmp>>,<<Const0>>]
+ // CHECK-DAG: If [<<Le>>]
// CHECK-START: boolean Main.CmpFloatGreaterThanNaN(float) constant_folding (after)
// CHECK-DAG: ParameterValue
// CHECK-DAG: FloatConstant nan
// CHECK-DAG: IntConstant 0
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: If [ [[Const1]] ]
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: If [<<Const1>>]
// CHECK-START: boolean Main.CmpFloatGreaterThanNaN(float) constant_folding (after)
// CHECK-NOT: Compare
@@ -450,20 +450,20 @@
}
// CHECK-START: boolean Main.CmpDoubleLessThanNaN(double) constant_folding (before)
- // CHECK-DAG: [[Arg:d\d+]] ParameterValue
- // CHECK-DAG: [[ConstNan:d\d+]] DoubleConstant nan
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
+ // CHECK-DAG: <<Arg:d\d+>> ParameterValue
+ // CHECK-DAG: <<ConstNan:d\d+>> DoubleConstant nan
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
// CHECK-DAG: IntConstant 1
- // CHECK-DAG: [[Cmp:i\d+]] Compare [ [[Arg]] [[ConstNan]] ]
- // CHECK-DAG: [[Ge:z\d+]] GreaterThanOrEqual [ [[Cmp]] [[Const0]] ]
- // CHECK-DAG: If [ [[Ge]] ]
+ // CHECK-DAG: <<Cmp:i\d+>> Compare [<<Arg>>,<<ConstNan>>]
+ // CHECK-DAG: <<Ge:z\d+>> GreaterThanOrEqual [<<Cmp>>,<<Const0>>]
+ // CHECK-DAG: If [<<Ge>>]
// CHECK-START: boolean Main.CmpDoubleLessThanNaN(double) constant_folding (after)
// CHECK-DAG: ParameterValue
// CHECK-DAG: DoubleConstant nan
// CHECK-DAG: IntConstant 0
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: If [ [[Const1]] ]
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: If [<<Const1>>]
// CHECK-START: boolean Main.CmpDoubleLessThanNaN(double) constant_folding (after)
// CHECK-NOT: Compare
@@ -474,13 +474,13 @@
}
// CHECK-START: int Main.ReturnInt33() constant_folding (before)
- // CHECK-DAG: [[Const33:j\d+]] LongConstant 33
- // CHECK-DAG: [[Convert:i\d+]] TypeConversion [[Const33]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<Const33:j\d+>> LongConstant 33
+ // CHECK-DAG: <<Convert:i\d+>> TypeConversion [<<Const33>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: int Main.ReturnInt33() constant_folding (after)
- // CHECK-DAG: [[Const33:i\d+]] IntConstant 33
- // CHECK-DAG: Return [ [[Const33]] ]
+ // CHECK-DAG: <<Const33:i\d+>> IntConstant 33
+ // CHECK-DAG: Return [<<Const33>>]
public static int ReturnInt33() {
long imm = 33L;
@@ -488,13 +488,13 @@
}
// CHECK-START: int Main.ReturnIntMax() constant_folding (before)
- // CHECK-DAG: [[ConstMax:f\d+]] FloatConstant 1e+34
- // CHECK-DAG: [[Convert:i\d+]] TypeConversion [[ConstMax]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<ConstMax:f\d+>> FloatConstant 1e+34
+ // CHECK-DAG: <<Convert:i\d+>> TypeConversion [<<ConstMax>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: int Main.ReturnIntMax() constant_folding (after)
- // CHECK-DAG: [[ConstMax:i\d+]] IntConstant 2147483647
- // CHECK-DAG: Return [ [[ConstMax]] ]
+ // CHECK-DAG: <<ConstMax:i\d+>> IntConstant 2147483647
+ // CHECK-DAG: Return [<<ConstMax>>]
public static int ReturnIntMax() {
float imm = 1.0e34f;
@@ -502,13 +502,13 @@
}
// CHECK-START: int Main.ReturnInt0() constant_folding (before)
- // CHECK-DAG: [[ConstNaN:d\d+]] DoubleConstant nan
- // CHECK-DAG: [[Convert:i\d+]] TypeConversion [[ConstNaN]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<ConstNaN:d\d+>> DoubleConstant nan
+ // CHECK-DAG: <<Convert:i\d+>> TypeConversion [<<ConstNaN>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: int Main.ReturnInt0() constant_folding (after)
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: Return [<<Const0>>]
public static int ReturnInt0() {
double imm = Double.NaN;
@@ -516,13 +516,13 @@
}
// CHECK-START: long Main.ReturnLong33() constant_folding (before)
- // CHECK-DAG: [[Const33:i\d+]] IntConstant 33
- // CHECK-DAG: [[Convert:j\d+]] TypeConversion [[Const33]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<Const33:i\d+>> IntConstant 33
+ // CHECK-DAG: <<Convert:j\d+>> TypeConversion [<<Const33>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: long Main.ReturnLong33() constant_folding (after)
- // CHECK-DAG: [[Const33:j\d+]] LongConstant 33
- // CHECK-DAG: Return [ [[Const33]] ]
+ // CHECK-DAG: <<Const33:j\d+>> LongConstant 33
+ // CHECK-DAG: Return [<<Const33>>]
public static long ReturnLong33() {
int imm = 33;
@@ -530,13 +530,13 @@
}
// CHECK-START: long Main.ReturnLong34() constant_folding (before)
- // CHECK-DAG: [[Const34:f\d+]] FloatConstant 34
- // CHECK-DAG: [[Convert:j\d+]] TypeConversion [[Const34]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<Const34:f\d+>> FloatConstant 34
+ // CHECK-DAG: <<Convert:j\d+>> TypeConversion [<<Const34>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: long Main.ReturnLong34() constant_folding (after)
- // CHECK-DAG: [[Const34:j\d+]] LongConstant 34
- // CHECK-DAG: Return [ [[Const34]] ]
+ // CHECK-DAG: <<Const34:j\d+>> LongConstant 34
+ // CHECK-DAG: Return [<<Const34>>]
public static long ReturnLong34() {
float imm = 34.0f;
@@ -544,13 +544,13 @@
}
// CHECK-START: long Main.ReturnLong0() constant_folding (before)
- // CHECK-DAG: [[ConstNaN:d\d+]] DoubleConstant nan
- // CHECK-DAG: [[Convert:j\d+]] TypeConversion [[ConstNaN]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<ConstNaN:d\d+>> DoubleConstant nan
+ // CHECK-DAG: <<Convert:j\d+>> TypeConversion [<<ConstNaN>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: long Main.ReturnLong0() constant_folding (after)
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
- // CHECK-DAG: Return [ [[Const0]] ]
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
+ // CHECK-DAG: Return [<<Const0>>]
public static long ReturnLong0() {
double imm = -Double.NaN;
@@ -558,13 +558,13 @@
}
// CHECK-START: float Main.ReturnFloat33() constant_folding (before)
- // CHECK-DAG: [[Const33:i\d+]] IntConstant 33
- // CHECK-DAG: [[Convert:f\d+]] TypeConversion [[Const33]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<Const33:i\d+>> IntConstant 33
+ // CHECK-DAG: <<Convert:f\d+>> TypeConversion [<<Const33>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: float Main.ReturnFloat33() constant_folding (after)
- // CHECK-DAG: [[Const33:f\d+]] FloatConstant 33
- // CHECK-DAG: Return [ [[Const33]] ]
+ // CHECK-DAG: <<Const33:f\d+>> FloatConstant 33
+ // CHECK-DAG: Return [<<Const33>>]
public static float ReturnFloat33() {
int imm = 33;
@@ -572,13 +572,13 @@
}
// CHECK-START: float Main.ReturnFloat34() constant_folding (before)
- // CHECK-DAG: [[Const34:j\d+]] LongConstant 34
- // CHECK-DAG: [[Convert:f\d+]] TypeConversion [[Const34]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<Const34:j\d+>> LongConstant 34
+ // CHECK-DAG: <<Convert:f\d+>> TypeConversion [<<Const34>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: float Main.ReturnFloat34() constant_folding (after)
- // CHECK-DAG: [[Const34:f\d+]] FloatConstant 34
- // CHECK-DAG: Return [ [[Const34]] ]
+ // CHECK-DAG: <<Const34:f\d+>> FloatConstant 34
+ // CHECK-DAG: Return [<<Const34>>]
public static float ReturnFloat34() {
long imm = 34L;
@@ -586,13 +586,13 @@
}
// CHECK-START: float Main.ReturnFloat99P25() constant_folding (before)
- // CHECK-DAG: [[Const:d\d+]] DoubleConstant 99.25
- // CHECK-DAG: [[Convert:f\d+]] TypeConversion [[Const]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<Const:d\d+>> DoubleConstant 99.25
+ // CHECK-DAG: <<Convert:f\d+>> TypeConversion [<<Const>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: float Main.ReturnFloat99P25() constant_folding (after)
- // CHECK-DAG: [[Const:f\d+]] FloatConstant 99.25
- // CHECK-DAG: Return [ [[Const]] ]
+ // CHECK-DAG: <<Const:f\d+>> FloatConstant 99.25
+ // CHECK-DAG: Return [<<Const>>]
public static float ReturnFloat99P25() {
double imm = 99.25;
@@ -600,13 +600,13 @@
}
// CHECK-START: double Main.ReturnDouble33() constant_folding (before)
- // CHECK-DAG: [[Const33:i\d+]] IntConstant 33
- // CHECK-DAG: [[Convert:d\d+]] TypeConversion [[Const33]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<Const33:i\d+>> IntConstant 33
+ // CHECK-DAG: <<Convert:d\d+>> TypeConversion [<<Const33>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: double Main.ReturnDouble33() constant_folding (after)
- // CHECK-DAG: [[Const33:d\d+]] DoubleConstant 33
- // CHECK-DAG: Return [ [[Const33]] ]
+ // CHECK-DAG: <<Const33:d\d+>> DoubleConstant 33
+ // CHECK-DAG: Return [<<Const33>>]
public static double ReturnDouble33() {
int imm = 33;
@@ -614,13 +614,13 @@
}
// CHECK-START: double Main.ReturnDouble34() constant_folding (before)
- // CHECK-DAG: [[Const34:j\d+]] LongConstant 34
- // CHECK-DAG: [[Convert:d\d+]] TypeConversion [[Const34]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<Const34:j\d+>> LongConstant 34
+ // CHECK-DAG: <<Convert:d\d+>> TypeConversion [<<Const34>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: double Main.ReturnDouble34() constant_folding (after)
- // CHECK-DAG: [[Const34:d\d+]] DoubleConstant 34
- // CHECK-DAG: Return [ [[Const34]] ]
+ // CHECK-DAG: <<Const34:d\d+>> DoubleConstant 34
+ // CHECK-DAG: Return [<<Const34>>]
public static double ReturnDouble34() {
long imm = 34L;
@@ -628,13 +628,13 @@
}
// CHECK-START: double Main.ReturnDouble99P25() constant_folding (before)
- // CHECK-DAG: [[Const:f\d+]] FloatConstant 99.25
- // CHECK-DAG: [[Convert:d\d+]] TypeConversion [[Const]]
- // CHECK-DAG: Return [ [[Convert]] ]
+ // CHECK-DAG: <<Const:f\d+>> FloatConstant 99.25
+ // CHECK-DAG: <<Convert:d\d+>> TypeConversion [<<Const>>]
+ // CHECK-DAG: Return [<<Convert>>]
// CHECK-START: double Main.ReturnDouble99P25() constant_folding (after)
- // CHECK-DAG: [[Const:d\d+]] DoubleConstant 99.25
- // CHECK-DAG: Return [ [[Const]] ]
+ // CHECK-DAG: <<Const:d\d+>> DoubleConstant 99.25
+ // CHECK-DAG: Return [<<Const>>]
public static double ReturnDouble99P25() {
float imm = 99.25f;
diff --git a/test/445-checker-licm/src/Main.java b/test/445-checker-licm/src/Main.java
index 91ac2ed..96918d3 100644
--- a/test/445-checker-licm/src/Main.java
+++ b/test/445-checker-licm/src/Main.java
@@ -17,13 +17,13 @@
public class Main {
// CHECK-START: int Main.div() licm (before)
- // CHECK-DAG: Div ( loop_header:{{B\d+}} )
+ // CHECK-DAG: Div loop:{{B\d+}}
// CHECK-START: int Main.div() licm (after)
- // CHECK-NOT: Div ( loop_header:{{B\d+}} )
+ // CHECK-NOT: Div loop:{{B\d+}}
// CHECK-START: int Main.div() licm (after)
- // CHECK-DAG: Div ( loop_header:null )
+ // CHECK-DAG: Div loop:none
public static int div() {
int result = 0;
@@ -34,13 +34,13 @@
}
// CHECK-START: int Main.innerDiv() licm (before)
- // CHECK-DAG: Div ( loop_header:{{B\d+}} )
+ // CHECK-DAG: Div loop:{{B\d+}}
// CHECK-START: int Main.innerDiv() licm (after)
- // CHECK-NOT: Div ( loop_header:{{B\d+}} )
+ // CHECK-NOT: Div loop:{{B\d+}}
// CHECK-START: int Main.innerDiv() licm (after)
- // CHECK-DAG: Div ( loop_header:null )
+ // CHECK-DAG: Div loop:none
public static int innerDiv() {
int result = 0;
@@ -53,10 +53,10 @@
}
// CHECK-START: int Main.innerDiv2() licm (before)
- // CHECK-DAG: Mul ( loop_header:{{B4}} )
+ // CHECK-DAG: Mul loop:B4
// CHECK-START: int Main.innerDiv2() licm (after)
- // CHECK-DAG: Mul ( loop_header:{{B2}} )
+ // CHECK-DAG: Mul loop:B2
public static int innerDiv2() {
int result = 0;
@@ -72,10 +72,10 @@
}
// CHECK-START: int Main.innerDiv3(int, int) licm (before)
- // CHECK-DAG: Div ( loop_header:{{B\d+}} )
+ // CHECK-DAG: Div loop:{{B\d+}}
// CHECK-START: int Main.innerDiv3(int, int) licm (after)
- // CHECK-DAG: Div ( loop_header:{{B\d+}} )
+ // CHECK-DAG: Div loop:{{B\d+}}
public static int innerDiv3(int a, int b) {
int result = 0;
@@ -88,16 +88,16 @@
}
// CHECK-START: int Main.arrayLength(int[]) licm (before)
- // CHECK-DAG: [[NullCheck:l\d+]] NullCheck ( loop_header:{{B\d+}} )
- // CHECK-DAG: ArrayLength [ [[NullCheck]] ] ( loop_header:{{B\d+}} )
+ // CHECK-DAG: <<NullCheck:l\d+>> NullCheck loop:{{B\d+}}
+ // CHECK-DAG: ArrayLength [<<NullCheck>>] loop:{{B\d+}}
// CHECK-START: int Main.arrayLength(int[]) licm (after)
- // CHECK-NOT: NullCheck ( loop_header:{{B\d+}} )
- // CHECK-NOT: ArrayLength ( loop_header:{{B\d+}} )
+ // CHECK-NOT: NullCheck loop:{{B\d+}}
+ // CHECK-NOT: ArrayLength loop:{{B\d+}}
// CHECK-START: int Main.arrayLength(int[]) licm (after)
- // CHECK-DAG: [[NullCheck:l\d+]] NullCheck ( loop_header:null )
- // CHECK-DAG: ArrayLength [ [[NullCheck]] ] ( loop_header:null )
+ // CHECK-DAG: <<NullCheck:l\d+>> NullCheck loop:none
+ // CHECK-DAG: ArrayLength [<<NullCheck>>] loop:none
public static int arrayLength(int[] array) {
int result = 0;
diff --git a/test/446-checker-inliner2/src/Main.java b/test/446-checker-inliner2/src/Main.java
index ecf071e..9ed66d6 100644
--- a/test/446-checker-inliner2/src/Main.java
+++ b/test/446-checker-inliner2/src/Main.java
@@ -17,15 +17,15 @@
public class Main {
// CHECK-START: int Main.inlineInstanceCall(Main) inliner (before)
- // CHECK-DAG: [[Invoke:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.inlineInstanceCall(Main) inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
// CHECK-START: int Main.inlineInstanceCall(Main) inliner (after)
- // CHECK-DAG: [[Field:i\d+]] InstanceFieldGet
- // CHECK-DAG: Return [ [[Field]] ]
+ // CHECK-DAG: <<Field:i\d+>> InstanceFieldGet
+ // CHECK-DAG: Return [<<Field>>]
public static int inlineInstanceCall(Main m) {
return m.foo();
@@ -38,15 +38,15 @@
int field = 42;
// CHECK-START: int Main.inlineNestedCall() inliner (before)
- // CHECK-DAG: [[Invoke:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.inlineNestedCall() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
// CHECK-START: int Main.inlineNestedCall() inliner (after)
- // CHECK-DAG: [[Const38:i\d+]] IntConstant 38
- // CHECK-DAG: Return [ [[Const38]] ]
+ // CHECK-DAG: <<Const38:i\d+>> IntConstant 38
+ // CHECK-DAG: Return [<<Const38>>]
public static int inlineNestedCall() {
return nestedCall();
diff --git a/test/447-checker-inliner3/src/Main.java b/test/447-checker-inliner3/src/Main.java
index db4b236..9d022b9 100644
--- a/test/447-checker-inliner3/src/Main.java
+++ b/test/447-checker-inliner3/src/Main.java
@@ -17,8 +17,8 @@
public class Main {
// CHECK-START: int Main.inlineIfThenElse() inliner (before)
- // CHECK-DAG: [[Invoke:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.inlineIfThenElse() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
diff --git a/test/458-checker-instruction-simplification/src/Main.java b/test/458-checker-instruction-simplification/src/Main.java
index efb7b83..742210c 100644
--- a/test/458-checker-instruction-simplification/src/Main.java
+++ b/test/458-checker-instruction-simplification/src/Main.java
@@ -51,14 +51,14 @@
*/
// CHECK-START: long Main.Add0(long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
- // CHECK-DAG: [[Add:j\d+]] Add [ [[Const0]] [[Arg]] ]
- // CHECK-DAG: Return [ [[Add]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
+ // CHECK-DAG: <<Add:j\d+>> Add [<<Const0>>,<<Arg>>]
+ // CHECK-DAG: Return [<<Add>>]
// CHECK-START: long Main.Add0(long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: long Main.Add0(long) instruction_simplifier (after)
// CHECK-NOT: Add
@@ -68,14 +68,14 @@
}
// CHECK-START: int Main.AndAllOnes(int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[ConstF:i\d+]] IntConstant -1
- // CHECK-DAG: [[And:i\d+]] And [ [[Arg]] [[ConstF]] ]
- // CHECK-DAG: Return [ [[And]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<ConstF:i\d+>> IntConstant -1
+ // CHECK-DAG: <<And:i\d+>> And [<<Arg>>,<<ConstF>>]
+ // CHECK-DAG: Return [<<And>>]
// CHECK-START: int Main.AndAllOnes(int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: int Main.AndAllOnes(int) instruction_simplifier (after)
// CHECK-NOT: And
@@ -85,14 +85,14 @@
}
// CHECK-START: long Main.Div1(long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const1:j\d+]] LongConstant 1
- // CHECK-DAG: [[Div:j\d+]] Div [ [[Arg]] [[Const1]] ]
- // CHECK-DAG: Return [ [[Div]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const1:j\d+>> LongConstant 1
+ // CHECK-DAG: <<Div:j\d+>> Div [<<Arg>>,<<Const1>>]
+ // CHECK-DAG: Return [<<Div>>]
// CHECK-START: long Main.Div1(long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: long Main.Div1(long) instruction_simplifier (after)
// CHECK-NOT: Div
@@ -102,15 +102,15 @@
}
// CHECK-START: int Main.DivN1(int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[ConstN1:i\d+]] IntConstant -1
- // CHECK-DAG: [[Div:i\d+]] Div [ [[Arg]] [[ConstN1]] ]
- // CHECK-DAG: Return [ [[Div]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<ConstN1:i\d+>> IntConstant -1
+ // CHECK-DAG: <<Div:i\d+>> Div [<<Arg>>,<<ConstN1>>]
+ // CHECK-DAG: Return [<<Div>>]
// CHECK-START: int Main.DivN1(int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Neg:i\d+]] Neg [ [[Arg]] ]
- // CHECK-DAG: Return [ [[Neg]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Neg:i\d+>> Neg [<<Arg>>]
+ // CHECK-DAG: Return [<<Neg>>]
// CHECK-START: int Main.DivN1(int) instruction_simplifier (after)
// CHECK-NOT: Div
@@ -120,14 +120,14 @@
}
// CHECK-START: long Main.Mul1(long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const1:j\d+]] LongConstant 1
- // CHECK-DAG: [[Mul:j\d+]] Mul [ [[Arg]] [[Const1]] ]
- // CHECK-DAG: Return [ [[Mul]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const1:j\d+>> LongConstant 1
+ // CHECK-DAG: <<Mul:j\d+>> Mul [<<Arg>>,<<Const1>>]
+ // CHECK-DAG: Return [<<Mul>>]
// CHECK-START: long Main.Mul1(long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: long Main.Mul1(long) instruction_simplifier (after)
// CHECK-NOT: Mul
@@ -137,15 +137,15 @@
}
// CHECK-START: int Main.MulN1(int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[ConstN1:i\d+]] IntConstant -1
- // CHECK-DAG: [[Mul:i\d+]] Mul [ [[Arg]] [[ConstN1]] ]
- // CHECK-DAG: Return [ [[Mul]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<ConstN1:i\d+>> IntConstant -1
+ // CHECK-DAG: <<Mul:i\d+>> Mul [<<Arg>>,<<ConstN1>>]
+ // CHECK-DAG: Return [<<Mul>>]
// CHECK-START: int Main.MulN1(int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Neg:i\d+]] Neg [ [[Arg]] ]
- // CHECK-DAG: Return [ [[Neg]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Neg:i\d+>> Neg [<<Arg>>]
+ // CHECK-DAG: Return [<<Neg>>]
// CHECK-START: int Main.MulN1(int) instruction_simplifier (after)
// CHECK-NOT: Mul
@@ -155,16 +155,16 @@
}
// CHECK-START: long Main.MulPowerOfTwo128(long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const128:j\d+]] LongConstant 128
- // CHECK-DAG: [[Mul:j\d+]] Mul [ [[Arg]] [[Const128]] ]
- // CHECK-DAG: Return [ [[Mul]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const128:j\d+>> LongConstant 128
+ // CHECK-DAG: <<Mul:j\d+>> Mul [<<Arg>>,<<Const128>>]
+ // CHECK-DAG: Return [<<Mul>>]
// CHECK-START: long Main.MulPowerOfTwo128(long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const7:i\d+]] IntConstant 7
- // CHECK-DAG: [[Shl:j\d+]] Shl [ [[Arg]] [[Const7]] ]
- // CHECK-DAG: Return [ [[Shl]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const7:i\d+>> IntConstant 7
+ // CHECK-DAG: <<Shl:j\d+>> Shl [<<Arg>>,<<Const7>>]
+ // CHECK-DAG: Return [<<Shl>>]
// CHECK-START: long Main.MulPowerOfTwo128(long) instruction_simplifier (after)
// CHECK-NOT: Mul
@@ -174,14 +174,14 @@
}
// CHECK-START: int Main.Or0(int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Or:i\d+]] Or [ [[Arg]] [[Const0]] ]
- // CHECK-DAG: Return [ [[Or]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Or:i\d+>> Or [<<Arg>>,<<Const0>>]
+ // CHECK-DAG: Return [<<Or>>]
// CHECK-START: int Main.Or0(int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: int Main.Or0(int) instruction_simplifier (after)
// CHECK-NOT: Or
@@ -191,13 +191,13 @@
}
// CHECK-START: long Main.OrSame(long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Or:j\d+]] Or [ [[Arg]] [[Arg]] ]
- // CHECK-DAG: Return [ [[Or]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Or:j\d+>> Or [<<Arg>>,<<Arg>>]
+ // CHECK-DAG: Return [<<Or>>]
// CHECK-START: long Main.OrSame(long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: long Main.OrSame(long) instruction_simplifier (after)
// CHECK-NOT: Or
@@ -207,14 +207,14 @@
}
// CHECK-START: int Main.Shl0(int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Shl:i\d+]] Shl [ [[Arg]] [[Const0]] ]
- // CHECK-DAG: Return [ [[Shl]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Shl:i\d+>> Shl [<<Arg>>,<<Const0>>]
+ // CHECK-DAG: Return [<<Shl>>]
// CHECK-START: int Main.Shl0(int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: int Main.Shl0(int) instruction_simplifier (after)
// CHECK-NOT: Shl
@@ -224,15 +224,15 @@
}
// CHECK-START: int Main.Shl1(int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Shl:i\d+]] Shl [ [[Arg]] [[Const1]] ]
- // CHECK-DAG: Return [ [[Shl]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Shl:i\d+>> Shl [<<Arg>>,<<Const1>>]
+ // CHECK-DAG: Return [<<Shl>>]
// CHECK-START: int Main.Shl1(int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Arg]] [[Arg]] ]
- // CHECK-DAG: Return [ [[Add]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Arg>>,<<Arg>>]
+ // CHECK-DAG: Return [<<Add>>]
// CHECK-START: int Main.Shl1(int) instruction_simplifier (after)
// CHECK-NOT: Shl
@@ -242,14 +242,14 @@
}
// CHECK-START: long Main.Shr0(long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Shr:j\d+]] Shr [ [[Arg]] [[Const0]] ]
- // CHECK-DAG: Return [ [[Shr]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Shr:j\d+>> Shr [<<Arg>>,<<Const0>>]
+ // CHECK-DAG: Return [<<Shr>>]
// CHECK-START: long Main.Shr0(long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: long Main.Shr0(long) instruction_simplifier (after)
// CHECK-NOT: Shr
@@ -259,14 +259,14 @@
}
// CHECK-START: long Main.Sub0(long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
- // CHECK-DAG: [[Sub:j\d+]] Sub [ [[Arg]] [[Const0]] ]
- // CHECK-DAG: Return [ [[Sub]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
+ // CHECK-DAG: <<Sub:j\d+>> Sub [<<Arg>>,<<Const0>>]
+ // CHECK-DAG: Return [<<Sub>>]
// CHECK-START: long Main.Sub0(long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: long Main.Sub0(long) instruction_simplifier (after)
// CHECK-NOT: Sub
@@ -276,15 +276,15 @@
}
// CHECK-START: int Main.SubAliasNeg(int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[Const0]] [[Arg]] ]
- // CHECK-DAG: Return [ [[Sub]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<Const0>>,<<Arg>>]
+ // CHECK-DAG: Return [<<Sub>>]
// CHECK-START: int Main.SubAliasNeg(int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Neg:i\d+]] Neg [ [[Arg]] ]
- // CHECK-DAG: Return [ [[Neg]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Neg:i\d+>> Neg [<<Arg>>]
+ // CHECK-DAG: Return [<<Neg>>]
// CHECK-START: int Main.SubAliasNeg(int) instruction_simplifier (after)
// CHECK-NOT: Sub
@@ -294,14 +294,14 @@
}
// CHECK-START: long Main.UShr0(long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[UShr:j\d+]] UShr [ [[Arg]] [[Const0]] ]
- // CHECK-DAG: Return [ [[UShr]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<UShr:j\d+>> UShr [<<Arg>>,<<Const0>>]
+ // CHECK-DAG: Return [<<UShr>>]
// CHECK-START: long Main.UShr0(long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: long Main.UShr0(long) instruction_simplifier (after)
// CHECK-NOT: UShr
@@ -311,14 +311,14 @@
}
// CHECK-START: int Main.Xor0(int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Xor:i\d+]] Xor [ [[Arg]] [[Const0]] ]
- // CHECK-DAG: Return [ [[Xor]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Xor:i\d+>> Xor [<<Arg>>,<<Const0>>]
+ // CHECK-DAG: Return [<<Xor>>]
// CHECK-START: int Main.Xor0(int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: int Main.Xor0(int) instruction_simplifier (after)
// CHECK-NOT: Xor
@@ -328,15 +328,15 @@
}
// CHECK-START: int Main.XorAllOnes(int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[ConstF:i\d+]] IntConstant -1
- // CHECK-DAG: [[Xor:i\d+]] Xor [ [[Arg]] [[ConstF]] ]
- // CHECK-DAG: Return [ [[Xor]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<ConstF:i\d+>> IntConstant -1
+ // CHECK-DAG: <<Xor:i\d+>> Xor [<<Arg>>,<<ConstF>>]
+ // CHECK-DAG: Return [<<Xor>>]
// CHECK-START: int Main.XorAllOnes(int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Not:i\d+]] Not [ [[Arg]] ]
- // CHECK-DAG: Return [ [[Not]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Not:i\d+>> Not [<<Arg>>]
+ // CHECK-DAG: Return [<<Not>>]
// CHECK-START: int Main.XorAllOnes(int) instruction_simplifier (after)
// CHECK-NOT: Xor
@@ -353,20 +353,20 @@
*/
// CHECK-START: int Main.AddNegs1(int, int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Neg1:i\d+]] Neg [ [[Arg1]] ]
- // CHECK-DAG: [[Neg2:i\d+]] Neg [ [[Arg2]] ]
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Neg1]] [[Neg2]] ]
- // CHECK-DAG: Return [ [[Add]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Neg1:i\d+>> Neg [<<Arg1>>]
+ // CHECK-DAG: <<Neg2:i\d+>> Neg [<<Arg2>>]
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Neg1>>,<<Neg2>>]
+ // CHECK-DAG: Return [<<Add>>]
// CHECK-START: int Main.AddNegs1(int, int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
// CHECK-NOT: Neg
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Arg1]] [[Arg2]] ]
- // CHECK-DAG: [[Neg:i\d+]] Neg [ [[Add]] ]
- // CHECK-DAG: Return [ [[Neg]] ]
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Arg1>>,<<Arg2>>]
+ // CHECK-DAG: <<Neg:i\d+>> Neg [<<Add>>]
+ // CHECK-DAG: Return [<<Neg>>]
public static int AddNegs1(int arg1, int arg2) {
return -arg1 + -arg2;
@@ -384,34 +384,34 @@
*/
// CHECK-START: int Main.AddNegs2(int, int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Neg1:i\d+]] Neg [ [[Arg1]] ]
- // CHECK-DAG: [[Neg2:i\d+]] Neg [ [[Arg2]] ]
- // CHECK-DAG: [[Add1:i\d+]] Add [ [[Neg1]] [[Neg2]] ]
- // CHECK-DAG: [[Add2:i\d+]] Add [ [[Neg1]] [[Neg2]] ]
- // CHECK-DAG: [[Or:i\d+]] Or [ [[Add1]] [[Add2]] ]
- // CHECK-DAG: Return [ [[Or]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Neg1:i\d+>> Neg [<<Arg1>>]
+ // CHECK-DAG: <<Neg2:i\d+>> Neg [<<Arg2>>]
+ // CHECK-DAG: <<Add1:i\d+>> Add [<<Neg1>>,<<Neg2>>]
+ // CHECK-DAG: <<Add2:i\d+>> Add [<<Neg1>>,<<Neg2>>]
+ // CHECK-DAG: <<Or:i\d+>> Or [<<Add1>>,<<Add2>>]
+ // CHECK-DAG: Return [<<Or>>]
// CHECK-START: int Main.AddNegs2(int, int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Neg1:i\d+]] Neg [ [[Arg1]] ]
- // CHECK-DAG: [[Neg2:i\d+]] Neg [ [[Arg2]] ]
- // CHECK-DAG: [[Add1:i\d+]] Add [ [[Neg1]] [[Neg2]] ]
- // CHECK-DAG: [[Add2:i\d+]] Add [ [[Neg1]] [[Neg2]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Neg1:i\d+>> Neg [<<Arg1>>]
+ // CHECK-DAG: <<Neg2:i\d+>> Neg [<<Arg2>>]
+ // CHECK-DAG: <<Add1:i\d+>> Add [<<Neg1>>,<<Neg2>>]
+ // CHECK-DAG: <<Add2:i\d+>> Add [<<Neg1>>,<<Neg2>>]
// CHECK-NOT: Neg
- // CHECK-DAG: [[Or:i\d+]] Or [ [[Add1]] [[Add2]] ]
- // CHECK-DAG: Return [ [[Or]] ]
+ // CHECK-DAG: <<Or:i\d+>> Or [<<Add1>>,<<Add2>>]
+ // CHECK-DAG: Return [<<Or>>]
// CHECK-START: int Main.AddNegs2(int, int) GVN (after)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Neg1:i\d+]] Neg [ [[Arg1]] ]
- // CHECK-DAG: [[Neg2:i\d+]] Neg [ [[Arg2]] ]
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Neg1]] [[Neg2]] ]
- // CHECK-DAG: [[Or:i\d+]] Or [ [[Add]] [[Add]] ]
- // CHECK-DAG: Return [ [[Or]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Neg1:i\d+>> Neg [<<Arg1>>]
+ // CHECK-DAG: <<Neg2:i\d+>> Neg [<<Arg2>>]
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Neg1>>,<<Neg2>>]
+ // CHECK-DAG: <<Or:i\d+>> Or [<<Add>>,<<Add>>]
+ // CHECK-DAG: Return [<<Or>>]
public static int AddNegs2(int arg1, int arg2) {
int temp1 = -arg1;
@@ -429,26 +429,26 @@
// CHECK-START: long Main.AddNegs3(long, long) instruction_simplifier (before)
// -------------- Arguments and initial negation operations.
- // CHECK-DAG: [[Arg1:j\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:j\d+]] ParameterValue
- // CHECK-DAG: [[Neg1:j\d+]] Neg [ [[Arg1]] ]
- // CHECK-DAG: [[Neg2:j\d+]] Neg [ [[Arg2]] ]
+ // CHECK-DAG: <<Arg1:j\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:j\d+>> ParameterValue
+ // CHECK-DAG: <<Neg1:j\d+>> Neg [<<Arg1>>]
+ // CHECK-DAG: <<Neg2:j\d+>> Neg [<<Arg2>>]
// CHECK: Goto
// -------------- Loop
// CHECK: SuspendCheck
- // CHECK: [[Add:j\d+]] Add [ [[Neg1]] [[Neg2]] ]
+ // CHECK: <<Add:j\d+>> Add [<<Neg1>>,<<Neg2>>]
// CHECK: Goto
// CHECK-START: long Main.AddNegs3(long, long) instruction_simplifier (after)
// -------------- Arguments and initial negation operations.
- // CHECK-DAG: [[Arg1:j\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:j\d+]] ParameterValue
- // CHECK-DAG: [[Neg1:j\d+]] Neg [ [[Arg1]] ]
- // CHECK-DAG: [[Neg2:j\d+]] Neg [ [[Arg2]] ]
+ // CHECK-DAG: <<Arg1:j\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:j\d+>> ParameterValue
+ // CHECK-DAG: <<Neg1:j\d+>> Neg [<<Arg1>>]
+ // CHECK-DAG: <<Neg2:j\d+>> Neg [<<Arg2>>]
// CHECK: Goto
// -------------- Loop
// CHECK: SuspendCheck
- // CHECK: [[Add:j\d+]] Add [ [[Neg1]] [[Neg2]] ]
+ // CHECK: <<Add:j\d+>> Add [<<Neg1>>,<<Neg2>>]
// CHECK-NOT: Neg
// CHECK: Goto
@@ -469,17 +469,17 @@
*/
// CHECK-START: long Main.AddNeg1(long, long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg1:j\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:j\d+]] ParameterValue
- // CHECK-DAG: [[Neg:j\d+]] Neg [ [[Arg1]] ]
- // CHECK-DAG: [[Add:j\d+]] Add [ [[Neg]] [[Arg2]] ]
- // CHECK-DAG: Return [ [[Add]] ]
+ // CHECK-DAG: <<Arg1:j\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:j\d+>> ParameterValue
+ // CHECK-DAG: <<Neg:j\d+>> Neg [<<Arg1>>]
+ // CHECK-DAG: <<Add:j\d+>> Add [<<Neg>>,<<Arg2>>]
+ // CHECK-DAG: Return [<<Add>>]
// CHECK-START: long Main.AddNeg1(long, long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg1:j\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:j\d+]] ParameterValue
- // CHECK-DAG: [[Sub:j\d+]] Sub [ [[Arg2]] [[Arg1]] ]
- // CHECK-DAG: Return [ [[Sub]] ]
+ // CHECK-DAG: <<Arg1:j\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:j\d+>> ParameterValue
+ // CHECK-DAG: <<Sub:j\d+>> Sub [<<Arg2>>,<<Arg1>>]
+ // CHECK-DAG: Return [<<Sub>>]
// CHECK-START: long Main.AddNeg1(long, long) instruction_simplifier (after)
// CHECK-NOT: Neg
@@ -499,22 +499,22 @@
*/
// CHECK-START: long Main.AddNeg2(long, long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg1:j\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:j\d+]] ParameterValue
- // CHECK-DAG: [[Neg:j\d+]] Neg [ [[Arg2]] ]
- // CHECK-DAG: [[Add1:j\d+]] Add [ [[Arg1]] [[Neg]] ]
- // CHECK-DAG: [[Add2:j\d+]] Add [ [[Arg1]] [[Neg]] ]
- // CHECK-DAG: [[Res:j\d+]] Or [ [[Add1]] [[Add2]] ]
- // CHECK-DAG: Return [ [[Res]] ]
+ // CHECK-DAG: <<Arg1:j\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:j\d+>> ParameterValue
+ // CHECK-DAG: <<Neg:j\d+>> Neg [<<Arg2>>]
+ // CHECK-DAG: <<Add1:j\d+>> Add [<<Arg1>>,<<Neg>>]
+ // CHECK-DAG: <<Add2:j\d+>> Add [<<Arg1>>,<<Neg>>]
+ // CHECK-DAG: <<Res:j\d+>> Or [<<Add1>>,<<Add2>>]
+ // CHECK-DAG: Return [<<Res>>]
// CHECK-START: long Main.AddNeg2(long, long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg1:j\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:j\d+]] ParameterValue
- // CHECK-DAG: [[Neg:j\d+]] Neg [ [[Arg2]] ]
- // CHECK-DAG: [[Add1:j\d+]] Add [ [[Arg1]] [[Neg]] ]
- // CHECK-DAG: [[Add2:j\d+]] Add [ [[Arg1]] [[Neg]] ]
- // CHECK-DAG: [[Res:j\d+]] Or [ [[Add1]] [[Add2]] ]
- // CHECK-DAG: Return [ [[Res]] ]
+ // CHECK-DAG: <<Arg1:j\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:j\d+>> ParameterValue
+ // CHECK-DAG: <<Neg:j\d+>> Neg [<<Arg2>>]
+ // CHECK-DAG: <<Add1:j\d+>> Add [<<Arg1>>,<<Neg>>]
+ // CHECK-DAG: <<Add2:j\d+>> Add [<<Arg1>>,<<Neg>>]
+ // CHECK-DAG: <<Res:j\d+>> Or [<<Add1>>,<<Add2>>]
+ // CHECK-DAG: Return [<<Res>>]
// CHECK-START: long Main.AddNeg2(long, long) instruction_simplifier (after)
// CHECK-NOT: Sub
@@ -530,14 +530,14 @@
*/
// CHECK-START: long Main.NegNeg1(long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Neg1:j\d+]] Neg [ [[Arg]] ]
- // CHECK-DAG: [[Neg2:j\d+]] Neg [ [[Neg1]] ]
- // CHECK-DAG: Return [ [[Neg2]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Neg1:j\d+>> Neg [<<Arg>>]
+ // CHECK-DAG: <<Neg2:j\d+>> Neg [<<Neg1>>]
+ // CHECK-DAG: Return [<<Neg2>>]
// CHECK-START: long Main.NegNeg1(long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: long Main.NegNeg1(long) instruction_simplifier (after)
// CHECK-NOT: Neg
@@ -554,26 +554,26 @@
*/
// CHECK-START: int Main.NegNeg2(int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Neg1:i\d+]] Neg [ [[Arg]] ]
- // CHECK-DAG: [[Neg2:i\d+]] Neg [ [[Neg1]] ]
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Neg1]] [[Neg2]] ]
- // CHECK-DAG: Return [ [[Add]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Neg1:i\d+>> Neg [<<Arg>>]
+ // CHECK-DAG: <<Neg2:i\d+>> Neg [<<Neg1>>]
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Neg1>>,<<Neg2>>]
+ // CHECK-DAG: Return [<<Add>>]
// CHECK-START: int Main.NegNeg2(int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[Arg]] [[Arg]] ]
- // CHECK-DAG: Return [ [[Sub]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<Arg>>,<<Arg>>]
+ // CHECK-DAG: Return [<<Sub>>]
// CHECK-START: int Main.NegNeg2(int) instruction_simplifier (after)
// CHECK-NOT: Neg
// CHECK-NOT: Add
// CHECK-START: int Main.NegNeg2(int) constant_folding_after_inlining (after)
- // CHECK: [[Const0:i\d+]] IntConstant 0
+ // CHECK: <<Const0:i\d+>> IntConstant 0
// CHECK-NOT: Neg
// CHECK-NOT: Add
- // CHECK: Return [ [[Const0]] ]
+ // CHECK: Return [<<Const0>>]
public static int NegNeg2(int arg) {
int temp = -arg;
@@ -588,15 +588,15 @@
*/
// CHECK-START: long Main.NegNeg3(long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[Const0:j\d+]] LongConstant 0
- // CHECK-DAG: [[Neg:j\d+]] Neg [ [[Arg]] ]
- // CHECK-DAG: [[Sub:j\d+]] Sub [ [[Const0]] [[Neg]] ]
- // CHECK-DAG: Return [ [[Sub]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:j\d+>> LongConstant 0
+ // CHECK-DAG: <<Neg:j\d+>> Neg [<<Arg>>]
+ // CHECK-DAG: <<Sub:j\d+>> Sub [<<Const0>>,<<Neg>>]
+ // CHECK-DAG: Return [<<Sub>>]
// CHECK-START: long Main.NegNeg3(long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: long Main.NegNeg3(long) instruction_simplifier (after)
// CHECK-NOT: Neg
@@ -613,17 +613,17 @@
*/
// CHECK-START: int Main.NegSub1(int, int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[Arg1]] [[Arg2]] ]
- // CHECK-DAG: [[Neg:i\d+]] Neg [ [[Sub]] ]
- // CHECK-DAG: Return [ [[Neg]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<Arg1>>,<<Arg2>>]
+ // CHECK-DAG: <<Neg:i\d+>> Neg [<<Sub>>]
+ // CHECK-DAG: Return [<<Neg>>]
// CHECK-START: int Main.NegSub1(int, int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[Arg2]] [[Arg1]] ]
- // CHECK-DAG: Return [ [[Sub]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<Arg2>>,<<Arg1>>]
+ // CHECK-DAG: Return [<<Sub>>]
// CHECK-START: int Main.NegSub1(int, int) instruction_simplifier (after)
// CHECK-NOT: Neg
@@ -643,22 +643,22 @@
*/
// CHECK-START: int Main.NegSub2(int, int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[Arg1]] [[Arg2]] ]
- // CHECK-DAG: [[Neg1:i\d+]] Neg [ [[Sub]] ]
- // CHECK-DAG: [[Neg2:i\d+]] Neg [ [[Sub]] ]
- // CHECK-DAG: [[Or:i\d+]] Or [ [[Neg1]] [[Neg2]] ]
- // CHECK-DAG: Return [ [[Or]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<Arg1>>,<<Arg2>>]
+ // CHECK-DAG: <<Neg1:i\d+>> Neg [<<Sub>>]
+ // CHECK-DAG: <<Neg2:i\d+>> Neg [<<Sub>>]
+ // CHECK-DAG: <<Or:i\d+>> Or [<<Neg1>>,<<Neg2>>]
+ // CHECK-DAG: Return [<<Or>>]
// CHECK-START: int Main.NegSub2(int, int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[Arg1]] [[Arg2]] ]
- // CHECK-DAG: [[Neg1:i\d+]] Neg [ [[Sub]] ]
- // CHECK-DAG: [[Neg2:i\d+]] Neg [ [[Sub]] ]
- // CHECK-DAG: [[Or:i\d+]] Or [ [[Neg1]] [[Neg2]] ]
- // CHECK-DAG: Return [ [[Or]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<Arg1>>,<<Arg2>>]
+ // CHECK-DAG: <<Neg1:i\d+>> Neg [<<Sub>>]
+ // CHECK-DAG: <<Neg2:i\d+>> Neg [<<Sub>>]
+ // CHECK-DAG: <<Or:i\d+>> Or [<<Neg1>>,<<Neg2>>]
+ // CHECK-DAG: Return [<<Or>>]
public static int NegSub2(int arg1, int arg2) {
int temp = arg1 - arg2;
@@ -671,15 +671,15 @@
*/
// CHECK-START: long Main.NotNot1(long) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: [[ConstF1:j\d+]] LongConstant -1
- // CHECK-DAG: [[Xor1:j\d+]] Xor [ [[Arg]] [[ConstF1]] ]
- // CHECK-DAG: [[Xor2:j\d+]] Xor [ [[Xor1]] [[ConstF1]] ]
- // CHECK-DAG: Return [ [[Xor2]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: <<ConstF1:j\d+>> LongConstant -1
+ // CHECK-DAG: <<Xor1:j\d+>> Xor [<<Arg>>,<<ConstF1>>]
+ // CHECK-DAG: <<Xor2:j\d+>> Xor [<<Xor1>>,<<ConstF1>>]
+ // CHECK-DAG: Return [<<Xor2>>]
// CHECK-START: long Main.NotNot1(long) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:j\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:j\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: long Main.NotNot1(long) instruction_simplifier (after)
// CHECK-NOT: Xor
@@ -689,18 +689,18 @@
}
// CHECK-START: int Main.NotNot2(int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[ConstF1:i\d+]] IntConstant -1
- // CHECK-DAG: [[Xor1:i\d+]] Xor [ [[Arg]] [[ConstF1]] ]
- // CHECK-DAG: [[Xor2:i\d+]] Xor [ [[Xor1]] [[ConstF1]] ]
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Xor1]] [[Xor2]] ]
- // CHECK-DAG: Return [ [[Add]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<ConstF1:i\d+>> IntConstant -1
+ // CHECK-DAG: <<Xor1:i\d+>> Xor [<<Arg>>,<<ConstF1>>]
+ // CHECK-DAG: <<Xor2:i\d+>> Xor [<<Xor1>>,<<ConstF1>>]
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Xor1>>,<<Xor2>>]
+ // CHECK-DAG: Return [<<Add>>]
// CHECK-START: int Main.NotNot2(int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: [[Not:i\d+]] Not [ [[Arg]] ]
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Not]] [[Arg]] ]
- // CHECK-DAG: Return [ [[Add]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: <<Not:i\d+>> Not [<<Arg>>]
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Not>>,<<Arg>>]
+ // CHECK-DAG: Return [<<Add>>]
// CHECK-START: int Main.NotNot2(int) instruction_simplifier (after)
// CHECK-NOT: Xor
@@ -716,18 +716,18 @@
*/
// CHECK-START: int Main.SubNeg1(int, int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Neg:i\d+]] Neg [ [[Arg1]] ]
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[Neg]] [[Arg2]] ]
- // CHECK-DAG: Return [ [[Sub]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Neg:i\d+>> Neg [<<Arg1>>]
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<Neg>>,<<Arg2>>]
+ // CHECK-DAG: Return [<<Sub>>]
// CHECK-START: int Main.SubNeg1(int, int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Add:i\d+]] Add [ [[Arg1]] [[Arg2]] ]
- // CHECK-DAG: [[Neg:i\d+]] Neg [ [[Add]] ]
- // CHECK-DAG: Return [ [[Neg]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Add:i\d+>> Add [<<Arg1>>,<<Arg2>>]
+ // CHECK-DAG: <<Neg:i\d+>> Neg [<<Add>>]
+ // CHECK-DAG: Return [<<Neg>>]
// CHECK-START: int Main.SubNeg1(int, int) instruction_simplifier (after)
// CHECK-NOT: Sub
@@ -747,22 +747,22 @@
*/
// CHECK-START: int Main.SubNeg2(int, int) instruction_simplifier (before)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Neg:i\d+]] Neg [ [[Arg1]] ]
- // CHECK-DAG: [[Sub1:i\d+]] Sub [ [[Neg]] [[Arg2]] ]
- // CHECK-DAG: [[Sub2:i\d+]] Sub [ [[Neg]] [[Arg2]] ]
- // CHECK-DAG: [[Or:i\d+]] Or [ [[Sub1]] [[Sub2]] ]
- // CHECK-DAG: Return [ [[Or]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Neg:i\d+>> Neg [<<Arg1>>]
+ // CHECK-DAG: <<Sub1:i\d+>> Sub [<<Neg>>,<<Arg2>>]
+ // CHECK-DAG: <<Sub2:i\d+>> Sub [<<Neg>>,<<Arg2>>]
+ // CHECK-DAG: <<Or:i\d+>> Or [<<Sub1>>,<<Sub2>>]
+ // CHECK-DAG: Return [<<Or>>]
// CHECK-START: int Main.SubNeg2(int, int) instruction_simplifier (after)
- // CHECK-DAG: [[Arg1:i\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:i\d+]] ParameterValue
- // CHECK-DAG: [[Neg:i\d+]] Neg [ [[Arg1]] ]
- // CHECK-DAG: [[Sub1:i\d+]] Sub [ [[Neg]] [[Arg2]] ]
- // CHECK-DAG: [[Sub2:i\d+]] Sub [ [[Neg]] [[Arg2]] ]
- // CHECK-DAG: [[Or:i\d+]] Or [ [[Sub1]] [[Sub2]] ]
- // CHECK-DAG: Return [ [[Or]] ]
+ // CHECK-DAG: <<Arg1:i\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:i\d+>> ParameterValue
+ // CHECK-DAG: <<Neg:i\d+>> Neg [<<Arg1>>]
+ // CHECK-DAG: <<Sub1:i\d+>> Sub [<<Neg>>,<<Arg2>>]
+ // CHECK-DAG: <<Sub2:i\d+>> Sub [<<Neg>>,<<Arg2>>]
+ // CHECK-DAG: <<Or:i\d+>> Or [<<Sub1>>,<<Sub2>>]
+ // CHECK-DAG: Return [<<Or>>]
// CHECK-START: int Main.SubNeg2(int, int) instruction_simplifier (after)
// CHECK-NOT: Add
@@ -781,24 +781,24 @@
// CHECK-START: long Main.SubNeg3(long, long) instruction_simplifier (before)
// -------------- Arguments and initial negation operation.
- // CHECK-DAG: [[Arg1:j\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:j\d+]] ParameterValue
- // CHECK-DAG: [[Neg:j\d+]] Neg [ [[Arg1]] ]
+ // CHECK-DAG: <<Arg1:j\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:j\d+>> ParameterValue
+ // CHECK-DAG: <<Neg:j\d+>> Neg [<<Arg1>>]
// CHECK: Goto
// -------------- Loop
// CHECK: SuspendCheck
- // CHECK: [[Sub:j\d+]] Sub [ [[Neg]] [[Arg2]] ]
+ // CHECK: <<Sub:j\d+>> Sub [<<Neg>>,<<Arg2>>]
// CHECK: Goto
// CHECK-START: long Main.SubNeg3(long, long) instruction_simplifier (after)
// -------------- Arguments and initial negation operation.
- // CHECK-DAG: [[Arg1:j\d+]] ParameterValue
- // CHECK-DAG: [[Arg2:j\d+]] ParameterValue
- // CHECK-DAG: [[Neg:j\d+]] Neg [ [[Arg1]] ]
+ // CHECK-DAG: <<Arg1:j\d+>> ParameterValue
+ // CHECK-DAG: <<Arg2:j\d+>> ParameterValue
+ // CHECK-DAG: <<Neg:j\d+>> Neg [<<Arg1>>]
// CHECK-DAG: Goto
// -------------- Loop
// CHECK: SuspendCheck
- // CHECK: [[Sub:j\d+]] Sub [ [[Neg]] [[Arg2]] ]
+ // CHECK: <<Sub:j\d+>> Sub [<<Neg>>,<<Arg2>>]
// CHECK-NOT: Neg
// CHECK: Goto
@@ -812,116 +812,116 @@
}
// CHECK-START: int Main.EqualTrueRhs(boolean) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Cond:z\d+]] Equal [ [[Arg]] [[Const1]] ]
- // CHECK-DAG: If [ [[Cond]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Cond:z\d+>> Equal [<<Arg>>,<<Const1>>]
+ // CHECK-DAG: If [<<Cond>>]
// CHECK-START: int Main.EqualTrueRhs(boolean) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: If [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: If [<<Arg>>]
public static int EqualTrueRhs(boolean arg) {
return (arg != true) ? 3 : 5;
}
// CHECK-START: int Main.EqualTrueLhs(boolean) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Cond:z\d+]] Equal [ [[Const1]] [[Arg]] ]
- // CHECK-DAG: If [ [[Cond]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Cond:z\d+>> Equal [<<Const1>>,<<Arg>>]
+ // CHECK-DAG: If [<<Cond>>]
// CHECK-START: int Main.EqualTrueLhs(boolean) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: If [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: If [<<Arg>>]
public static int EqualTrueLhs(boolean arg) {
return (true != arg) ? 3 : 5;
}
// CHECK-START: int Main.EqualFalseRhs(boolean) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Cond:z\d+]] Equal [ [[Arg]] [[Const0]] ]
- // CHECK-DAG: If [ [[Cond]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Cond:z\d+>> Equal [<<Arg>>,<<Const0>>]
+ // CHECK-DAG: If [<<Cond>>]
// CHECK-START: int Main.EqualFalseRhs(boolean) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[NotArg:z\d+]] BooleanNot [ [[Arg]] ]
- // CHECK-DAG: If [ [[NotArg]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<NotArg:z\d+>> BooleanNot [<<Arg>>]
+ // CHECK-DAG: If [<<NotArg>>]
public static int EqualFalseRhs(boolean arg) {
return (arg != false) ? 3 : 5;
}
// CHECK-START: int Main.EqualFalseLhs(boolean) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Cond:z\d+]] Equal [ [[Const0]] [[Arg]] ]
- // CHECK-DAG: If [ [[Cond]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Cond:z\d+>> Equal [<<Const0>>,<<Arg>>]
+ // CHECK-DAG: If [<<Cond>>]
// CHECK-START: int Main.EqualFalseLhs(boolean) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[NotArg:z\d+]] BooleanNot [ [[Arg]] ]
- // CHECK-DAG: If [ [[NotArg]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<NotArg:z\d+>> BooleanNot [<<Arg>>]
+ // CHECK-DAG: If [<<NotArg>>]
public static int EqualFalseLhs(boolean arg) {
return (false != arg) ? 3 : 5;
}
// CHECK-START: int Main.NotEqualTrueRhs(boolean) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Cond:z\d+]] NotEqual [ [[Arg]] [[Const1]] ]
- // CHECK-DAG: If [ [[Cond]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Cond:z\d+>> NotEqual [<<Arg>>,<<Const1>>]
+ // CHECK-DAG: If [<<Cond>>]
// CHECK-START: int Main.NotEqualTrueRhs(boolean) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[NotArg:z\d+]] BooleanNot [ [[Arg]] ]
- // CHECK-DAG: If [ [[NotArg]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<NotArg:z\d+>> BooleanNot [<<Arg>>]
+ // CHECK-DAG: If [<<NotArg>>]
public static int NotEqualTrueRhs(boolean arg) {
return (arg == true) ? 3 : 5;
}
// CHECK-START: int Main.NotEqualTrueLhs(boolean) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Cond:z\d+]] NotEqual [ [[Const1]] [[Arg]] ]
- // CHECK-DAG: If [ [[Cond]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Cond:z\d+>> NotEqual [<<Const1>>,<<Arg>>]
+ // CHECK-DAG: If [<<Cond>>]
// CHECK-START: int Main.NotEqualTrueLhs(boolean) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[NotArg:z\d+]] BooleanNot [ [[Arg]] ]
- // CHECK-DAG: If [ [[NotArg]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<NotArg:z\d+>> BooleanNot [<<Arg>>]
+ // CHECK-DAG: If [<<NotArg>>]
public static int NotEqualTrueLhs(boolean arg) {
return (true == arg) ? 3 : 5;
}
// CHECK-START: int Main.NotEqualFalseRhs(boolean) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Cond:z\d+]] NotEqual [ [[Arg]] [[Const0]] ]
- // CHECK-DAG: If [ [[Cond]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Cond:z\d+>> NotEqual [<<Arg>>,<<Const0>>]
+ // CHECK-DAG: If [<<Cond>>]
// CHECK-START: int Main.NotEqualFalseRhs(boolean) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: If [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: If [<<Arg>>]
public static int NotEqualFalseRhs(boolean arg) {
return (arg == false) ? 3 : 5;
}
// CHECK-START: int Main.NotEqualFalseLhs(boolean) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Cond:z\d+]] NotEqual [ [[Const0]] [[Arg]] ]
- // CHECK-DAG: If [ [[Cond]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Cond:z\d+>> NotEqual [<<Const0>>,<<Arg>>]
+ // CHECK-DAG: If [<<Cond>>]
// CHECK-START: int Main.NotEqualFalseLhs(boolean) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: If [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: If [<<Arg>>]
public static int NotEqualFalseLhs(boolean arg) {
return (false == arg) ? 3 : 5;
@@ -934,15 +934,15 @@
*/
// CHECK-START: boolean Main.NotNotBool(boolean) instruction_simplifier_after_types (before)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: [[NotArg:z\d+]] BooleanNot [ [[Arg]] ]
- // CHECK-DAG: [[NotNotArg:z\d+]] BooleanNot [ [[NotArg]] ]
- // CHECK-DAG: Return [ [[NotNotArg]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: <<NotArg:z\d+>> BooleanNot [<<Arg>>]
+ // CHECK-DAG: <<NotNotArg:z\d+>> BooleanNot [<<NotArg>>]
+ // CHECK-DAG: Return [<<NotNotArg>>]
// CHECK-START: boolean Main.NotNotBool(boolean) instruction_simplifier_after_types (after)
- // CHECK-DAG: [[Arg:z\d+]] ParameterValue
- // CHECK-DAG: BooleanNot [ [[Arg]] ]
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:z\d+>> ParameterValue
+ // CHECK-DAG: BooleanNot [<<Arg>>]
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: boolean Main.NotNotBool(boolean) instruction_simplifier_after_types (after)
// CHECK: BooleanNot
@@ -957,16 +957,16 @@
}
// CHECK-START: float Main.Div2(float) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:f\d+]] ParameterValue
- // CHECK-DAG: [[Const2:f\d+]] FloatConstant 2
- // CHECK-DAG: [[Div:f\d+]] Div [ [[Arg]] [[Const2]] ]
- // CHECK-DAG: Return [ [[Div]] ]
+ // CHECK-DAG: <<Arg:f\d+>> ParameterValue
+ // CHECK-DAG: <<Const2:f\d+>> FloatConstant 2
+ // CHECK-DAG: <<Div:f\d+>> Div [<<Arg>>,<<Const2>>]
+ // CHECK-DAG: Return [<<Div>>]
// CHECK-START: float Main.Div2(float) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:f\d+]] ParameterValue
- // CHECK-DAG: [[ConstP5:f\d+]] FloatConstant 0.5
- // CHECK-DAG: [[Mul:f\d+]] Mul [ [[Arg]] [[ConstP5]] ]
- // CHECK-DAG: Return [ [[Mul]] ]
+ // CHECK-DAG: <<Arg:f\d+>> ParameterValue
+ // CHECK-DAG: <<ConstP5:f\d+>> FloatConstant 0.5
+ // CHECK-DAG: <<Mul:f\d+>> Mul [<<Arg>>,<<ConstP5>>]
+ // CHECK-DAG: Return [<<Mul>>]
// CHECK-START: float Main.Div2(float) instruction_simplifier (after)
// CHECK-NOT: Div
@@ -976,16 +976,16 @@
}
// CHECK-START: double Main.Div2(double) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:d\d+]] ParameterValue
- // CHECK-DAG: [[Const2:d\d+]] DoubleConstant 2
- // CHECK-DAG: [[Div:d\d+]] Div [ [[Arg]] [[Const2]] ]
- // CHECK-DAG: Return [ [[Div]] ]
+ // CHECK-DAG: <<Arg:d\d+>> ParameterValue
+ // CHECK-DAG: <<Const2:d\d+>> DoubleConstant 2
+ // CHECK-DAG: <<Div:d\d+>> Div [<<Arg>>,<<Const2>>]
+ // CHECK-DAG: Return [<<Div>>]
// CHECK-START: double Main.Div2(double) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:d\d+]] ParameterValue
- // CHECK-DAG: [[ConstP5:d\d+]] DoubleConstant 0.5
- // CHECK-DAG: [[Mul:d\d+]] Mul [ [[Arg]] [[ConstP5]] ]
- // CHECK-DAG: Return [ [[Mul]] ]
+ // CHECK-DAG: <<Arg:d\d+>> ParameterValue
+ // CHECK-DAG: <<ConstP5:d\d+>> DoubleConstant 0.5
+ // CHECK-DAG: <<Mul:d\d+>> Mul [<<Arg>>,<<ConstP5>>]
+ // CHECK-DAG: Return [<<Mul>>]
// CHECK-START: double Main.Div2(double) instruction_simplifier (after)
// CHECK-NOT: Div
@@ -994,16 +994,16 @@
}
// CHECK-START: float Main.DivMP25(float) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:f\d+]] ParameterValue
- // CHECK-DAG: [[ConstMP25:f\d+]] FloatConstant -0.25
- // CHECK-DAG: [[Div:f\d+]] Div [ [[Arg]] [[ConstMP25]] ]
- // CHECK-DAG: Return [ [[Div]] ]
+ // CHECK-DAG: <<Arg:f\d+>> ParameterValue
+ // CHECK-DAG: <<ConstMP25:f\d+>> FloatConstant -0.25
+ // CHECK-DAG: <<Div:f\d+>> Div [<<Arg>>,<<ConstMP25>>]
+ // CHECK-DAG: Return [<<Div>>]
// CHECK-START: float Main.DivMP25(float) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:f\d+]] ParameterValue
- // CHECK-DAG: [[ConstM4:f\d+]] FloatConstant -4
- // CHECK-DAG: [[Mul:f\d+]] Mul [ [[Arg]] [[ConstM4]] ]
- // CHECK-DAG: Return [ [[Mul]] ]
+ // CHECK-DAG: <<Arg:f\d+>> ParameterValue
+ // CHECK-DAG: <<ConstM4:f\d+>> FloatConstant -4
+ // CHECK-DAG: <<Mul:f\d+>> Mul [<<Arg>>,<<ConstM4>>]
+ // CHECK-DAG: Return [<<Mul>>]
// CHECK-START: float Main.DivMP25(float) instruction_simplifier (after)
// CHECK-NOT: Div
@@ -1013,16 +1013,16 @@
}
// CHECK-START: double Main.DivMP25(double) instruction_simplifier (before)
- // CHECK-DAG: [[Arg:d\d+]] ParameterValue
- // CHECK-DAG: [[ConstMP25:d\d+]] DoubleConstant -0.25
- // CHECK-DAG: [[Div:d\d+]] Div [ [[Arg]] [[ConstMP25]] ]
- // CHECK-DAG: Return [ [[Div]] ]
+ // CHECK-DAG: <<Arg:d\d+>> ParameterValue
+ // CHECK-DAG: <<ConstMP25:d\d+>> DoubleConstant -0.25
+ // CHECK-DAG: <<Div:d\d+>> Div [<<Arg>>,<<ConstMP25>>]
+ // CHECK-DAG: Return [<<Div>>]
// CHECK-START: double Main.DivMP25(double) instruction_simplifier (after)
- // CHECK-DAG: [[Arg:d\d+]] ParameterValue
- // CHECK-DAG: [[ConstM4:d\d+]] DoubleConstant -4
- // CHECK-DAG: [[Mul:d\d+]] Mul [ [[Arg]] [[ConstM4]] ]
- // CHECK-DAG: Return [ [[Mul]] ]
+ // CHECK-DAG: <<Arg:d\d+>> ParameterValue
+ // CHECK-DAG: <<ConstM4:d\d+>> DoubleConstant -4
+ // CHECK-DAG: <<Mul:d\d+>> Mul [<<Arg>>,<<ConstM4>>]
+ // CHECK-DAG: Return [<<Mul>>]
// CHECK-START: double Main.DivMP25(double) instruction_simplifier (after)
// CHECK-NOT: Div
diff --git a/test/462-checker-inlining-across-dex-files/src/Main.java b/test/462-checker-inlining-across-dex-files/src/Main.java
index d5563b8..3d583b4 100644
--- a/test/462-checker-inlining-across-dex-files/src/Main.java
+++ b/test/462-checker-inlining-across-dex-files/src/Main.java
@@ -22,7 +22,7 @@
public class Main {
// CHECK-START: void Main.inlineEmptyMethod() inliner (before)
- // CHECK-DAG: [[Invoke:v\d+]] InvokeStaticOrDirect
+ // CHECK-DAG: <<Invoke:v\d+>> InvokeStaticOrDirect
// CHECK-DAG: ReturnVoid
// CHECK-START: void Main.inlineEmptyMethod() inliner (after)
@@ -33,120 +33,122 @@
}
// CHECK-START: int Main.inlineReturnIntMethod() inliner (before)
- // CHECK-DAG: [[Invoke:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.inlineReturnIntMethod() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
// CHECK-START: int Main.inlineReturnIntMethod() inliner (after)
- // CHECK-DAG: [[Const38:i\d+]] IntConstant 38
- // CHECK-DAG: Return [ [[Const38]] ]
+ // CHECK-DAG: <<Const38:i\d+>> IntConstant 38
+ // CHECK-DAG: Return [<<Const38>>]
public static int inlineReturnIntMethod() {
return OtherDex.returnIntMethod();
}
// CHECK-START: int Main.dontInlineOtherDexStatic() inliner (before)
- // CHECK-DAG: [[Invoke:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.dontInlineOtherDexStatic() inliner (after)
- // CHECK-DAG: [[Invoke:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
public static int dontInlineOtherDexStatic() {
return OtherDex.returnOtherDexStatic();
}
// CHECK-START: int Main.inlineMainStatic() inliner (before)
- // CHECK-DAG: [[Invoke:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.inlineMainStatic() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
// CHECK-START: int Main.inlineMainStatic() inliner (after)
- // CHECK-DAG: [[Static:i\d+]] StaticFieldGet
- // CHECK-DAG: Return [ [[Static]] ]
+ // CHECK-DAG: <<Static:i\d+>> StaticFieldGet
+ // CHECK-DAG: Return [<<Static>>]
public static int inlineMainStatic() {
return OtherDex.returnMainStatic();
}
// CHECK-START: int Main.dontInlineRecursiveCall() inliner (before)
- // CHECK-DAG: [[Invoke:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.dontInlineRecursiveCall() inliner (after)
- // CHECK-DAG: [[Invoke:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
public static int dontInlineRecursiveCall() {
return OtherDex.recursiveCall();
}
// CHECK-START: java.lang.String Main.dontInlineReturnString() inliner (before)
- // CHECK-DAG: [[Invoke:l\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: java.lang.String Main.dontInlineReturnString() inliner (after)
- // CHECK-DAG: [[Invoke:l\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
public static String dontInlineReturnString() {
return OtherDex.returnString();
}
// CHECK-START: java.lang.Class Main.dontInlineOtherDexClass() inliner (before)
- // CHECK-DAG: [[Invoke:l\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: java.lang.Class Main.dontInlineOtherDexClass() inliner (after)
- // CHECK-DAG: [[Invoke:l\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
public static Class dontInlineOtherDexClass() {
return OtherDex.returnOtherDexClass();
}
// CHECK-START: java.lang.Class Main.inlineMainClass() inliner (before)
- // CHECK-DAG: [[Invoke:l\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: java.lang.Class Main.inlineMainClass() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
// CHECK-START: java.lang.Class Main.inlineMainClass() inliner (after)
- // CHECK-DAG: [[Class:l\d+]] LoadClass
- // CHECK-DAG: Return [ [[Class]] ]
+ // CHECK-DAG: Return [<<Class:l\d+>>]
+ // CHECK-DAG: <<Class>> LoadClass
+ // Note: Verify backwards because there are two LoadClass instructions
public static Class inlineMainClass() {
return OtherDex.returnMainClass();
}
// CHECK-START: java.lang.Class Main.dontInlineOtherDexClassStaticCall() inliner (before)
- // CHECK-DAG: [[Invoke:l\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: java.lang.Class Main.dontInlineOtherDexClassStaticCall() inliner (after)
- // CHECK-DAG: [[Invoke:l\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
public static Class dontInlineOtherDexClassStaticCall() {
return OtherDex.returnOtherDexClassStaticCall();
}
// CHECK-START: java.lang.Class Main.inlineOtherDexCallingMain() inliner (before)
- // CHECK-DAG: [[Invoke:l\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: java.lang.Class Main.inlineOtherDexCallingMain() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
// CHECK-START: java.lang.Class Main.inlineOtherDexCallingMain() inliner (after)
- // CHECK-DAG: [[Class:l\d+]] LoadClass
- // CHECK-DAG: Return [ [[Class]] ]
+ // CHECK-DAG: Return [<<Class:l\d+>>]
+ // CHECK-DAG: <<Class>> LoadClass
+ // Note: Verify backwards because there are two LoadClass instructions
public static Class inlineOtherDexCallingMain() {
return OtherDex.returnOtherDexCallingMain();
diff --git a/test/463-checker-boolean-simplifier/src/Main.java b/test/463-checker-boolean-simplifier/src/Main.java
index 4346103..e237448 100644
--- a/test/463-checker-boolean-simplifier/src/Main.java
+++ b/test/463-checker-boolean-simplifier/src/Main.java
@@ -38,12 +38,12 @@
*/
// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (before)
- // CHECK-DAG: [[Param:z\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: If [ [[Param]] ]
- // CHECK-DAG: [[Phi:i\d+]] Phi [ [[Const1]] [[Const0]] ]
- // CHECK-DAG: Return [ [[Phi]] ]
+ // CHECK-DAG: <<Param:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: If [<<Param>>]
+ // CHECK-DAG: <<Phi:i\d+>> Phi [<<Const1>>,<<Const0>>]
+ // CHECK-DAG: Return [<<Phi>>]
// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (before)
// CHECK: Goto
@@ -52,10 +52,10 @@
// CHECK-NOT: Goto
// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (after)
- // CHECK-DAG: [[Param:z\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[NotParam:z\d+]] BooleanNot [ [[Param]] ]
- // CHECK-DAG: Return [ [[NotParam]] ]
+ // CHECK-DAG: <<Param:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<NotParam:z\d+>> BooleanNot [<<Param>>]
+ // CHECK-DAG: Return [<<NotParam>>]
// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (after)
// CHECK-NOT: If
@@ -75,22 +75,22 @@
*/
// CHECK-START: boolean Main.GreaterThan(int, int) boolean_simplifier (before)
- // CHECK-DAG: [[ParamX:i\d+]] ParameterValue
- // CHECK-DAG: [[ParamY:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Cond:z\d+]] GreaterThan [ [[ParamX]] [[ParamY]] ]
- // CHECK-DAG: If [ [[Cond]] ]
- // CHECK-DAG: [[Phi:i\d+]] Phi [ [[Const0]] [[Const1]] ]
- // CHECK-DAG: Return [ [[Phi]] ]
+ // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Cond:z\d+>> GreaterThan [<<ParamX>>,<<ParamY>>]
+ // CHECK-DAG: If [<<Cond>>]
+ // CHECK-DAG: <<Phi:i\d+>> Phi [<<Const0>>,<<Const1>>]
+ // CHECK-DAG: Return [<<Phi>>]
// CHECK-START: boolean Main.GreaterThan(int, int) boolean_simplifier (after)
- // CHECK-DAG: [[ParamX:i\d+]] ParameterValue
- // CHECK-DAG: [[ParamY:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Cond:z\d+]] GreaterThan [ [[ParamX]] [[ParamY]] ]
- // CHECK-DAG: Return [ [[Cond]] ]
+ // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Cond:z\d+>> GreaterThan [<<ParamX>>,<<ParamY>>]
+ // CHECK-DAG: Return [<<Cond>>]
public static boolean GreaterThan(int x, int y) {
return (x <= y) ? false : true;
@@ -102,22 +102,22 @@
*/
// CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (before)
- // CHECK-DAG: [[ParamX:i\d+]] ParameterValue
- // CHECK-DAG: [[ParamY:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Cond:z\d+]] GreaterThanOrEqual [ [[ParamX]] [[ParamY]] ]
- // CHECK-DAG: If [ [[Cond]] ]
- // CHECK-DAG: [[Phi:i\d+]] Phi [ [[Const1]] [[Const0]] ]
- // CHECK-DAG: Return [ [[Phi]] ]
+ // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Cond:z\d+>> GreaterThanOrEqual [<<ParamX>>,<<ParamY>>]
+ // CHECK-DAG: If [<<Cond>>]
+ // CHECK-DAG: <<Phi:i\d+>> Phi [<<Const1>>,<<Const0>>]
+ // CHECK-DAG: Return [<<Phi>>]
// CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (after)
- // CHECK-DAG: [[ParamX:i\d+]] ParameterValue
- // CHECK-DAG: [[ParamY:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[Cond:z\d+]] LessThan [ [[ParamX]] [[ParamY]] ]
- // CHECK-DAG: Return [ [[Cond]] ]
+ // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<Cond:z\d+>> LessThan [<<ParamX>>,<<ParamY>>]
+ // CHECK-DAG: Return [<<Cond>>]
// CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (after)
// CHECK-NOT: GreaterThanOrEqual
@@ -132,51 +132,51 @@
*/
// CHECK-START: boolean Main.ValuesOrdered(int, int, int) boolean_simplifier (before)
- // CHECK-DAG: [[ParamX:i\d+]] ParameterValue
- // CHECK-DAG: [[ParamY:i\d+]] ParameterValue
- // CHECK-DAG: [[ParamZ:i\d+]] ParameterValue
- // CHECK-DAG: [[Const0:i\d+]] IntConstant 0
- // CHECK-DAG: [[Const1:i\d+]] IntConstant 1
- // CHECK-DAG: [[CondXY:z\d+]] GreaterThan [ [[ParamX]] [[ParamY]] ]
- // CHECK-DAG: If [ [[CondXY]] ]
- // CHECK-DAG: [[CondYZ:z\d+]] GreaterThan [ [[ParamY]] [[ParamZ]] ]
- // CHECK-DAG: If [ [[CondYZ]] ]
- // CHECK-DAG: [[CondXYZ:z\d+]] NotEqual [ [[PhiXY:i\d+]] [[PhiYZ:i\d+]] ]
- // CHECK-DAG: If [ [[CondXYZ]] ]
- // CHECK-DAG: Return [ [[PhiXYZ:i\d+]] ]
- // CHECK-DAG: [[PhiXY]] Phi [ [[Const1]] [[Const0]] ]
- // CHECK-DAG: [[PhiYZ]] Phi [ [[Const1]] [[Const0]] ]
- // CHECK-DAG: [[PhiXYZ]] Phi [ [[Const1]] [[Const0]] ]
+ // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ // CHECK-DAG: <<ParamZ:i\d+>> ParameterValue
+ // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ // CHECK-DAG: <<CondXY:z\d+>> GreaterThan [<<ParamX>>,<<ParamY>>]
+ // CHECK-DAG: If [<<CondXY>>]
+ // CHECK-DAG: <<CondYZ:z\d+>> GreaterThan [<<ParamY>>,<<ParamZ>>]
+ // CHECK-DAG: If [<<CondYZ>>]
+ // CHECK-DAG: <<CondXYZ:z\d+>> NotEqual [<<PhiXY:i\d+>>,<<PhiYZ:i\d+>>]
+ // CHECK-DAG: If [<<CondXYZ>>]
+ // CHECK-DAG: Return [<<PhiXYZ:i\d+>>]
+ // CHECK-DAG: <<PhiXY>> Phi [<<Const1>>,<<Const0>>]
+ // CHECK-DAG: <<PhiYZ>> Phi [<<Const1>>,<<Const0>>]
+ // CHECK-DAG: <<PhiXYZ>> Phi [<<Const1>>,<<Const0>>]
// CHECK-START: boolean Main.ValuesOrdered(int, int, int) boolean_simplifier (after)
- // CHECK-DAG: [[ParamX:i\d+]] ParameterValue
- // CHECK-DAG: [[ParamY:i\d+]] ParameterValue
- // CHECK-DAG: [[ParamZ:i\d+]] ParameterValue
- // CHECK-DAG: [[CmpXY:z\d+]] LessThanOrEqual [ [[ParamX]] [[ParamY]] ]
- // CHECK-DAG: [[CmpYZ:z\d+]] LessThanOrEqual [ [[ParamY]] [[ParamZ]] ]
- // CHECK-DAG: [[CmpXYZ:z\d+]] Equal [ [[CmpXY]] [[CmpYZ]] ]
- // CHECK-DAG: Return [ [[CmpXYZ]] ]
+ // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ // CHECK-DAG: <<ParamZ:i\d+>> ParameterValue
+ // CHECK-DAG: <<CmpXY:z\d+>> LessThanOrEqual [<<ParamX>>,<<ParamY>>]
+ // CHECK-DAG: <<CmpYZ:z\d+>> LessThanOrEqual [<<ParamY>>,<<ParamZ>>]
+ // CHECK-DAG: <<CmpXYZ:z\d+>> Equal [<<CmpXY>>,<<CmpYZ>>]
+ // CHECK-DAG: Return [<<CmpXYZ>>]
public static boolean ValuesOrdered(int x, int y, int z) {
return (x <= y) == (y <= z);
}
// CHECK-START: int Main.NegatedCondition(boolean) boolean_simplifier (before)
- // CHECK-DAG: [[Param:z\d+]] ParameterValue
- // CHECK-DAG: [[Const42:i\d+]] IntConstant 42
- // CHECK-DAG: [[Const43:i\d+]] IntConstant 43
- // CHECK-DAG: [[NotParam:z\d+]] BooleanNot [ [[Param]] ]
- // CHECK-DAG: If [ [[NotParam]] ]
- // CHECK-DAG: [[Phi:i\d+]] Phi [ [[Const42]] [[Const43]] ]
- // CHECK-DAG: Return [ [[Phi]] ]
+ // CHECK-DAG: <<Param:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const42:i\d+>> IntConstant 42
+ // CHECK-DAG: <<Const43:i\d+>> IntConstant 43
+ // CHECK-DAG: <<NotParam:z\d+>> BooleanNot [<<Param>>]
+ // CHECK-DAG: If [<<NotParam>>]
+ // CHECK-DAG: <<Phi:i\d+>> Phi [<<Const42>>,<<Const43>>]
+ // CHECK-DAG: Return [<<Phi>>]
// CHECK-START: int Main.NegatedCondition(boolean) boolean_simplifier (after)
- // CHECK-DAG: [[Param:z\d+]] ParameterValue
- // CHECK-DAG: [[Const42:i\d+]] IntConstant 42
- // CHECK-DAG: [[Const43:i\d+]] IntConstant 43
- // CHECK-DAG: If [ [[Param]] ]
- // CHECK-DAG: [[Phi:i\d+]] Phi [ [[Const42]] [[Const43]] ]
- // CHECK-DAG: Return [ [[Phi]] ]
+ // CHECK-DAG: <<Param:z\d+>> ParameterValue
+ // CHECK-DAG: <<Const42:i\d+>> IntConstant 42
+ // CHECK-DAG: <<Const43:i\d+>> IntConstant 43
+ // CHECK-DAG: If [<<Param>>]
+ // CHECK-DAG: <<Phi:i\d+>> Phi [<<Const42>>,<<Const43>>]
+ // CHECK-DAG: Return [<<Phi>>]
// Note: The fact that branches are swapped is verified by running the test.
diff --git a/test/464-checker-inline-sharpen-calls/src/Main.java b/test/464-checker-inline-sharpen-calls/src/Main.java
index 1b25b42..e451f70 100644
--- a/test/464-checker-inline-sharpen-calls/src/Main.java
+++ b/test/464-checker-inline-sharpen-calls/src/Main.java
@@ -20,7 +20,7 @@
}
// CHECK-START: void Main.inlineSharpenInvokeVirtual(Main) inliner (before)
- // CHECK-DAG: [[Invoke:v\d+]] InvokeStaticOrDirect
+ // CHECK-DAG: <<Invoke:v\d+>> InvokeStaticOrDirect
// CHECK-DAG: ReturnVoid
// CHECK-START: void Main.inlineSharpenInvokeVirtual(Main) inliner (after)
@@ -31,15 +31,15 @@
}
// CHECK-START: int Main.inlineSharpenStringInvoke() inliner (before)
- // CHECK-DAG: [[Invoke:i\d+]] InvokeStaticOrDirect
- // CHECK-DAG: Return [ [[Invoke]] ]
+ // CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.inlineSharpenStringInvoke() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
// CHECK-START: int Main.inlineSharpenStringInvoke() inliner (after)
- // CHECK-DAG: [[Field:i\d+]] InstanceFieldGet
- // CHECK-DAG: Return [ [[Field]] ]
+ // CHECK-DAG: <<Field:i\d+>> InstanceFieldGet
+ // CHECK-DAG: Return [<<Field>>]
public static int inlineSharpenStringInvoke() {
return "Foo".length();
diff --git a/test/465-checker-clinit-gvn/src/Main.java b/test/465-checker-clinit-gvn/src/Main.java
index dcaef6f..ac2863c 100644
--- a/test/465-checker-clinit-gvn/src/Main.java
+++ b/test/465-checker-clinit-gvn/src/Main.java
@@ -27,14 +27,14 @@
public final class Main {
// CHECK-START: int Main.accessTwoStatics() GVN (before)
- // CHECK-DAG: [[Class1:l\d+]] LoadClass
- // CHECK-DAG: ClinitCheck [ [[Class1]] ]
- // CHECK-DAG: [[Class2:l\d+]] LoadClass
- // CHECK-DAG: ClinitCheck [ [[Class2]] ]
+ // CHECK-DAG: <<Class1:l\d+>> LoadClass
+ // CHECK-DAG: ClinitCheck [<<Class1>>]
+ // CHECK-DAG: <<Class2:l\d+>> LoadClass
+ // CHECK-DAG: ClinitCheck [<<Class2>>]
// CHECK-START: int Main.accessTwoStatics() GVN (after)
- // CHECK-DAG: [[Class:l\d+]] LoadClass
- // CHECK-DAG: ClinitCheck [ [[Class]] ]
+ // CHECK-DAG: <<Class:l\d+>> LoadClass
+ // CHECK-DAG: ClinitCheck [<<Class>>]
// CHECK-NOT: ClinitCheck
public static int accessTwoStatics() {
@@ -42,14 +42,14 @@
}
// CHECK-START: int Main.accessTwoStaticsCallInBetween() GVN (before)
- // CHECK-DAG: [[Class1:l\d+]] LoadClass
- // CHECK-DAG: ClinitCheck [ [[Class1]] ]
- // CHECK-DAG: [[Class2:l\d+]] LoadClass
- // CHECK-DAG: ClinitCheck [ [[Class2]] ]
+ // CHECK-DAG: <<Class1:l\d+>> LoadClass
+ // CHECK-DAG: ClinitCheck [<<Class1>>]
+ // CHECK-DAG: <<Class2:l\d+>> LoadClass
+ // CHECK-DAG: ClinitCheck [<<Class2>>]
// CHECK-START: int Main.accessTwoStaticsCallInBetween() GVN (after)
- // CHECK-DAG: [[Class:l\d+]] LoadClass
- // CHECK-DAG: ClinitCheck [ [[Class]] ]
+ // CHECK-DAG: <<Class:l\d+>> LoadClass
+ // CHECK-DAG: ClinitCheck [<<Class>>]
// CHECK-NOT: ClinitCheck
public static int accessTwoStaticsCallInBetween() {
diff --git a/test/468-checker-bool-simplifier-regression/smali/TestCase.smali b/test/468-checker-bool-simplifier-regression/smali/TestCase.smali
index 6ff4391..33e6dc3 100644
--- a/test/468-checker-bool-simplifier-regression/smali/TestCase.smali
+++ b/test/468-checker-bool-simplifier-regression/smali/TestCase.smali
@@ -19,17 +19,17 @@
.field public static value:Z
# CHECK-START: boolean TestCase.testCase() boolean_simplifier (before)
-# CHECK-DAG: [[Const0:i\d+]] IntConstant 0
-# CHECK-DAG: [[Const1:i\d+]] IntConstant 1
-# CHECK-DAG: [[Value:z\d+]] StaticFieldGet
-# CHECK-DAG: If [ [[Value]] ]
-# CHECK-DAG: [[Phi:i\d+]] Phi [ [[Const1]] [[Const0]] ]
-# CHECK-DAG: Return [ [[Phi]] ]
+# CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+# CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+# CHECK-DAG: <<Value:z\d+>> StaticFieldGet
+# CHECK-DAG: If [<<Value>>]
+# CHECK-DAG: <<Phi:i\d+>> Phi [<<Const1>>,<<Const0>>]
+# CHECK-DAG: Return [<<Phi>>]
# CHECK-START: boolean TestCase.testCase() boolean_simplifier (after)
-# CHECK-DAG: [[Value:z\d+]] StaticFieldGet
-# CHECK-DAG: [[Not:z\d+]] BooleanNot [ [[Value]] ]
-# CHECK-DAG: Return [ [[Not]] ]
+# CHECK-DAG: <<Value:z\d+>> StaticFieldGet
+# CHECK-DAG: <<Not:z\d+>> BooleanNot [<<Value>>]
+# CHECK-DAG: Return [<<Not>>]
.method public static testCase()Z
.registers 2
diff --git a/test/474-checker-boolean-input/src/Main.java b/test/474-checker-boolean-input/src/Main.java
index 9151986..490f7f9 100644
--- a/test/474-checker-boolean-input/src/Main.java
+++ b/test/474-checker-boolean-input/src/Main.java
@@ -28,8 +28,8 @@
*/
// CHECK-START: boolean Main.TestPhiAsBoolean(int) boolean_simplifier (after)
- // CHECK-DAG: [[Phi:i\d+]] Phi
- // CHECK-DAG: BooleanNot [ [[Phi]] ]
+ // CHECK-DAG: <<Phi:i\d+>> Phi
+ // CHECK-DAG: BooleanNot [<<Phi>>]
public static boolean f1;
public static boolean f2;
@@ -48,8 +48,8 @@
*/
// CHECK-START: boolean Main.TestAndAsBoolean(boolean, boolean) boolean_simplifier (after)
- // CHECK-DAG: [[And:i\d+]] And
- // CHECK-DAG: BooleanNot [ [[And]] ]
+ // CHECK-DAG: <<And:i\d+>> And
+ // CHECK-DAG: BooleanNot [<<And>>]
public static boolean InlineAnd(boolean x, boolean y) {
return x & y;
@@ -65,8 +65,8 @@
*/
// CHECK-START: boolean Main.TestOrAsBoolean(boolean, boolean) boolean_simplifier (after)
- // CHECK-DAG: [[Or:i\d+]] Or
- // CHECK-DAG: BooleanNot [ [[Or]] ]
+ // CHECK-DAG: <<Or:i\d+>> Or
+ // CHECK-DAG: BooleanNot [<<Or>>]
public static boolean InlineOr(boolean x, boolean y) {
return x | y;
@@ -82,8 +82,8 @@
*/
// CHECK-START: boolean Main.TestXorAsBoolean(boolean, boolean) boolean_simplifier (after)
- // CHECK-DAG: [[Xor:i\d+]] Xor
- // CHECK-DAG: BooleanNot [ [[Xor]] ]
+ // CHECK-DAG: <<Xor:i\d+>> Xor
+ // CHECK-DAG: BooleanNot [<<Xor>>]
public static boolean InlineXor(boolean x, boolean y) {
return x ^ y;
diff --git a/test/476-checker-ctor-memory-barrier/src/Main.java b/test/476-checker-ctor-memory-barrier/src/Main.java
index 10aa2ab..769ae20 100644
--- a/test/476-checker-ctor-memory-barrier/src/Main.java
+++ b/test/476-checker-ctor-memory-barrier/src/Main.java
@@ -17,7 +17,7 @@
class ClassWithoutFinals {
// CHECK-START: void ClassWithoutFinals.<init>() register (after)
- // CHECK-NOT: MemoryBarrier {{StoreStore}}
+ // CHECK-NOT: MemoryBarrier kind:StoreStore
public ClassWithoutFinals() {}
}
@@ -26,7 +26,7 @@
public ClassWithFinals obj;
// CHECK-START: void ClassWithFinals.<init>(boolean) register (after)
- // CHECK: MemoryBarrier {{StoreStore}}
+ // CHECK: MemoryBarrier kind:StoreStore
// CHECK-NOT: {{.*}}
// CHECK: ReturnVoid
public ClassWithFinals(boolean cond) {
@@ -38,7 +38,7 @@
}
// CHECK-START: void ClassWithFinals.<init>() register (after)
- // CHECK: MemoryBarrier {{StoreStore}}
+ // CHECK: MemoryBarrier kind:StoreStore
// CHECK-NOT: {{.*}}
// CHECK: ReturnVoid
public ClassWithFinals() {
@@ -46,8 +46,8 @@
}
// CHECK-START: void ClassWithFinals.<init>(int) register (after)
- // CHECK: MemoryBarrier {{StoreStore}}
- // CHECK: MemoryBarrier {{StoreStore}}
+ // CHECK: MemoryBarrier kind:StoreStore
+ // CHECK: MemoryBarrier kind:StoreStore
// CHECK-NOT: {{.*}}
// CHECK: ReturnVoid
public ClassWithFinals(int x) {
@@ -61,7 +61,7 @@
class InheritFromClassWithFinals extends ClassWithFinals {
// CHECK-START: void InheritFromClassWithFinals.<init>() register (after)
- // CHECK: MemoryBarrier {{StoreStore}}
+ // CHECK: MemoryBarrier kind:StoreStore
// CHECK-NOT: {{.*}}
// CHECK: ReturnVoid
@@ -75,7 +75,7 @@
// CHECK: InvokeStaticOrDirect
// CHECK-START: void InheritFromClassWithFinals.<init>(boolean) register (after)
- // CHECK-NOT: MemoryBarrier {{StoreStore}}
+ // CHECK-NOT: MemoryBarrier kind:StoreStore
public InheritFromClassWithFinals(boolean cond) {
super(cond);
// should not inline the super constructor
@@ -86,8 +86,8 @@
final int y;
// CHECK-START: void HaveFinalsAndInheritFromClassWithFinals.<init>() register (after)
- // CHECK: MemoryBarrier {{StoreStore}}
- // CHECK: MemoryBarrier {{StoreStore}}
+ // CHECK: MemoryBarrier kind:StoreStore
+ // CHECK: MemoryBarrier kind:StoreStore
// CHECK-NOT: {{.*}}
// CHECK: ReturnVoid
@@ -100,7 +100,7 @@
// CHECK-START: void HaveFinalsAndInheritFromClassWithFinals.<init>(boolean) register (after)
// CHECK: InvokeStaticOrDirect
- // CHECK: MemoryBarrier {{StoreStore}}
+ // CHECK: MemoryBarrier kind:StoreStore
// CHECK-NOT: {{.*}}
// CHECK: ReturnVoid
public HaveFinalsAndInheritFromClassWithFinals(boolean cond) {
@@ -116,13 +116,13 @@
// CHECK: InvokeStaticOrDirect
// CHECK-START: ClassWithFinals Main.noInlineNoConstructorBarrier() register (after)
- // CHECK-NOT: MemoryBarrier {{StoreStore}}
+ // CHECK-NOT: MemoryBarrier kind:StoreStore
public static ClassWithFinals noInlineNoConstructorBarrier() {
return new ClassWithFinals(false);
}
// CHECK-START: ClassWithFinals Main.inlineConstructorBarrier() register (after)
- // CHECK: MemoryBarrier {{StoreStore}}
+ // CHECK: MemoryBarrier kind:StoreStore
// CHECK-NOT: {{.*}}
// CHECK: Return
@@ -133,7 +133,7 @@
}
// CHECK-START: InheritFromClassWithFinals Main.doubleInlineConstructorBarrier() register (after)
- // CHECK: MemoryBarrier {{StoreStore}}
+ // CHECK: MemoryBarrier kind:StoreStore
// CHECK-NOT: {{.*}}
// CHECK: Return
diff --git a/test/478-checker-clinit-check-pruning/src/Main.java b/test/478-checker-clinit-check-pruning/src/Main.java
index 6da8945..61199a7 100644
--- a/test/478-checker-clinit-check-pruning/src/Main.java
+++ b/test/478-checker-clinit-check-pruning/src/Main.java
@@ -24,13 +24,13 @@
*/
// CHECK-START: void Main.invokeStaticInlined() builder (after)
- // CHECK-DAG: [[LoadClass:l\d+]] LoadClass
- // CHECK-DAG: [[ClinitCheck:l\d+]] ClinitCheck [ [[LoadClass]] ]
- // CHECK-DAG: InvokeStaticOrDirect [ [[ClinitCheck]] ]
+ // CHECK-DAG: <<LoadClass:l\d+>> LoadClass
+ // CHECK-DAG: <<ClinitCheck:l\d+>> ClinitCheck [<<LoadClass>>]
+ // CHECK-DAG: InvokeStaticOrDirect [<<ClinitCheck>>]
// CHECK-START: void Main.invokeStaticInlined() inliner (after)
- // CHECK-DAG: [[LoadClass:l\d+]] LoadClass
- // CHECK-DAG: [[ClinitCheck:l\d+]] ClinitCheck [ [[LoadClass]] ]
+ // CHECK-DAG: <<LoadClass:l\d+>> LoadClass
+ // CHECK-DAG: <<ClinitCheck:l\d+>> ClinitCheck [<<LoadClass>>]
// CHECK-START: void Main.invokeStaticInlined() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
@@ -67,14 +67,14 @@
*/
// CHECK-START: void Main.invokeStaticNotInlined() builder (after)
- // CHECK-DAG: [[LoadClass:l\d+]] LoadClass
- // CHECK-DAG: [[ClinitCheck:l\d+]] ClinitCheck [ [[LoadClass]] ]
- // CHECK-DAG: InvokeStaticOrDirect [ [[ClinitCheck]] ]
+ // CHECK-DAG: <<LoadClass:l\d+>> LoadClass
+ // CHECK-DAG: <<ClinitCheck:l\d+>> ClinitCheck [<<LoadClass>>]
+ // CHECK-DAG: InvokeStaticOrDirect [<<ClinitCheck>>]
// CHECK-START: void Main.invokeStaticNotInlined() inliner (after)
- // CHECK-DAG: [[LoadClass:l\d+]] LoadClass
- // CHECK-DAG: [[ClinitCheck:l\d+]] ClinitCheck [ [[LoadClass]] ]
- // CHECK-DAG: InvokeStaticOrDirect [ [[ClinitCheck]] ]
+ // CHECK-DAG: <<LoadClass:l\d+>> LoadClass
+ // CHECK-DAG: <<ClinitCheck:l\d+>> ClinitCheck [<<LoadClass>>]
+ // CHECK-DAG: InvokeStaticOrDirect [<<ClinitCheck>>]
// The following checks ensure the clinit check and load class
// instructions added by the builder are pruned by the
diff --git a/test/480-checker-dead-blocks/src/Main.java b/test/480-checker-dead-blocks/src/Main.java
index 83dbb26..b76755e 100644
--- a/test/480-checker-dead-blocks/src/Main.java
+++ b/test/480-checker-dead-blocks/src/Main.java
@@ -31,19 +31,19 @@
}
// CHECK-START: int Main.testTrueBranch(int, int) dead_code_elimination_final (before)
- // CHECK-DAG: [[ArgX:i\d+]] ParameterValue
- // CHECK-DAG: [[ArgY:i\d+]] ParameterValue
+ // CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+ // CHECK-DAG: <<ArgY:i\d+>> ParameterValue
// CHECK-DAG: If
- // CHECK-DAG: [[Add:i\d+]] Add [ [[ArgX]] [[ArgY]] ]
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[ArgX]] [[ArgY]] ]
- // CHECK-DAG: [[Phi:i\d+]] Phi [ [[Add]] [[Sub]] ]
- // CHECK-DAG: Return [ [[Phi]] ]
+ // CHECK-DAG: <<Add:i\d+>> Add [<<ArgX>>,<<ArgY>>]
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<ArgX>>,<<ArgY>>]
+ // CHECK-DAG: <<Phi:i\d+>> Phi [<<Add>>,<<Sub>>]
+ // CHECK-DAG: Return [<<Phi>>]
// CHECK-START: int Main.testTrueBranch(int, int) dead_code_elimination_final (after)
- // CHECK-DAG: [[ArgX:i\d+]] ParameterValue
- // CHECK-DAG: [[ArgY:i\d+]] ParameterValue
- // CHECK-DAG: [[Add:i\d+]] Add [ [[ArgX]] [[ArgY]] ]
- // CHECK-DAG: Return [ [[Add]] ]
+ // CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+ // CHECK-DAG: <<ArgY:i\d+>> ParameterValue
+ // CHECK-DAG: <<Add:i\d+>> Add [<<ArgX>>,<<ArgY>>]
+ // CHECK-DAG: Return [<<Add>>]
// CHECK-START: int Main.testTrueBranch(int, int) dead_code_elimination_final (after)
// CHECK-NOT: If
@@ -61,19 +61,19 @@
}
// CHECK-START: int Main.testFalseBranch(int, int) dead_code_elimination_final (before)
- // CHECK-DAG: [[ArgX:i\d+]] ParameterValue
- // CHECK-DAG: [[ArgY:i\d+]] ParameterValue
+ // CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+ // CHECK-DAG: <<ArgY:i\d+>> ParameterValue
// CHECK-DAG: If
- // CHECK-DAG: [[Add:i\d+]] Add [ [[ArgX]] [[ArgY]] ]
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[ArgX]] [[ArgY]] ]
- // CHECK-DAG: [[Phi:i\d+]] Phi [ [[Add]] [[Sub]] ]
- // CHECK-DAG: Return [ [[Phi]] ]
+ // CHECK-DAG: <<Add:i\d+>> Add [<<ArgX>>,<<ArgY>>]
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<ArgX>>,<<ArgY>>]
+ // CHECK-DAG: <<Phi:i\d+>> Phi [<<Add>>,<<Sub>>]
+ // CHECK-DAG: Return [<<Phi>>]
// CHECK-START: int Main.testFalseBranch(int, int) dead_code_elimination_final (after)
- // CHECK-DAG: [[ArgX:i\d+]] ParameterValue
- // CHECK-DAG: [[ArgY:i\d+]] ParameterValue
- // CHECK-DAG: [[Sub:i\d+]] Sub [ [[ArgX]] [[ArgY]] ]
- // CHECK-DAG: Return [ [[Sub]] ]
+ // CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+ // CHECK-DAG: <<ArgY:i\d+>> ParameterValue
+ // CHECK-DAG: <<Sub:i\d+>> Sub [<<ArgX>>,<<ArgY>>]
+ // CHECK-DAG: Return [<<Sub>>]
// CHECK-START: int Main.testFalseBranch(int, int) dead_code_elimination_final (after)
// CHECK-NOT: If
@@ -125,8 +125,8 @@
// CHECK-DAG: Add
// CHECK-START: int Main.testDeadLoop(int) dead_code_elimination_final (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: int Main.testDeadLoop(int) dead_code_elimination_final (after)
// CHECK-NOT: If
@@ -145,8 +145,8 @@
// CHECK-DAG: Add
// CHECK-START: int Main.testUpdateLoopInformation(int) dead_code_elimination_final (after)
- // CHECK-DAG: [[Arg:i\d+]] ParameterValue
- // CHECK-DAG: Return [ [[Arg]] ]
+ // CHECK-DAG: <<Arg:i\d+>> ParameterValue
+ // CHECK-DAG: Return [<<Arg>>]
// CHECK-START: int Main.testUpdateLoopInformation(int) dead_code_elimination_final (after)
// CHECK-NOT: If
diff --git a/test/482-checker-loop-back-edge-use/src/Main.java b/test/482-checker-loop-back-edge-use/src/Main.java
index 74184e8..9e1076a 100644
--- a/test/482-checker-loop-back-edge-use/src/Main.java
+++ b/test/482-checker-loop-back-edge-use/src/Main.java
@@ -18,16 +18,16 @@
public class Main {
// CHECK-START: void Main.loop1(boolean) liveness (after)
- // CHECK: ParameterValue (liveness: 2 ranges: { [2, 22) }, uses: { 17 22 }
- // CHECK: Goto (liveness: 20)
+ // CHECK: ParameterValue liveness:2 ranges:[2-22] uses:[17,22]
+ // CHECK: Goto liveness:20
public static void loop1(boolean incoming) {
while (incoming) {}
}
// CHECK-START: void Main.loop2(boolean) liveness (after)
- // CHECK: ParameterValue (liveness: 2 ranges: { [2, 42) }, uses: { 33 38 42 }
- // CHECK: Goto (liveness: 36)
- // CHECK: Goto (liveness: 40)
+ // CHECK: ParameterValue liveness:2 ranges:[2-42] uses:[33,38,42]
+ // CHECK: Goto liveness:36
+ // CHECK: Goto liveness:40
public static void loop2(boolean incoming) {
while (true) {
System.out.println("foo");
@@ -36,11 +36,11 @@
}
// CHECK-START: void Main.loop3(boolean) liveness (after)
- // CHECK: ParameterValue (liveness: 2 ranges: { [2, 60) }, uses: { 56 60 }
- // CHECK: Goto (liveness: 58)
+ // CHECK: ParameterValue liveness:2 ranges:[2-60] uses:[56,60]
+ // CHECK: Goto liveness:58
// CHECK-START: void Main.loop3(boolean) liveness (after)
- // CHECK-NOT: Goto (liveness: 54)
+ // CHECK-NOT: Goto liveness:54
public static void loop3(boolean incoming) {
// 'incoming' only needs a use at the outer loop's back edge.
while (System.currentTimeMillis() != 42) {
@@ -50,10 +50,10 @@
}
// CHECK-START: void Main.loop4(boolean) liveness (after)
- // CHECK: ParameterValue (liveness: 2 ranges: { [2, 22) }, uses: { 22 }
+ // CHECK: ParameterValue liveness:2 ranges:[2-22] uses:[22]
// CHECK-START: void Main.loop4(boolean) liveness (after)
- // CHECK-NOT: Goto (liveness: 20)
+ // CHECK-NOT: Goto liveness:20
public static void loop4(boolean incoming) {
// 'incoming' has no loop use, so should not have back edge uses.
System.out.println(incoming);
@@ -63,9 +63,9 @@
}
// CHECK-START: void Main.loop5(boolean) liveness (after)
- // CHECK: ParameterValue (liveness: 2 ranges: { [2, 50) }, uses: { 33 42 46 50 }
- // CHECK: Goto (liveness: 44)
- // CHECK: Goto (liveness: 48)
+ // CHECK: ParameterValue liveness:2 ranges:[2-50] uses:[33,42,46,50]
+ // CHECK: Goto liveness:44
+ // CHECK: Goto liveness:48
public static void loop5(boolean incoming) {
// 'incoming' must have a use at both back edges.
while (Runtime.getRuntime() != null) {
@@ -76,11 +76,11 @@
}
// CHECK-START: void Main.loop6(boolean) liveness (after)
- // CHECK ParameterValue (liveness: 2 ranges: { [2, 46) }, uses: { 24 46 }
- // CHECK: Goto (liveness: 44)
+ // CHECK ParameterValue liveness:2 ranges:[2-46] uses:[24,46]
+ // CHECK: Goto liveness:44
// CHECK-START: void Main.loop6(boolean) liveness (after)
- // CHECK-NOT: Goto (liveness: 22)
+ // CHECK-NOT: Goto liveness:22
public static void loop6(boolean incoming) {
// 'incoming' must have a use only at the first loop's back edge.
while (true) {
@@ -90,9 +90,9 @@
}
// CHECK-START: void Main.loop7(boolean) liveness (after)
- // CHECK: ParameterValue (liveness: 2 ranges: { [2, 50) }, uses: { 32 41 46 50 }
- // CHECK: Goto (liveness: 44)
- // CHECK: Goto (liveness: 48)
+ // CHECK: ParameterValue liveness:2 ranges:[2-50] uses:[32,41,46,50]
+ // CHECK: Goto liveness:44
+ // CHECK: Goto liveness:48
public static void loop7(boolean incoming) {
// 'incoming' must have a use at both back edges.
while (Runtime.getRuntime() != null) {
@@ -102,9 +102,9 @@
}
// CHECK-START: void Main.loop8() liveness (after)
- // CHECK: StaticFieldGet (liveness: 12 ranges: { [12, 44) }, uses: { 35 40 44 }
- // CHECK: Goto (liveness: 38)
- // CHECK: Goto (liveness: 42)
+ // CHECK: StaticFieldGet liveness:12 ranges:[12-44] uses:[35,40,44]
+ // CHECK: Goto liveness:38
+ // CHECK: Goto liveness:42
public static void loop8() {
// 'incoming' must have a use at both back edges.
boolean incoming = field;
@@ -114,8 +114,8 @@
}
// CHECK-START: void Main.loop9() liveness (after)
- // CHECK: StaticFieldGet (liveness: 22 ranges: { [22, 36) }, uses: { 31 36 }
- // CHECK: Goto (liveness: 38)
+ // CHECK: StaticFieldGet liveness:22 ranges:[22-36] uses:[31,36]
+ // CHECK: Goto liveness:38
public static void loop9() {
while (Runtime.getRuntime() != null) {
// 'incoming' must only have a use in the inner loop.
diff --git a/test/485-checker-dce-loop-update/smali/TestCase.smali b/test/485-checker-dce-loop-update/smali/TestCase.smali
index 3873ac5..71da510 100644
--- a/test/485-checker-dce-loop-update/smali/TestCase.smali
+++ b/test/485-checker-dce-loop-update/smali/TestCase.smali
@@ -24,26 +24,26 @@
# CHECK-START: int TestCase.testSingleExit(int, boolean) dead_code_elimination_final (before)
-# CHECK-DAG: [[ArgX:i\d+]] ParameterValue
-# CHECK-DAG: [[ArgY:z\d+]] ParameterValue
-# CHECK-DAG: [[Cst1:i\d+]] IntConstant 1
-# CHECK-DAG: [[Cst5:i\d+]] IntConstant 5
-# CHECK-DAG: [[Cst7:i\d+]] IntConstant 7
-# CHECK-DAG: [[PhiX:i\d+]] Phi [ [[ArgX]] [[Add5:i\d+]] [[Add7:i\d+]] ] loop_header:[[HeaderY:B\d+]]
-# CHECK-DAG: If [ [[ArgY]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: If [ [[Cst1]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[Add5]] Add [ [[PhiX]] [[Cst5]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[Add7]] Add [ [[PhiX]] [[Cst7]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: Return [ [[PhiX]] ] loop_header:null
+# CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+# CHECK-DAG: <<ArgY:z\d+>> ParameterValue
+# CHECK-DAG: <<Cst1:i\d+>> IntConstant 1
+# CHECK-DAG: <<Cst5:i\d+>> IntConstant 5
+# CHECK-DAG: <<Cst7:i\d+>> IntConstant 7
+# CHECK-DAG: <<PhiX:i\d+>> Phi [<<ArgX>>,<<Add5:i\d+>>,<<Add7:i\d+>>] loop:<<HeaderY:B\d+>>
+# CHECK-DAG: If [<<ArgY>>] loop:<<HeaderY>>
+# CHECK-DAG: If [<<Cst1>>] loop:<<HeaderY>>
+# CHECK-DAG: <<Add5>> Add [<<PhiX>>,<<Cst5>>] loop:<<HeaderY>>
+# CHECK-DAG: <<Add7>> Add [<<PhiX>>,<<Cst7>>] loop:<<HeaderY>>
+# CHECK-DAG: Return [<<PhiX>>] loop:none
# CHECK-START: int TestCase.testSingleExit(int, boolean) dead_code_elimination_final (after)
-# CHECK-DAG: [[ArgX:i\d+]] ParameterValue
-# CHECK-DAG: [[ArgY:z\d+]] ParameterValue
-# CHECK-DAG: [[Cst7:i\d+]] IntConstant 7
-# CHECK-DAG: [[PhiX:i\d+]] Phi [ [[ArgX]] [[AddX:i\d+]] ] loop_header:[[HeaderY:B\d+]]
-# CHECK-DAG: If [ [[ArgY]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[AddX]] Add [ [[PhiX]] [[Cst7]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: Return [ [[PhiX]] ] loop_header:null
+# CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+# CHECK-DAG: <<ArgY:z\d+>> ParameterValue
+# CHECK-DAG: <<Cst7:i\d+>> IntConstant 7
+# CHECK-DAG: <<PhiX:i\d+>> Phi [<<ArgX>>,<<AddX:i\d+>>] loop:<<HeaderY:B\d+>>
+# CHECK-DAG: If [<<ArgY>>] loop:<<HeaderY>>
+# CHECK-DAG: <<AddX>> Add [<<PhiX>>,<<Cst7>>] loop:<<HeaderY>>
+# CHECK-DAG: Return [<<PhiX>>] loop:none
.method public static testSingleExit(IZ)I
.registers 3
@@ -74,30 +74,30 @@
# CHECK-START: int TestCase.testMultipleExits(int, boolean, boolean) dead_code_elimination_final (before)
-# CHECK-DAG: [[ArgX:i\d+]] ParameterValue
-# CHECK-DAG: [[ArgY:z\d+]] ParameterValue
-# CHECK-DAG: [[ArgZ:z\d+]] ParameterValue
-# CHECK-DAG: [[Cst1:i\d+]] IntConstant 1
-# CHECK-DAG: [[Cst5:i\d+]] IntConstant 5
-# CHECK-DAG: [[Cst7:i\d+]] IntConstant 7
-# CHECK-DAG: [[PhiX:i\d+]] Phi [ [[ArgX]] [[Add5:i\d+]] [[Add7:i\d+]] ] loop_header:[[HeaderY:B\d+]]
-# CHECK-DAG: If [ [[ArgY]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: If [ [[ArgZ]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: If [ [[Cst1]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[Add5]] Add [ [[PhiX]] [[Cst5]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[Add7]] Add [ [[PhiX]] [[Cst7]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: Return [ [[PhiX]] ] loop_header:null
+# CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+# CHECK-DAG: <<ArgY:z\d+>> ParameterValue
+# CHECK-DAG: <<ArgZ:z\d+>> ParameterValue
+# CHECK-DAG: <<Cst1:i\d+>> IntConstant 1
+# CHECK-DAG: <<Cst5:i\d+>> IntConstant 5
+# CHECK-DAG: <<Cst7:i\d+>> IntConstant 7
+# CHECK-DAG: <<PhiX:i\d+>> Phi [<<ArgX>>,<<Add5:i\d+>>,<<Add7:i\d+>>] loop:<<HeaderY:B\d+>>
+# CHECK-DAG: If [<<ArgY>>] loop:<<HeaderY>>
+# CHECK-DAG: If [<<ArgZ>>] loop:<<HeaderY>>
+# CHECK-DAG: If [<<Cst1>>] loop:<<HeaderY>>
+# CHECK-DAG: <<Add5>> Add [<<PhiX>>,<<Cst5>>] loop:<<HeaderY>>
+# CHECK-DAG: <<Add7>> Add [<<PhiX>>,<<Cst7>>] loop:<<HeaderY>>
+# CHECK-DAG: Return [<<PhiX>>] loop:none
# CHECK-START: int TestCase.testMultipleExits(int, boolean, boolean) dead_code_elimination_final (after)
-# CHECK-DAG: [[ArgX:i\d+]] ParameterValue
-# CHECK-DAG: [[ArgY:z\d+]] ParameterValue
-# CHECK-DAG: [[ArgZ:z\d+]] ParameterValue
-# CHECK-DAG: [[Cst7:i\d+]] IntConstant 7
-# CHECK-DAG: [[PhiX:i\d+]] Phi [ [[ArgX]] [[Add7:i\d+]] ] loop_header:[[HeaderY:B\d+]]
-# CHECK-DAG: If [ [[ArgY]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[Add7]] Add [ [[PhiX]] [[Cst7]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: If [ [[ArgZ]] ] loop_header:null
-# CHECK-DAG: Return [ [[PhiX]] ] loop_header:null
+# CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+# CHECK-DAG: <<ArgY:z\d+>> ParameterValue
+# CHECK-DAG: <<ArgZ:z\d+>> ParameterValue
+# CHECK-DAG: <<Cst7:i\d+>> IntConstant 7
+# CHECK-DAG: <<PhiX:i\d+>> Phi [<<ArgX>>,<<Add7:i\d+>>] loop:<<HeaderY:B\d+>>
+# CHECK-DAG: If [<<ArgY>>] loop:<<HeaderY>>
+# CHECK-DAG: <<Add7>> Add [<<PhiX>>,<<Cst7>>] loop:<<HeaderY>>
+# CHECK-DAG: If [<<ArgZ>>] loop:none
+# CHECK-DAG: Return [<<PhiX>>] loop:none
.method public static testMultipleExits(IZZ)I
.registers 4
@@ -130,36 +130,36 @@
# CHECK-START: int TestCase.testExitPredecessors(int, boolean, boolean) dead_code_elimination_final (before)
-# CHECK-DAG: [[ArgX:i\d+]] ParameterValue
-# CHECK-DAG: [[ArgY:z\d+]] ParameterValue
-# CHECK-DAG: [[ArgZ:z\d+]] ParameterValue
-# CHECK-DAG: [[Cst1:i\d+]] IntConstant 1
-# CHECK-DAG: [[Cst5:i\d+]] IntConstant 5
-# CHECK-DAG: [[Cst7:i\d+]] IntConstant 7
-# CHECK-DAG: [[Cst9:i\d+]] IntConstant 9
-# CHECK-DAG: [[PhiX1:i\d+]] Phi [ [[ArgX]] [[Add5:i\d+]] [[Add7:i\d+]] ] loop_header:[[HeaderY:B\d+]]
-# CHECK-DAG: If [ [[ArgY]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: If [ [[ArgZ]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[Mul9:i\d+]] Mul [ [[PhiX1]] [[Cst9]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[PhiX2:i\d+]] Phi [ [[Mul9]] [[PhiX1]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: If [ [[Cst1]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[Add5]] Add [ [[PhiX2]] [[Cst5]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[Add7]] Add [ [[PhiX1]] [[Cst7]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: Return [ [[PhiX2]] ] loop_header:null
+# CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+# CHECK-DAG: <<ArgY:z\d+>> ParameterValue
+# CHECK-DAG: <<ArgZ:z\d+>> ParameterValue
+# CHECK-DAG: <<Cst1:i\d+>> IntConstant 1
+# CHECK-DAG: <<Cst5:i\d+>> IntConstant 5
+# CHECK-DAG: <<Cst7:i\d+>> IntConstant 7
+# CHECK-DAG: <<Cst9:i\d+>> IntConstant 9
+# CHECK-DAG: <<PhiX1:i\d+>> Phi [<<ArgX>>,<<Add5:i\d+>>,<<Add7:i\d+>>] loop:<<HeaderY:B\d+>>
+# CHECK-DAG: If [<<ArgY>>] loop:<<HeaderY>>
+# CHECK-DAG: If [<<ArgZ>>] loop:<<HeaderY>>
+# CHECK-DAG: <<Mul9:i\d+>> Mul [<<PhiX1>>,<<Cst9>>] loop:<<HeaderY>>
+# CHECK-DAG: <<PhiX2:i\d+>> Phi [<<Mul9>>,<<PhiX1>>] loop:<<HeaderY>>
+# CHECK-DAG: If [<<Cst1>>] loop:<<HeaderY>>
+# CHECK-DAG: <<Add5>> Add [<<PhiX2>>,<<Cst5>>] loop:<<HeaderY>>
+# CHECK-DAG: <<Add7>> Add [<<PhiX1>>,<<Cst7>>] loop:<<HeaderY>>
+# CHECK-DAG: Return [<<PhiX2>>] loop:none
# CHECK-START: int TestCase.testExitPredecessors(int, boolean, boolean) dead_code_elimination_final (after)
-# CHECK-DAG: [[ArgX:i\d+]] ParameterValue
-# CHECK-DAG: [[ArgY:z\d+]] ParameterValue
-# CHECK-DAG: [[ArgZ:z\d+]] ParameterValue
-# CHECK-DAG: [[Cst7:i\d+]] IntConstant 7
-# CHECK-DAG: [[Cst9:i\d+]] IntConstant 9
-# CHECK-DAG: [[PhiX1:i\d+]] Phi [ [[ArgX]] [[Add7:i\d+]] ] loop_header:[[HeaderY:B\d+]]
-# CHECK-DAG: If [ [[ArgY]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[Add7]] Add [ [[PhiX1]] [[Cst7]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: If [ [[ArgZ]] ] loop_header:null
-# CHECK-DAG: [[Mul9:i\d+]] Mul [ [[PhiX1]] [[Cst9]] ] loop_header:null
-# CHECK-DAG: [[PhiX2:i\d+]] Phi [ [[Mul9]] [[PhiX1]] ] loop_header:null
-# CHECK-DAG: Return [ [[PhiX2]] ] loop_header:null
+# CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+# CHECK-DAG: <<ArgY:z\d+>> ParameterValue
+# CHECK-DAG: <<ArgZ:z\d+>> ParameterValue
+# CHECK-DAG: <<Cst7:i\d+>> IntConstant 7
+# CHECK-DAG: <<Cst9:i\d+>> IntConstant 9
+# CHECK-DAG: <<PhiX1:i\d+>> Phi [<<ArgX>>,<<Add7:i\d+>>] loop:<<HeaderY:B\d+>>
+# CHECK-DAG: If [<<ArgY>>] loop:<<HeaderY>>
+# CHECK-DAG: <<Add7>> Add [<<PhiX1>>,<<Cst7>>] loop:<<HeaderY>>
+# CHECK-DAG: If [<<ArgZ>>] loop:none
+# CHECK-DAG: <<Mul9:i\d+>> Mul [<<PhiX1>>,<<Cst9>>] loop:none
+# CHECK-DAG: <<PhiX2:i\d+>> Phi [<<Mul9>>,<<PhiX1>>] loop:none
+# CHECK-DAG: Return [<<PhiX2>>] loop:none
.method public static testExitPredecessors(IZZ)I
.registers 4
@@ -197,48 +197,48 @@
# CHECK-START: int TestCase.testInnerLoop(int, boolean, boolean) dead_code_elimination_final (before)
-# CHECK-DAG: [[ArgX:i\d+]] ParameterValue
-# CHECK-DAG: [[ArgY:z\d+]] ParameterValue
-# CHECK-DAG: [[ArgZ:z\d+]] ParameterValue
-# CHECK-DAG: [[Cst0:i\d+]] IntConstant 0
-# CHECK-DAG: [[Cst1:i\d+]] IntConstant 1
-# CHECK-DAG: [[Cst5:i\d+]] IntConstant 5
-# CHECK-DAG: [[Cst7:i\d+]] IntConstant 7
+# CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+# CHECK-DAG: <<ArgY:z\d+>> ParameterValue
+# CHECK-DAG: <<ArgZ:z\d+>> ParameterValue
+# CHECK-DAG: <<Cst0:i\d+>> IntConstant 0
+# CHECK-DAG: <<Cst1:i\d+>> IntConstant 1
+# CHECK-DAG: <<Cst5:i\d+>> IntConstant 5
+# CHECK-DAG: <<Cst7:i\d+>> IntConstant 7
#
-# CHECK-DAG: [[PhiX:i\d+]] Phi [ [[ArgX]] [[Add5:i\d+]] [[Add7:i\d+]] ] loop_header:[[HeaderY:B\d+]]
-# CHECK-DAG: [[PhiZ1:i\d+]] Phi [ [[ArgZ]] [[XorZ:i\d+]] [[PhiZ1]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: If [ [[ArgY]] ] loop_header:[[HeaderY]]
+# CHECK-DAG: <<PhiX:i\d+>> Phi [<<ArgX>>,<<Add5:i\d+>>,<<Add7:i\d+>>] loop:<<HeaderY:B\d+>>
+# CHECK-DAG: <<PhiZ1:i\d+>> Phi [<<ArgZ>>,<<XorZ:i\d+>>,<<PhiZ1>>] loop:<<HeaderY>>
+# CHECK-DAG: If [<<ArgY>>] loop:<<HeaderY>>
#
# ### Inner loop ###
-# CHECK-DAG: [[PhiZ2:i\d+]] Phi [ [[PhiZ1]] [[XorZ]] ] loop_header:[[HeaderZ:B\d+]]
-# CHECK-DAG: [[XorZ]] Xor [ [[PhiZ2]] [[Cst1]] ] loop_header:[[HeaderZ]]
-# CHECK-DAG: [[CondZ:z\d+]] Equal [ [[XorZ]] [[Cst0]] ] loop_header:[[HeaderZ]]
-# CHECK-DAG: If [ [[CondZ]] ] loop_header:[[HeaderZ]]
+# CHECK-DAG: <<PhiZ2:i\d+>> Phi [<<PhiZ1>>,<<XorZ>>] loop:<<HeaderZ:B\d+>>
+# CHECK-DAG: <<XorZ>> Xor [<<PhiZ2>>,<<Cst1>>] loop:<<HeaderZ>>
+# CHECK-DAG: <<CondZ:z\d+>> Equal [<<XorZ>>,<<Cst0>>] loop:<<HeaderZ>>
+# CHECK-DAG: If [<<CondZ>>] loop:<<HeaderZ>>
#
-# CHECK-DAG: [[Add5]] Add [ [[PhiX]] [[Cst5]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[Add7]] Add [ [[PhiX]] [[Cst7]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: Return [ [[PhiX]] ] loop_header:null
+# CHECK-DAG: <<Add5>> Add [<<PhiX>>,<<Cst5>>] loop:<<HeaderY>>
+# CHECK-DAG: <<Add7>> Add [<<PhiX>>,<<Cst7>>] loop:<<HeaderY>>
+# CHECK-DAG: Return [<<PhiX>>] loop:none
# CHECK-START: int TestCase.testInnerLoop(int, boolean, boolean) dead_code_elimination_final (after)
-# CHECK-DAG: [[ArgX:i\d+]] ParameterValue
-# CHECK-DAG: [[ArgY:z\d+]] ParameterValue
-# CHECK-DAG: [[ArgZ:z\d+]] ParameterValue
-# CHECK-DAG: [[Cst0:i\d+]] IntConstant 0
-# CHECK-DAG: [[Cst1:i\d+]] IntConstant 1
-# CHECK-DAG: [[Cst7:i\d+]] IntConstant 7
+# CHECK-DAG: <<ArgX:i\d+>> ParameterValue
+# CHECK-DAG: <<ArgY:z\d+>> ParameterValue
+# CHECK-DAG: <<ArgZ:z\d+>> ParameterValue
+# CHECK-DAG: <<Cst0:i\d+>> IntConstant 0
+# CHECK-DAG: <<Cst1:i\d+>> IntConstant 1
+# CHECK-DAG: <<Cst7:i\d+>> IntConstant 7
#
-# CHECK-DAG: [[PhiX:i\d+]] Phi [ [[ArgX]] [[Add7:i\d+]] ] loop_header:[[HeaderY:B\d+]]
-# CHECK-DAG: [[PhiZ1:i\d+]] Phi [ [[ArgZ]] [[PhiZ1]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: If [ [[ArgY]] ] loop_header:[[HeaderY]]
-# CHECK-DAG: [[Add7]] Add [ [[PhiX]] [[Cst7]] ] loop_header:[[HeaderY]]
+# CHECK-DAG: <<PhiX:i\d+>> Phi [<<ArgX>>,<<Add7:i\d+>>] loop:<<HeaderY:B\d+>>
+# CHECK-DAG: <<PhiZ1:i\d+>> Phi [<<ArgZ>>,<<PhiZ1>>] loop:<<HeaderY>>
+# CHECK-DAG: If [<<ArgY>>] loop:<<HeaderY>>
+# CHECK-DAG: <<Add7>> Add [<<PhiX>>,<<Cst7>>] loop:<<HeaderY>>
#
# ### Inner loop ###
-# CHECK-DAG: [[PhiZ2:i\d+]] Phi [ [[PhiZ1]] [[XorZ:i\d+]] ] loop_header:[[HeaderZ:B\d+]]
-# CHECK-DAG: [[XorZ]] Xor [ [[PhiZ2]] [[Cst1]] ] loop_header:[[HeaderZ]]
-# CHECK-DAG: [[CondZ:z\d+]] Equal [ [[XorZ]] [[Cst0]] ] loop_header:[[HeaderZ]]
-# CHECK-DAG: If [ [[CondZ]] ] loop_header:[[HeaderZ]]
+# CHECK-DAG: <<PhiZ2:i\d+>> Phi [<<PhiZ1>>,<<XorZ:i\d+>>] loop:<<HeaderZ:B\d+>>
+# CHECK-DAG: <<XorZ>> Xor [<<PhiZ2>>,<<Cst1>>] loop:<<HeaderZ>>
+# CHECK-DAG: <<CondZ:z\d+>> Equal [<<XorZ>>,<<Cst0>>] loop:<<HeaderZ>>
+# CHECK-DAG: If [<<CondZ>>] loop:<<HeaderZ>>
#
-# CHECK-DAG: Return [ [[PhiX]] ] loop_header:null
+# CHECK-DAG: Return [<<PhiX>>] loop:none
.method public static testInnerLoop(IZZ)I
.registers 4
diff --git a/test/701-easy-div-rem/build b/test/701-easy-div-rem/build
new file mode 100644
index 0000000..1dc8452
--- /dev/null
+++ b/test/701-easy-div-rem/build
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+# Copyright (C) 2014 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Stop if something fails.
+set -e
+
+# Write out the source file.
+mkdir src
+python ./genMain.py
+
+# Increase the file size limitation for classes.lst as the machine generated
+# source file contains a lot of methods and is quite large.
+ulimit -S 4096
+
+./default-build
diff --git a/test/701-easy-div-rem/genMain.py b/test/701-easy-div-rem/genMain.py
index 80eac34..75eee17 100644
--- a/test/701-easy-div-rem/genMain.py
+++ b/test/701-easy-div-rem/genMain.py
@@ -12,15 +12,28 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+upper_bound_int_pow2 = 31
+upper_bound_long_pow2 = 63
+upper_bound_constant = 100
all_tests = [
({'@INT@': 'int', '@SUFFIX@':''},
- [('CheckDiv', 'idiv_by_pow2_', [2**i for i in range(31)]),
- ('CheckDiv', 'idiv_by_small_', [i for i in range(3, 16) if i not in (4, 8)]),
- ('CheckRem', 'irem_by_pow2_', [2**i for i in range(31)])]),
+ [('CheckDiv', 'idiv_by_pow2_', [2**i for i in range(upper_bound_int_pow2)]),
+ ('CheckDiv', 'idiv_by_pow2_neg_', [-2**i for i in range(upper_bound_int_pow2)]),
+ ('CheckDiv', 'idiv_by_constant_', [i for i in range(1, upper_bound_constant)]),
+ ('CheckDiv', 'idiv_by_constant_neg_', [-i for i in range(1, upper_bound_constant)]),
+ ('CheckRem', 'irem_by_pow2_', [2**i for i in range(upper_bound_int_pow2)]),
+ ('CheckRem', 'irem_by_pow2_neg_', [-2**i for i in range(upper_bound_int_pow2)]),
+ ('CheckRem', 'irem_by_constant_', [i for i in range(1, upper_bound_constant)]),
+ ('CheckRem', 'irem_by_constant_neg_', [-i for i in range(1, upper_bound_constant)])]),
({'@INT@': 'long', '@SUFFIX@': 'l'},
- [('CheckDiv', 'ldiv_by_pow2_', [2**i for i in range(63)]),
- ('CheckDiv', 'ldiv_by_small_', [i for i in range(3, 16) if i not in (4, 8)]),
- ('CheckRem', 'lrem_by_pow2_', [2**i for i in range(63)])])
+ [('CheckDiv', 'ldiv_by_pow2_', [2**i for i in range(upper_bound_long_pow2)]),
+ ('CheckDiv', 'ldiv_by_pow2_neg_', [-2**i for i in range(upper_bound_long_pow2)]),
+ ('CheckDiv', 'ldiv_by_constant_', [i for i in range(1, upper_bound_constant)]),
+ ('CheckDiv', 'ldiv_by_constant_neg_', [-i for i in range(1, upper_bound_constant)]),
+ ('CheckRem', 'lrem_by_pow2_', [2**i for i in range(upper_bound_long_pow2)]),
+ ('CheckRem', 'lrem_by_pow2_neg_', [-2**i for i in range(upper_bound_long_pow2)]),
+ ('CheckRem', 'lrem_by_constant_', [i for i in range(1, upper_bound_constant)]),
+ ('CheckRem', 'lrem_by_constant_neg_', [-i for i in range(1, upper_bound_constant)])])
]
def subst_vars(variables, text):
diff --git a/test/701-easy-div-rem/src/Main.java b/test/701-easy-div-rem/src/Main.java
deleted file mode 100644
index f995f61..0000000
--- a/test/701-easy-div-rem/src/Main.java
+++ /dev/null
@@ -1,529 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-public class Main {
- public static int num_errors = 0;
-
- public static void reportError(String message) {
- if (num_errors == 10) {
- System.out.println("Omitting other error messages...");
- } else if (num_errors < 10) {
- System.out.println(message);
- }
- num_errors += 1;
- }
-
- public static void intCheckDiv(String desc, int result, int dividend, int divisor) {
- int correct_result = dividend / divisor;
- if (result != correct_result) {
- reportError(desc + "(" + dividend + ") == " + result +
- " should be " + correct_result);
- }
- }
- public static void intCheckRem(String desc, int result, int dividend, int divisor) {
- int correct_result = dividend % divisor;
- if (result != correct_result) {
- reportError(desc + "(" + dividend + ") == " + result +
- " should be " + correct_result);
- }
- }
- public static void longCheckDiv(String desc, long result, long dividend, long divisor) {
- long correct_result = dividend / divisor;
- if (result != correct_result) {
- reportError(desc + "(" + dividend + ") == " + result +
- " should be " + correct_result);
- }
- }
- public static void longCheckRem(String desc, long result, long dividend, long divisor) {
- long correct_result = dividend % divisor;
- if (result != correct_result) {
- reportError(desc + "(" + dividend + ") == " + result +
- " should be " + correct_result);
- }
- }
-
- public static int idiv_by_pow2_0(int x) {return x / 1;}
- public static int idiv_by_pow2_1(int x) {return x / 2;}
- public static int idiv_by_pow2_2(int x) {return x / 4;}
- public static int idiv_by_pow2_3(int x) {return x / 8;}
- public static int idiv_by_pow2_4(int x) {return x / 16;}
- public static int idiv_by_pow2_5(int x) {return x / 32;}
- public static int idiv_by_pow2_6(int x) {return x / 64;}
- public static int idiv_by_pow2_7(int x) {return x / 128;}
- public static int idiv_by_pow2_8(int x) {return x / 256;}
- public static int idiv_by_pow2_9(int x) {return x / 512;}
- public static int idiv_by_pow2_10(int x) {return x / 1024;}
- public static int idiv_by_pow2_11(int x) {return x / 2048;}
- public static int idiv_by_pow2_12(int x) {return x / 4096;}
- public static int idiv_by_pow2_13(int x) {return x / 8192;}
- public static int idiv_by_pow2_14(int x) {return x / 16384;}
- public static int idiv_by_pow2_15(int x) {return x / 32768;}
- public static int idiv_by_pow2_16(int x) {return x / 65536;}
- public static int idiv_by_pow2_17(int x) {return x / 131072;}
- public static int idiv_by_pow2_18(int x) {return x / 262144;}
- public static int idiv_by_pow2_19(int x) {return x / 524288;}
- public static int idiv_by_pow2_20(int x) {return x / 1048576;}
- public static int idiv_by_pow2_21(int x) {return x / 2097152;}
- public static int idiv_by_pow2_22(int x) {return x / 4194304;}
- public static int idiv_by_pow2_23(int x) {return x / 8388608;}
- public static int idiv_by_pow2_24(int x) {return x / 16777216;}
- public static int idiv_by_pow2_25(int x) {return x / 33554432;}
- public static int idiv_by_pow2_26(int x) {return x / 67108864;}
- public static int idiv_by_pow2_27(int x) {return x / 134217728;}
- public static int idiv_by_pow2_28(int x) {return x / 268435456;}
- public static int idiv_by_pow2_29(int x) {return x / 536870912;}
- public static int idiv_by_pow2_30(int x) {return x / 1073741824;}
- public static int idiv_by_small_0(int x) {return x / 3;}
- public static int idiv_by_small_1(int x) {return x / 5;}
- public static int idiv_by_small_2(int x) {return x / 6;}
- public static int idiv_by_small_3(int x) {return x / 7;}
- public static int idiv_by_small_4(int x) {return x / 9;}
- public static int idiv_by_small_5(int x) {return x / 10;}
- public static int idiv_by_small_6(int x) {return x / 11;}
- public static int idiv_by_small_7(int x) {return x / 12;}
- public static int idiv_by_small_8(int x) {return x / 13;}
- public static int idiv_by_small_9(int x) {return x / 14;}
- public static int idiv_by_small_10(int x) {return x / 15;}
- public static int irem_by_pow2_0(int x) {return x % 1;}
- public static int irem_by_pow2_1(int x) {return x % 2;}
- public static int irem_by_pow2_2(int x) {return x % 4;}
- public static int irem_by_pow2_3(int x) {return x % 8;}
- public static int irem_by_pow2_4(int x) {return x % 16;}
- public static int irem_by_pow2_5(int x) {return x % 32;}
- public static int irem_by_pow2_6(int x) {return x % 64;}
- public static int irem_by_pow2_7(int x) {return x % 128;}
- public static int irem_by_pow2_8(int x) {return x % 256;}
- public static int irem_by_pow2_9(int x) {return x % 512;}
- public static int irem_by_pow2_10(int x) {return x % 1024;}
- public static int irem_by_pow2_11(int x) {return x % 2048;}
- public static int irem_by_pow2_12(int x) {return x % 4096;}
- public static int irem_by_pow2_13(int x) {return x % 8192;}
- public static int irem_by_pow2_14(int x) {return x % 16384;}
- public static int irem_by_pow2_15(int x) {return x % 32768;}
- public static int irem_by_pow2_16(int x) {return x % 65536;}
- public static int irem_by_pow2_17(int x) {return x % 131072;}
- public static int irem_by_pow2_18(int x) {return x % 262144;}
- public static int irem_by_pow2_19(int x) {return x % 524288;}
- public static int irem_by_pow2_20(int x) {return x % 1048576;}
- public static int irem_by_pow2_21(int x) {return x % 2097152;}
- public static int irem_by_pow2_22(int x) {return x % 4194304;}
- public static int irem_by_pow2_23(int x) {return x % 8388608;}
- public static int irem_by_pow2_24(int x) {return x % 16777216;}
- public static int irem_by_pow2_25(int x) {return x % 33554432;}
- public static int irem_by_pow2_26(int x) {return x % 67108864;}
- public static int irem_by_pow2_27(int x) {return x % 134217728;}
- public static int irem_by_pow2_28(int x) {return x % 268435456;}
- public static int irem_by_pow2_29(int x) {return x % 536870912;}
- public static int irem_by_pow2_30(int x) {return x % 1073741824;}
- public static long ldiv_by_pow2_0(long x) {return x / 1l;}
- public static long ldiv_by_pow2_1(long x) {return x / 2l;}
- public static long ldiv_by_pow2_2(long x) {return x / 4l;}
- public static long ldiv_by_pow2_3(long x) {return x / 8l;}
- public static long ldiv_by_pow2_4(long x) {return x / 16l;}
- public static long ldiv_by_pow2_5(long x) {return x / 32l;}
- public static long ldiv_by_pow2_6(long x) {return x / 64l;}
- public static long ldiv_by_pow2_7(long x) {return x / 128l;}
- public static long ldiv_by_pow2_8(long x) {return x / 256l;}
- public static long ldiv_by_pow2_9(long x) {return x / 512l;}
- public static long ldiv_by_pow2_10(long x) {return x / 1024l;}
- public static long ldiv_by_pow2_11(long x) {return x / 2048l;}
- public static long ldiv_by_pow2_12(long x) {return x / 4096l;}
- public static long ldiv_by_pow2_13(long x) {return x / 8192l;}
- public static long ldiv_by_pow2_14(long x) {return x / 16384l;}
- public static long ldiv_by_pow2_15(long x) {return x / 32768l;}
- public static long ldiv_by_pow2_16(long x) {return x / 65536l;}
- public static long ldiv_by_pow2_17(long x) {return x / 131072l;}
- public static long ldiv_by_pow2_18(long x) {return x / 262144l;}
- public static long ldiv_by_pow2_19(long x) {return x / 524288l;}
- public static long ldiv_by_pow2_20(long x) {return x / 1048576l;}
- public static long ldiv_by_pow2_21(long x) {return x / 2097152l;}
- public static long ldiv_by_pow2_22(long x) {return x / 4194304l;}
- public static long ldiv_by_pow2_23(long x) {return x / 8388608l;}
- public static long ldiv_by_pow2_24(long x) {return x / 16777216l;}
- public static long ldiv_by_pow2_25(long x) {return x / 33554432l;}
- public static long ldiv_by_pow2_26(long x) {return x / 67108864l;}
- public static long ldiv_by_pow2_27(long x) {return x / 134217728l;}
- public static long ldiv_by_pow2_28(long x) {return x / 268435456l;}
- public static long ldiv_by_pow2_29(long x) {return x / 536870912l;}
- public static long ldiv_by_pow2_30(long x) {return x / 1073741824l;}
- public static long ldiv_by_pow2_31(long x) {return x / 2147483648l;}
- public static long ldiv_by_pow2_32(long x) {return x / 4294967296l;}
- public static long ldiv_by_pow2_33(long x) {return x / 8589934592l;}
- public static long ldiv_by_pow2_34(long x) {return x / 17179869184l;}
- public static long ldiv_by_pow2_35(long x) {return x / 34359738368l;}
- public static long ldiv_by_pow2_36(long x) {return x / 68719476736l;}
- public static long ldiv_by_pow2_37(long x) {return x / 137438953472l;}
- public static long ldiv_by_pow2_38(long x) {return x / 274877906944l;}
- public static long ldiv_by_pow2_39(long x) {return x / 549755813888l;}
- public static long ldiv_by_pow2_40(long x) {return x / 1099511627776l;}
- public static long ldiv_by_pow2_41(long x) {return x / 2199023255552l;}
- public static long ldiv_by_pow2_42(long x) {return x / 4398046511104l;}
- public static long ldiv_by_pow2_43(long x) {return x / 8796093022208l;}
- public static long ldiv_by_pow2_44(long x) {return x / 17592186044416l;}
- public static long ldiv_by_pow2_45(long x) {return x / 35184372088832l;}
- public static long ldiv_by_pow2_46(long x) {return x / 70368744177664l;}
- public static long ldiv_by_pow2_47(long x) {return x / 140737488355328l;}
- public static long ldiv_by_pow2_48(long x) {return x / 281474976710656l;}
- public static long ldiv_by_pow2_49(long x) {return x / 562949953421312l;}
- public static long ldiv_by_pow2_50(long x) {return x / 1125899906842624l;}
- public static long ldiv_by_pow2_51(long x) {return x / 2251799813685248l;}
- public static long ldiv_by_pow2_52(long x) {return x / 4503599627370496l;}
- public static long ldiv_by_pow2_53(long x) {return x / 9007199254740992l;}
- public static long ldiv_by_pow2_54(long x) {return x / 18014398509481984l;}
- public static long ldiv_by_pow2_55(long x) {return x / 36028797018963968l;}
- public static long ldiv_by_pow2_56(long x) {return x / 72057594037927936l;}
- public static long ldiv_by_pow2_57(long x) {return x / 144115188075855872l;}
- public static long ldiv_by_pow2_58(long x) {return x / 288230376151711744l;}
- public static long ldiv_by_pow2_59(long x) {return x / 576460752303423488l;}
- public static long ldiv_by_pow2_60(long x) {return x / 1152921504606846976l;}
- public static long ldiv_by_pow2_61(long x) {return x / 2305843009213693952l;}
- public static long ldiv_by_pow2_62(long x) {return x / 4611686018427387904l;}
- public static long ldiv_by_small_0(long x) {return x / 3l;}
- public static long ldiv_by_small_1(long x) {return x / 5l;}
- public static long ldiv_by_small_2(long x) {return x / 6l;}
- public static long ldiv_by_small_3(long x) {return x / 7l;}
- public static long ldiv_by_small_4(long x) {return x / 9l;}
- public static long ldiv_by_small_5(long x) {return x / 10l;}
- public static long ldiv_by_small_6(long x) {return x / 11l;}
- public static long ldiv_by_small_7(long x) {return x / 12l;}
- public static long ldiv_by_small_8(long x) {return x / 13l;}
- public static long ldiv_by_small_9(long x) {return x / 14l;}
- public static long ldiv_by_small_10(long x) {return x / 15l;}
- public static long lrem_by_pow2_0(long x) {return x % 1l;}
- public static long lrem_by_pow2_1(long x) {return x % 2l;}
- public static long lrem_by_pow2_2(long x) {return x % 4l;}
- public static long lrem_by_pow2_3(long x) {return x % 8l;}
- public static long lrem_by_pow2_4(long x) {return x % 16l;}
- public static long lrem_by_pow2_5(long x) {return x % 32l;}
- public static long lrem_by_pow2_6(long x) {return x % 64l;}
- public static long lrem_by_pow2_7(long x) {return x % 128l;}
- public static long lrem_by_pow2_8(long x) {return x % 256l;}
- public static long lrem_by_pow2_9(long x) {return x % 512l;}
- public static long lrem_by_pow2_10(long x) {return x % 1024l;}
- public static long lrem_by_pow2_11(long x) {return x % 2048l;}
- public static long lrem_by_pow2_12(long x) {return x % 4096l;}
- public static long lrem_by_pow2_13(long x) {return x % 8192l;}
- public static long lrem_by_pow2_14(long x) {return x % 16384l;}
- public static long lrem_by_pow2_15(long x) {return x % 32768l;}
- public static long lrem_by_pow2_16(long x) {return x % 65536l;}
- public static long lrem_by_pow2_17(long x) {return x % 131072l;}
- public static long lrem_by_pow2_18(long x) {return x % 262144l;}
- public static long lrem_by_pow2_19(long x) {return x % 524288l;}
- public static long lrem_by_pow2_20(long x) {return x % 1048576l;}
- public static long lrem_by_pow2_21(long x) {return x % 2097152l;}
- public static long lrem_by_pow2_22(long x) {return x % 4194304l;}
- public static long lrem_by_pow2_23(long x) {return x % 8388608l;}
- public static long lrem_by_pow2_24(long x) {return x % 16777216l;}
- public static long lrem_by_pow2_25(long x) {return x % 33554432l;}
- public static long lrem_by_pow2_26(long x) {return x % 67108864l;}
- public static long lrem_by_pow2_27(long x) {return x % 134217728l;}
- public static long lrem_by_pow2_28(long x) {return x % 268435456l;}
- public static long lrem_by_pow2_29(long x) {return x % 536870912l;}
- public static long lrem_by_pow2_30(long x) {return x % 1073741824l;}
- public static long lrem_by_pow2_31(long x) {return x % 2147483648l;}
- public static long lrem_by_pow2_32(long x) {return x % 4294967296l;}
- public static long lrem_by_pow2_33(long x) {return x % 8589934592l;}
- public static long lrem_by_pow2_34(long x) {return x % 17179869184l;}
- public static long lrem_by_pow2_35(long x) {return x % 34359738368l;}
- public static long lrem_by_pow2_36(long x) {return x % 68719476736l;}
- public static long lrem_by_pow2_37(long x) {return x % 137438953472l;}
- public static long lrem_by_pow2_38(long x) {return x % 274877906944l;}
- public static long lrem_by_pow2_39(long x) {return x % 549755813888l;}
- public static long lrem_by_pow2_40(long x) {return x % 1099511627776l;}
- public static long lrem_by_pow2_41(long x) {return x % 2199023255552l;}
- public static long lrem_by_pow2_42(long x) {return x % 4398046511104l;}
- public static long lrem_by_pow2_43(long x) {return x % 8796093022208l;}
- public static long lrem_by_pow2_44(long x) {return x % 17592186044416l;}
- public static long lrem_by_pow2_45(long x) {return x % 35184372088832l;}
- public static long lrem_by_pow2_46(long x) {return x % 70368744177664l;}
- public static long lrem_by_pow2_47(long x) {return x % 140737488355328l;}
- public static long lrem_by_pow2_48(long x) {return x % 281474976710656l;}
- public static long lrem_by_pow2_49(long x) {return x % 562949953421312l;}
- public static long lrem_by_pow2_50(long x) {return x % 1125899906842624l;}
- public static long lrem_by_pow2_51(long x) {return x % 2251799813685248l;}
- public static long lrem_by_pow2_52(long x) {return x % 4503599627370496l;}
- public static long lrem_by_pow2_53(long x) {return x % 9007199254740992l;}
- public static long lrem_by_pow2_54(long x) {return x % 18014398509481984l;}
- public static long lrem_by_pow2_55(long x) {return x % 36028797018963968l;}
- public static long lrem_by_pow2_56(long x) {return x % 72057594037927936l;}
- public static long lrem_by_pow2_57(long x) {return x % 144115188075855872l;}
- public static long lrem_by_pow2_58(long x) {return x % 288230376151711744l;}
- public static long lrem_by_pow2_59(long x) {return x % 576460752303423488l;}
- public static long lrem_by_pow2_60(long x) {return x % 1152921504606846976l;}
- public static long lrem_by_pow2_61(long x) {return x % 2305843009213693952l;}
- public static long lrem_by_pow2_62(long x) {return x % 4611686018427387904l;}
-
- public static void intCheckAll(int x) {
- intCheckDiv("idiv_by_pow2_0", idiv_by_pow2_0(x), x, 1);
- intCheckDiv("idiv_by_pow2_1", idiv_by_pow2_1(x), x, 2);
- intCheckDiv("idiv_by_pow2_2", idiv_by_pow2_2(x), x, 4);
- intCheckDiv("idiv_by_pow2_3", idiv_by_pow2_3(x), x, 8);
- intCheckDiv("idiv_by_pow2_4", idiv_by_pow2_4(x), x, 16);
- intCheckDiv("idiv_by_pow2_5", idiv_by_pow2_5(x), x, 32);
- intCheckDiv("idiv_by_pow2_6", idiv_by_pow2_6(x), x, 64);
- intCheckDiv("idiv_by_pow2_7", idiv_by_pow2_7(x), x, 128);
- intCheckDiv("idiv_by_pow2_8", idiv_by_pow2_8(x), x, 256);
- intCheckDiv("idiv_by_pow2_9", idiv_by_pow2_9(x), x, 512);
- intCheckDiv("idiv_by_pow2_10", idiv_by_pow2_10(x), x, 1024);
- intCheckDiv("idiv_by_pow2_11", idiv_by_pow2_11(x), x, 2048);
- intCheckDiv("idiv_by_pow2_12", idiv_by_pow2_12(x), x, 4096);
- intCheckDiv("idiv_by_pow2_13", idiv_by_pow2_13(x), x, 8192);
- intCheckDiv("idiv_by_pow2_14", idiv_by_pow2_14(x), x, 16384);
- intCheckDiv("idiv_by_pow2_15", idiv_by_pow2_15(x), x, 32768);
- intCheckDiv("idiv_by_pow2_16", idiv_by_pow2_16(x), x, 65536);
- intCheckDiv("idiv_by_pow2_17", idiv_by_pow2_17(x), x, 131072);
- intCheckDiv("idiv_by_pow2_18", idiv_by_pow2_18(x), x, 262144);
- intCheckDiv("idiv_by_pow2_19", idiv_by_pow2_19(x), x, 524288);
- intCheckDiv("idiv_by_pow2_20", idiv_by_pow2_20(x), x, 1048576);
- intCheckDiv("idiv_by_pow2_21", idiv_by_pow2_21(x), x, 2097152);
- intCheckDiv("idiv_by_pow2_22", idiv_by_pow2_22(x), x, 4194304);
- intCheckDiv("idiv_by_pow2_23", idiv_by_pow2_23(x), x, 8388608);
- intCheckDiv("idiv_by_pow2_24", idiv_by_pow2_24(x), x, 16777216);
- intCheckDiv("idiv_by_pow2_25", idiv_by_pow2_25(x), x, 33554432);
- intCheckDiv("idiv_by_pow2_26", idiv_by_pow2_26(x), x, 67108864);
- intCheckDiv("idiv_by_pow2_27", idiv_by_pow2_27(x), x, 134217728);
- intCheckDiv("idiv_by_pow2_28", idiv_by_pow2_28(x), x, 268435456);
- intCheckDiv("idiv_by_pow2_29", idiv_by_pow2_29(x), x, 536870912);
- intCheckDiv("idiv_by_pow2_30", idiv_by_pow2_30(x), x, 1073741824);
- intCheckDiv("idiv_by_small_0", idiv_by_small_0(x), x, 3);
- intCheckDiv("idiv_by_small_1", idiv_by_small_1(x), x, 5);
- intCheckDiv("idiv_by_small_2", idiv_by_small_2(x), x, 6);
- intCheckDiv("idiv_by_small_3", idiv_by_small_3(x), x, 7);
- intCheckDiv("idiv_by_small_4", idiv_by_small_4(x), x, 9);
- intCheckDiv("idiv_by_small_5", idiv_by_small_5(x), x, 10);
- intCheckDiv("idiv_by_small_6", idiv_by_small_6(x), x, 11);
- intCheckDiv("idiv_by_small_7", idiv_by_small_7(x), x, 12);
- intCheckDiv("idiv_by_small_8", idiv_by_small_8(x), x, 13);
- intCheckDiv("idiv_by_small_9", idiv_by_small_9(x), x, 14);
- intCheckDiv("idiv_by_small_10", idiv_by_small_10(x), x, 15);
- intCheckRem("irem_by_pow2_0", irem_by_pow2_0(x), x, 1);
- intCheckRem("irem_by_pow2_1", irem_by_pow2_1(x), x, 2);
- intCheckRem("irem_by_pow2_2", irem_by_pow2_2(x), x, 4);
- intCheckRem("irem_by_pow2_3", irem_by_pow2_3(x), x, 8);
- intCheckRem("irem_by_pow2_4", irem_by_pow2_4(x), x, 16);
- intCheckRem("irem_by_pow2_5", irem_by_pow2_5(x), x, 32);
- intCheckRem("irem_by_pow2_6", irem_by_pow2_6(x), x, 64);
- intCheckRem("irem_by_pow2_7", irem_by_pow2_7(x), x, 128);
- intCheckRem("irem_by_pow2_8", irem_by_pow2_8(x), x, 256);
- intCheckRem("irem_by_pow2_9", irem_by_pow2_9(x), x, 512);
- intCheckRem("irem_by_pow2_10", irem_by_pow2_10(x), x, 1024);
- intCheckRem("irem_by_pow2_11", irem_by_pow2_11(x), x, 2048);
- intCheckRem("irem_by_pow2_12", irem_by_pow2_12(x), x, 4096);
- intCheckRem("irem_by_pow2_13", irem_by_pow2_13(x), x, 8192);
- intCheckRem("irem_by_pow2_14", irem_by_pow2_14(x), x, 16384);
- intCheckRem("irem_by_pow2_15", irem_by_pow2_15(x), x, 32768);
- intCheckRem("irem_by_pow2_16", irem_by_pow2_16(x), x, 65536);
- intCheckRem("irem_by_pow2_17", irem_by_pow2_17(x), x, 131072);
- intCheckRem("irem_by_pow2_18", irem_by_pow2_18(x), x, 262144);
- intCheckRem("irem_by_pow2_19", irem_by_pow2_19(x), x, 524288);
- intCheckRem("irem_by_pow2_20", irem_by_pow2_20(x), x, 1048576);
- intCheckRem("irem_by_pow2_21", irem_by_pow2_21(x), x, 2097152);
- intCheckRem("irem_by_pow2_22", irem_by_pow2_22(x), x, 4194304);
- intCheckRem("irem_by_pow2_23", irem_by_pow2_23(x), x, 8388608);
- intCheckRem("irem_by_pow2_24", irem_by_pow2_24(x), x, 16777216);
- intCheckRem("irem_by_pow2_25", irem_by_pow2_25(x), x, 33554432);
- intCheckRem("irem_by_pow2_26", irem_by_pow2_26(x), x, 67108864);
- intCheckRem("irem_by_pow2_27", irem_by_pow2_27(x), x, 134217728);
- intCheckRem("irem_by_pow2_28", irem_by_pow2_28(x), x, 268435456);
- intCheckRem("irem_by_pow2_29", irem_by_pow2_29(x), x, 536870912);
- intCheckRem("irem_by_pow2_30", irem_by_pow2_30(x), x, 1073741824);
- }
-
- public static void longCheckAll(long x) {
- longCheckDiv("ldiv_by_pow2_0", ldiv_by_pow2_0(x), x, 1l);
- longCheckDiv("ldiv_by_pow2_1", ldiv_by_pow2_1(x), x, 2l);
- longCheckDiv("ldiv_by_pow2_2", ldiv_by_pow2_2(x), x, 4l);
- longCheckDiv("ldiv_by_pow2_3", ldiv_by_pow2_3(x), x, 8l);
- longCheckDiv("ldiv_by_pow2_4", ldiv_by_pow2_4(x), x, 16l);
- longCheckDiv("ldiv_by_pow2_5", ldiv_by_pow2_5(x), x, 32l);
- longCheckDiv("ldiv_by_pow2_6", ldiv_by_pow2_6(x), x, 64l);
- longCheckDiv("ldiv_by_pow2_7", ldiv_by_pow2_7(x), x, 128l);
- longCheckDiv("ldiv_by_pow2_8", ldiv_by_pow2_8(x), x, 256l);
- longCheckDiv("ldiv_by_pow2_9", ldiv_by_pow2_9(x), x, 512l);
- longCheckDiv("ldiv_by_pow2_10", ldiv_by_pow2_10(x), x, 1024l);
- longCheckDiv("ldiv_by_pow2_11", ldiv_by_pow2_11(x), x, 2048l);
- longCheckDiv("ldiv_by_pow2_12", ldiv_by_pow2_12(x), x, 4096l);
- longCheckDiv("ldiv_by_pow2_13", ldiv_by_pow2_13(x), x, 8192l);
- longCheckDiv("ldiv_by_pow2_14", ldiv_by_pow2_14(x), x, 16384l);
- longCheckDiv("ldiv_by_pow2_15", ldiv_by_pow2_15(x), x, 32768l);
- longCheckDiv("ldiv_by_pow2_16", ldiv_by_pow2_16(x), x, 65536l);
- longCheckDiv("ldiv_by_pow2_17", ldiv_by_pow2_17(x), x, 131072l);
- longCheckDiv("ldiv_by_pow2_18", ldiv_by_pow2_18(x), x, 262144l);
- longCheckDiv("ldiv_by_pow2_19", ldiv_by_pow2_19(x), x, 524288l);
- longCheckDiv("ldiv_by_pow2_20", ldiv_by_pow2_20(x), x, 1048576l);
- longCheckDiv("ldiv_by_pow2_21", ldiv_by_pow2_21(x), x, 2097152l);
- longCheckDiv("ldiv_by_pow2_22", ldiv_by_pow2_22(x), x, 4194304l);
- longCheckDiv("ldiv_by_pow2_23", ldiv_by_pow2_23(x), x, 8388608l);
- longCheckDiv("ldiv_by_pow2_24", ldiv_by_pow2_24(x), x, 16777216l);
- longCheckDiv("ldiv_by_pow2_25", ldiv_by_pow2_25(x), x, 33554432l);
- longCheckDiv("ldiv_by_pow2_26", ldiv_by_pow2_26(x), x, 67108864l);
- longCheckDiv("ldiv_by_pow2_27", ldiv_by_pow2_27(x), x, 134217728l);
- longCheckDiv("ldiv_by_pow2_28", ldiv_by_pow2_28(x), x, 268435456l);
- longCheckDiv("ldiv_by_pow2_29", ldiv_by_pow2_29(x), x, 536870912l);
- longCheckDiv("ldiv_by_pow2_30", ldiv_by_pow2_30(x), x, 1073741824l);
- longCheckDiv("ldiv_by_pow2_31", ldiv_by_pow2_31(x), x, 2147483648l);
- longCheckDiv("ldiv_by_pow2_32", ldiv_by_pow2_32(x), x, 4294967296l);
- longCheckDiv("ldiv_by_pow2_33", ldiv_by_pow2_33(x), x, 8589934592l);
- longCheckDiv("ldiv_by_pow2_34", ldiv_by_pow2_34(x), x, 17179869184l);
- longCheckDiv("ldiv_by_pow2_35", ldiv_by_pow2_35(x), x, 34359738368l);
- longCheckDiv("ldiv_by_pow2_36", ldiv_by_pow2_36(x), x, 68719476736l);
- longCheckDiv("ldiv_by_pow2_37", ldiv_by_pow2_37(x), x, 137438953472l);
- longCheckDiv("ldiv_by_pow2_38", ldiv_by_pow2_38(x), x, 274877906944l);
- longCheckDiv("ldiv_by_pow2_39", ldiv_by_pow2_39(x), x, 549755813888l);
- longCheckDiv("ldiv_by_pow2_40", ldiv_by_pow2_40(x), x, 1099511627776l);
- longCheckDiv("ldiv_by_pow2_41", ldiv_by_pow2_41(x), x, 2199023255552l);
- longCheckDiv("ldiv_by_pow2_42", ldiv_by_pow2_42(x), x, 4398046511104l);
- longCheckDiv("ldiv_by_pow2_43", ldiv_by_pow2_43(x), x, 8796093022208l);
- longCheckDiv("ldiv_by_pow2_44", ldiv_by_pow2_44(x), x, 17592186044416l);
- longCheckDiv("ldiv_by_pow2_45", ldiv_by_pow2_45(x), x, 35184372088832l);
- longCheckDiv("ldiv_by_pow2_46", ldiv_by_pow2_46(x), x, 70368744177664l);
- longCheckDiv("ldiv_by_pow2_47", ldiv_by_pow2_47(x), x, 140737488355328l);
- longCheckDiv("ldiv_by_pow2_48", ldiv_by_pow2_48(x), x, 281474976710656l);
- longCheckDiv("ldiv_by_pow2_49", ldiv_by_pow2_49(x), x, 562949953421312l);
- longCheckDiv("ldiv_by_pow2_50", ldiv_by_pow2_50(x), x, 1125899906842624l);
- longCheckDiv("ldiv_by_pow2_51", ldiv_by_pow2_51(x), x, 2251799813685248l);
- longCheckDiv("ldiv_by_pow2_52", ldiv_by_pow2_52(x), x, 4503599627370496l);
- longCheckDiv("ldiv_by_pow2_53", ldiv_by_pow2_53(x), x, 9007199254740992l);
- longCheckDiv("ldiv_by_pow2_54", ldiv_by_pow2_54(x), x, 18014398509481984l);
- longCheckDiv("ldiv_by_pow2_55", ldiv_by_pow2_55(x), x, 36028797018963968l);
- longCheckDiv("ldiv_by_pow2_56", ldiv_by_pow2_56(x), x, 72057594037927936l);
- longCheckDiv("ldiv_by_pow2_57", ldiv_by_pow2_57(x), x, 144115188075855872l);
- longCheckDiv("ldiv_by_pow2_58", ldiv_by_pow2_58(x), x, 288230376151711744l);
- longCheckDiv("ldiv_by_pow2_59", ldiv_by_pow2_59(x), x, 576460752303423488l);
- longCheckDiv("ldiv_by_pow2_60", ldiv_by_pow2_60(x), x, 1152921504606846976l);
- longCheckDiv("ldiv_by_pow2_61", ldiv_by_pow2_61(x), x, 2305843009213693952l);
- longCheckDiv("ldiv_by_pow2_62", ldiv_by_pow2_62(x), x, 4611686018427387904l);
- longCheckDiv("ldiv_by_small_0", ldiv_by_small_0(x), x, 3l);
- longCheckDiv("ldiv_by_small_1", ldiv_by_small_1(x), x, 5l);
- longCheckDiv("ldiv_by_small_2", ldiv_by_small_2(x), x, 6l);
- longCheckDiv("ldiv_by_small_3", ldiv_by_small_3(x), x, 7l);
- longCheckDiv("ldiv_by_small_4", ldiv_by_small_4(x), x, 9l);
- longCheckDiv("ldiv_by_small_5", ldiv_by_small_5(x), x, 10l);
- longCheckDiv("ldiv_by_small_6", ldiv_by_small_6(x), x, 11l);
- longCheckDiv("ldiv_by_small_7", ldiv_by_small_7(x), x, 12l);
- longCheckDiv("ldiv_by_small_8", ldiv_by_small_8(x), x, 13l);
- longCheckDiv("ldiv_by_small_9", ldiv_by_small_9(x), x, 14l);
- longCheckDiv("ldiv_by_small_10", ldiv_by_small_10(x), x, 15l);
- longCheckRem("lrem_by_pow2_0", lrem_by_pow2_0(x), x, 1l);
- longCheckRem("lrem_by_pow2_1", lrem_by_pow2_1(x), x, 2l);
- longCheckRem("lrem_by_pow2_2", lrem_by_pow2_2(x), x, 4l);
- longCheckRem("lrem_by_pow2_3", lrem_by_pow2_3(x), x, 8l);
- longCheckRem("lrem_by_pow2_4", lrem_by_pow2_4(x), x, 16l);
- longCheckRem("lrem_by_pow2_5", lrem_by_pow2_5(x), x, 32l);
- longCheckRem("lrem_by_pow2_6", lrem_by_pow2_6(x), x, 64l);
- longCheckRem("lrem_by_pow2_7", lrem_by_pow2_7(x), x, 128l);
- longCheckRem("lrem_by_pow2_8", lrem_by_pow2_8(x), x, 256l);
- longCheckRem("lrem_by_pow2_9", lrem_by_pow2_9(x), x, 512l);
- longCheckRem("lrem_by_pow2_10", lrem_by_pow2_10(x), x, 1024l);
- longCheckRem("lrem_by_pow2_11", lrem_by_pow2_11(x), x, 2048l);
- longCheckRem("lrem_by_pow2_12", lrem_by_pow2_12(x), x, 4096l);
- longCheckRem("lrem_by_pow2_13", lrem_by_pow2_13(x), x, 8192l);
- longCheckRem("lrem_by_pow2_14", lrem_by_pow2_14(x), x, 16384l);
- longCheckRem("lrem_by_pow2_15", lrem_by_pow2_15(x), x, 32768l);
- longCheckRem("lrem_by_pow2_16", lrem_by_pow2_16(x), x, 65536l);
- longCheckRem("lrem_by_pow2_17", lrem_by_pow2_17(x), x, 131072l);
- longCheckRem("lrem_by_pow2_18", lrem_by_pow2_18(x), x, 262144l);
- longCheckRem("lrem_by_pow2_19", lrem_by_pow2_19(x), x, 524288l);
- longCheckRem("lrem_by_pow2_20", lrem_by_pow2_20(x), x, 1048576l);
- longCheckRem("lrem_by_pow2_21", lrem_by_pow2_21(x), x, 2097152l);
- longCheckRem("lrem_by_pow2_22", lrem_by_pow2_22(x), x, 4194304l);
- longCheckRem("lrem_by_pow2_23", lrem_by_pow2_23(x), x, 8388608l);
- longCheckRem("lrem_by_pow2_24", lrem_by_pow2_24(x), x, 16777216l);
- longCheckRem("lrem_by_pow2_25", lrem_by_pow2_25(x), x, 33554432l);
- longCheckRem("lrem_by_pow2_26", lrem_by_pow2_26(x), x, 67108864l);
- longCheckRem("lrem_by_pow2_27", lrem_by_pow2_27(x), x, 134217728l);
- longCheckRem("lrem_by_pow2_28", lrem_by_pow2_28(x), x, 268435456l);
- longCheckRem("lrem_by_pow2_29", lrem_by_pow2_29(x), x, 536870912l);
- longCheckRem("lrem_by_pow2_30", lrem_by_pow2_30(x), x, 1073741824l);
- longCheckRem("lrem_by_pow2_31", lrem_by_pow2_31(x), x, 2147483648l);
- longCheckRem("lrem_by_pow2_32", lrem_by_pow2_32(x), x, 4294967296l);
- longCheckRem("lrem_by_pow2_33", lrem_by_pow2_33(x), x, 8589934592l);
- longCheckRem("lrem_by_pow2_34", lrem_by_pow2_34(x), x, 17179869184l);
- longCheckRem("lrem_by_pow2_35", lrem_by_pow2_35(x), x, 34359738368l);
- longCheckRem("lrem_by_pow2_36", lrem_by_pow2_36(x), x, 68719476736l);
- longCheckRem("lrem_by_pow2_37", lrem_by_pow2_37(x), x, 137438953472l);
- longCheckRem("lrem_by_pow2_38", lrem_by_pow2_38(x), x, 274877906944l);
- longCheckRem("lrem_by_pow2_39", lrem_by_pow2_39(x), x, 549755813888l);
- longCheckRem("lrem_by_pow2_40", lrem_by_pow2_40(x), x, 1099511627776l);
- longCheckRem("lrem_by_pow2_41", lrem_by_pow2_41(x), x, 2199023255552l);
- longCheckRem("lrem_by_pow2_42", lrem_by_pow2_42(x), x, 4398046511104l);
- longCheckRem("lrem_by_pow2_43", lrem_by_pow2_43(x), x, 8796093022208l);
- longCheckRem("lrem_by_pow2_44", lrem_by_pow2_44(x), x, 17592186044416l);
- longCheckRem("lrem_by_pow2_45", lrem_by_pow2_45(x), x, 35184372088832l);
- longCheckRem("lrem_by_pow2_46", lrem_by_pow2_46(x), x, 70368744177664l);
- longCheckRem("lrem_by_pow2_47", lrem_by_pow2_47(x), x, 140737488355328l);
- longCheckRem("lrem_by_pow2_48", lrem_by_pow2_48(x), x, 281474976710656l);
- longCheckRem("lrem_by_pow2_49", lrem_by_pow2_49(x), x, 562949953421312l);
- longCheckRem("lrem_by_pow2_50", lrem_by_pow2_50(x), x, 1125899906842624l);
- longCheckRem("lrem_by_pow2_51", lrem_by_pow2_51(x), x, 2251799813685248l);
- longCheckRem("lrem_by_pow2_52", lrem_by_pow2_52(x), x, 4503599627370496l);
- longCheckRem("lrem_by_pow2_53", lrem_by_pow2_53(x), x, 9007199254740992l);
- longCheckRem("lrem_by_pow2_54", lrem_by_pow2_54(x), x, 18014398509481984l);
- longCheckRem("lrem_by_pow2_55", lrem_by_pow2_55(x), x, 36028797018963968l);
- longCheckRem("lrem_by_pow2_56", lrem_by_pow2_56(x), x, 72057594037927936l);
- longCheckRem("lrem_by_pow2_57", lrem_by_pow2_57(x), x, 144115188075855872l);
- longCheckRem("lrem_by_pow2_58", lrem_by_pow2_58(x), x, 288230376151711744l);
- longCheckRem("lrem_by_pow2_59", lrem_by_pow2_59(x), x, 576460752303423488l);
- longCheckRem("lrem_by_pow2_60", lrem_by_pow2_60(x), x, 1152921504606846976l);
- longCheckRem("lrem_by_pow2_61", lrem_by_pow2_61(x), x, 2305843009213693952l);
- longCheckRem("lrem_by_pow2_62", lrem_by_pow2_62(x), x, 4611686018427387904l);
- }
-
- public static void main(String[] args) {
- int i;
- long l;
-
- System.out.println("Begin");
-
- System.out.println("Int: checking some equally spaced dividends...");
- for (i = -1000; i < 1000; i += 300) {
- intCheckAll(i);
- intCheckAll(-i);
- }
-
- System.out.println("Int: checking small dividends...");
- for (i = 1; i < 100; i += 1) {
- intCheckAll(i);
- intCheckAll(-i);
- }
-
- System.out.println("Int: checking big dividends...");
- for (i = 0; i < 100; i += 1) {
- intCheckAll(Integer.MAX_VALUE - i);
- intCheckAll(Integer.MIN_VALUE + i);
- }
-
- System.out.println("Long: checking some equally spaced dividends...");
- for (l = 0l; l < 1000000000000l; l += 300000000000l) {
- longCheckAll(l);
- longCheckAll(-l);
- }
-
- System.out.println("Long: checking small dividends...");
- for (l = 1l; l < 100l; l += 1l) {
- longCheckAll(l);
- longCheckAll(-l);
- }
-
- System.out.println("Long: checking big dividends...");
- for (l = 0l; l < 100l; l += 1l) {
- longCheckAll(Long.MAX_VALUE - l);
- longCheckAll(Long.MIN_VALUE + l);
- }
-
- System.out.println("End");
- }
-}
diff --git a/test/702-LargeBranchOffset/build b/test/702-LargeBranchOffset/build
index eacf730..20030fa 100644
--- a/test/702-LargeBranchOffset/build
+++ b/test/702-LargeBranchOffset/build
@@ -17,11 +17,7 @@
# Stop if something fails.
set -e
-# Write out a bunch of source files.
+# Write out the source file.
cpp -P src/Main.java.in src/Main.java
-mkdir classes
-${JAVAC} -d classes src/*.java
-
-${DX} --debug --dex --output=classes.dex classes
-zip $TEST_NAME.jar classes.dex
+./default-build
diff --git a/test/run-test b/test/run-test
index 239681f..54c6bbd 100755
--- a/test/run-test
+++ b/test/run-test
@@ -501,14 +501,20 @@
if [ '!' -r "$build" ]; then
cp "${progdir}/etc/default-build" build
+else
+ cp "${progdir}/etc/default-build" .
fi
if [ '!' -r "$run" ]; then
cp "${progdir}/etc/default-run" run
+else
+ cp "${progdir}/etc/default-run" .
fi
if [ '!' -r "$check_cmd" ]; then
cp "${progdir}/etc/default-check" check
+else
+ cp "${progdir}/etc/default-check" .
fi
chmod 755 "$build"
diff --git a/tools/checker/README b/tools/checker/README
index 9b23ae9..2763948 100644
--- a/tools/checker/README
+++ b/tools/checker/README
@@ -11,7 +11,7 @@
passes. Each group of check lines therefore must start with a 'CHECK-START'
header which specifies the output group it should be tested against. The group
name must exactly match one of the groups recognized in the output (they can
-be listed with the '--list-groups' command-line flag).
+be listed with the '--list-passes' command-line flag).
Matching of check lines is carried out in the order of appearance in the
source file. There are three types of check lines:
@@ -38,7 +38,7 @@
the invalid regex 'foo{2', but '{{(fo{2})}}' will match 'foo'.
Regex patterns can be named and referenced later. A new variable is defined
-with '[[name:regex]]' and can be referenced with '[[name]]'. Variables are
+with '<<name:regex>>' and can be referenced with '<<name>>'. Variables are
only valid within the scope of the defining group. Within a group they cannot
be redefined or used undefined.
@@ -46,8 +46,8 @@
The following assertions can be placed in a Java source file:
// CHECK-START: int MyClass.MyMethod() constant_folding (after)
- // CHECK: [[ID:i\d+]] IntConstant {{11|22}}
- // CHECK: Return [ [[ID]] ]
+ // CHECK: <<ID:i\d+>> IntConstant {{11|22}}
+ // CHECK: Return [ <<ID>> ]
The engine will attempt to match the check lines against the output of the
group named on the first line. Together they verify that the CFG after
diff --git a/tools/checker/file_format/checker/struct.py b/tools/checker/file_format/checker/struct.py
index 3354cb6..381c92b 100644
--- a/tools/checker/file_format/checker/struct.py
+++ b/tools/checker/file_format/checker/struct.py
@@ -114,8 +114,8 @@
rRegex = r"(.+?)"
rPatternStartSym = r"(\{\{)"
rPatternEndSym = r"(\}\})"
- rVariableStartSym = r"(\[\[)"
- rVariableEndSym = r"(\]\])"
+ rVariableStartSym = r"(<<)"
+ rVariableEndSym = r"(>>)"
rVariableSeparator = r"(:)"
regexPattern = rPatternStartSym + rRegex + rPatternEndSym
diff --git a/tools/checker/file_format/checker/test.py b/tools/checker/file_format/checker/test.py
index 167c888..475e8c3 100644
--- a/tools/checker/file_format/checker/test.py
+++ b/tools/checker/file_format/checker/test.py
@@ -104,10 +104,10 @@
self.assertEqualsPattern("{{a?b.c}}", "a?b.c")
def test_VarRefOnly(self):
- self.assertEqualsVarRef("[[ABC]]", "ABC")
+ self.assertEqualsVarRef("<<ABC>>", "ABC")
def test_VarDefOnly(self):
- self.assertEqualsVarDef("[[ABC:a?b.c]]", "ABC", "a?b.c")
+ self.assertEqualsVarDef("<<ABC:a?b.c>>", "ABC", "a?b.c")
def test_TextWithWhitespace(self):
self.assertEqualsRegex("foo bar", "(foo), (bar)")
@@ -117,7 +117,7 @@
self.assertEqualsRegex("foo{{abc}}bar", "(foo)(abc)(bar)")
def test_TextWithVar(self):
- self.assertEqualsRegex("foo[[ABC:abc]]bar", "(foo)(abc)(bar)")
+ self.assertEqualsRegex("foo<<ABC:abc>>bar", "(foo)(abc)(bar)")
def test_PlainWithRegexAndWhitespaces(self):
self.assertEqualsRegex("foo {{abc}}bar", "(foo), (abc)(bar)")
@@ -125,14 +125,14 @@
self.assertEqualsRegex("foo {{abc}} bar", "(foo), (abc), (bar)")
def test_PlainWithVarAndWhitespaces(self):
- self.assertEqualsRegex("foo [[ABC:abc]]bar", "(foo), (abc)(bar)")
- self.assertEqualsRegex("foo[[ABC:abc]] bar", "(foo)(abc), (bar)")
- self.assertEqualsRegex("foo [[ABC:abc]] bar", "(foo), (abc), (bar)")
+ self.assertEqualsRegex("foo <<ABC:abc>>bar", "(foo), (abc)(bar)")
+ self.assertEqualsRegex("foo<<ABC:abc>> bar", "(foo)(abc), (bar)")
+ self.assertEqualsRegex("foo <<ABC:abc>> bar", "(foo), (abc), (bar)")
def test_AllKinds(self):
- self.assertEqualsRegex("foo [[ABC:abc]]{{def}}bar", "(foo), (abc)(def)(bar)")
- self.assertEqualsRegex("foo[[ABC:abc]] {{def}}bar", "(foo)(abc), (def)(bar)")
- self.assertEqualsRegex("foo [[ABC:abc]] {{def}} bar", "(foo), (abc), (def), (bar)")
+ self.assertEqualsRegex("foo <<ABC:abc>>{{def}}bar", "(foo), (abc)(def)(bar)")
+ self.assertEqualsRegex("foo<<ABC:abc>> {{def}}bar", "(foo)(abc), (def)(bar)")
+ self.assertEqualsRegex("foo <<ABC:abc>> {{def}} bar", "(foo), (abc), (def), (bar)")
# # Test that variables and patterns are parsed correctly
@@ -142,35 +142,35 @@
self.assertEqualsPattern("{{(a{bc})}}", "(a{bc})")
def test_ValidRef(self):
- self.assertEqualsVarRef("[[ABC]]", "ABC")
- self.assertEqualsVarRef("[[A1BC2]]", "A1BC2")
+ self.assertEqualsVarRef("<<ABC>>", "ABC")
+ self.assertEqualsVarRef("<<A1BC2>>", "A1BC2")
def test_ValidDef(self):
- self.assertEqualsVarDef("[[ABC:abc]]", "ABC", "abc")
- self.assertEqualsVarDef("[[ABC:ab:c]]", "ABC", "ab:c")
- self.assertEqualsVarDef("[[ABC:a[b]c]]", "ABC", "a[b]c")
- self.assertEqualsVarDef("[[ABC:(a[bc])]]", "ABC", "(a[bc])")
+ self.assertEqualsVarDef("<<ABC:abc>>", "ABC", "abc")
+ self.assertEqualsVarDef("<<ABC:ab:c>>", "ABC", "ab:c")
+ self.assertEqualsVarDef("<<ABC:a[b]c>>", "ABC", "a[b]c")
+ self.assertEqualsVarDef("<<ABC:(a[bc])>>", "ABC", "(a[bc])")
def test_Empty(self):
self.assertVariantNotEqual("{{}}", RegexExpression.Variant.Pattern)
- self.assertVariantNotEqual("[[]]", RegexExpression.Variant.VarRef)
- self.assertVariantNotEqual("[[:]]", RegexExpression.Variant.VarDef)
+ self.assertVariantNotEqual("<<>>", RegexExpression.Variant.VarRef)
+ self.assertVariantNotEqual("<<:>>", RegexExpression.Variant.VarDef)
def test_InvalidVarName(self):
- self.assertVariantNotEqual("[[0ABC]]", RegexExpression.Variant.VarRef)
- self.assertVariantNotEqual("[[AB=C]]", RegexExpression.Variant.VarRef)
- self.assertVariantNotEqual("[[ABC=]]", RegexExpression.Variant.VarRef)
- self.assertVariantNotEqual("[[0ABC:abc]]", RegexExpression.Variant.VarDef)
- self.assertVariantNotEqual("[[AB=C:abc]]", RegexExpression.Variant.VarDef)
- self.assertVariantNotEqual("[[ABC=:abc]]", RegexExpression.Variant.VarDef)
+ self.assertVariantNotEqual("<<0ABC>>", RegexExpression.Variant.VarRef)
+ self.assertVariantNotEqual("<<AB=C>>", RegexExpression.Variant.VarRef)
+ self.assertVariantNotEqual("<<ABC=>>", RegexExpression.Variant.VarRef)
+ self.assertVariantNotEqual("<<0ABC:abc>>", RegexExpression.Variant.VarDef)
+ self.assertVariantNotEqual("<<AB=C:abc>>", RegexExpression.Variant.VarDef)
+ self.assertVariantNotEqual("<<ABC=:abc>>", RegexExpression.Variant.VarDef)
def test_BodyMatchNotGreedy(self):
self.assertEqualsRegex("{{abc}}{{def}}", "(abc)(def)")
- self.assertEqualsRegex("[[ABC:abc]][[DEF:def]]", "(abc)(def)")
+ self.assertEqualsRegex("<<ABC:abc>><<DEF:def>>", "(abc)(def)")
def test_NoVarDefsInNotChecks(self):
with self.assertRaises(CheckerException):
- self.parseAssertion("[[ABC:abc]]", "-NOT")
+ self.parseAssertion("<<ABC:abc>>", "-NOT")
class CheckerParser_FileLayoutTest(unittest.TestCase):
diff --git a/tools/checker/match/file.py b/tools/checker/match/file.py
index d9da690..2ed4aa7 100644
--- a/tools/checker/match/file.py
+++ b/tools/checker/match/file.py
@@ -141,7 +141,7 @@
c1Pass = c1File.findPass(testCase.name)
if c1Pass is None:
Logger.fail("Test case \"" + testCase.name + "\" not found in the C1visualizer output",
- testCase.fileName, testCase.lineNo)
+ testCase.fileName, testCase.startLineNo)
Logger.startTest(testCase.name)
__matchGroups(testCase, c1Pass)
Logger.testPassed()
diff --git a/tools/checker/match/test.py b/tools/checker/match/test.py
index 62e8e00..bb3b1af 100644
--- a/tools/checker/match/test.py
+++ b/tools/checker/match/test.py
@@ -58,40 +58,40 @@
self.assertFalse(self.matches("foo{{A|B}}bar", "fooCbar"))
def test_VariableReference(self):
- self.assertTrue(self.matches("foo[[X]]bar", "foobar", {"X": ""}))
- self.assertTrue(self.matches("foo[[X]]bar", "fooAbar", {"X": "A"}))
- self.assertTrue(self.matches("foo[[X]]bar", "fooBbar", {"X": "B"}))
- self.assertFalse(self.matches("foo[[X]]bar", "foobar", {"X": "A"}))
- self.assertFalse(self.matches("foo[[X]]bar", "foo bar", {"X": "A"}))
+ self.assertTrue(self.matches("foo<<X>>bar", "foobar", {"X": ""}))
+ self.assertTrue(self.matches("foo<<X>>bar", "fooAbar", {"X": "A"}))
+ self.assertTrue(self.matches("foo<<X>>bar", "fooBbar", {"X": "B"}))
+ self.assertFalse(self.matches("foo<<X>>bar", "foobar", {"X": "A"}))
+ self.assertFalse(self.matches("foo<<X>>bar", "foo bar", {"X": "A"}))
with self.assertRaises(CheckerException):
- self.assertTrue(self.matches("foo[[X]]bar", "foobar", {}))
+ self.assertTrue(self.matches("foo<<X>>bar", "foobar", {}))
def test_VariableDefinition(self):
- self.assertTrue(self.matches("foo[[X:A|B]]bar", "fooAbar"))
- self.assertTrue(self.matches("foo[[X:A|B]]bar", "fooBbar"))
- self.assertFalse(self.matches("foo[[X:A|B]]bar", "fooCbar"))
+ self.assertTrue(self.matches("foo<<X:A|B>>bar", "fooAbar"))
+ self.assertTrue(self.matches("foo<<X:A|B>>bar", "fooBbar"))
+ self.assertFalse(self.matches("foo<<X:A|B>>bar", "fooCbar"))
- env = self.tryMatch("foo[[X:A.*B]]bar", "fooABbar", {})
+ env = self.tryMatch("foo<<X:A.*B>>bar", "fooABbar", {})
self.assertEqual(env, {"X": "AB"})
- env = self.tryMatch("foo[[X:A.*B]]bar", "fooAxxBbar", {})
+ env = self.tryMatch("foo<<X:A.*B>>bar", "fooAxxBbar", {})
self.assertEqual(env, {"X": "AxxB"})
- self.assertTrue(self.matches("foo[[X:A|B]]bar[[X]]baz", "fooAbarAbaz"))
- self.assertTrue(self.matches("foo[[X:A|B]]bar[[X]]baz", "fooBbarBbaz"))
- self.assertFalse(self.matches("foo[[X:A|B]]bar[[X]]baz", "fooAbarBbaz"))
+ self.assertTrue(self.matches("foo<<X:A|B>>bar<<X>>baz", "fooAbarAbaz"))
+ self.assertTrue(self.matches("foo<<X:A|B>>bar<<X>>baz", "fooBbarBbaz"))
+ self.assertFalse(self.matches("foo<<X:A|B>>bar<<X>>baz", "fooAbarBbaz"))
def test_NoVariableRedefinition(self):
with self.assertRaises(CheckerException):
- self.matches("[[X:...]][[X]][[X:...]][[X]]", "foofoobarbar")
+ self.matches("<<X:...>><<X>><<X:...>><<X>>", "foofoobarbar")
def test_EnvNotChangedOnPartialMatch(self):
env = {"Y": "foo"}
- self.assertFalse(self.matches("[[X:A]]bar", "Abaz", env))
+ self.assertFalse(self.matches("<<X:A>>bar", "Abaz", env))
self.assertFalse("X" in env.keys())
def test_VariableContentEscaped(self):
- self.assertTrue(self.matches("[[X:..]]foo[[X]]", ".*foo.*"))
- self.assertFalse(self.matches("[[X:..]]foo[[X]]", ".*fooAAAA"))
+ self.assertTrue(self.matches("<<X:..>>foo<<X>>", ".*foo.*"))
+ self.assertFalse(self.matches("<<X:..>>foo<<X>>", ".*fooAAAA"))
class MatchFiles_Test(unittest.TestCase):
@@ -133,8 +133,8 @@
def test_Variables(self):
self.assertTrue(self.matches(
"""
- // CHECK: foo[[X:.]]bar
- // CHECK: abc[[X]]def
+ // CHECK: foo<<X:.>>bar
+ // CHECK: abc<<X>>def
""",
"""
foo bar
@@ -142,9 +142,9 @@
"""))
self.assertTrue(self.matches(
"""
- // CHECK: foo[[X:([0-9]+)]]bar
- // CHECK: abc[[X]]def
- // CHECK: ### [[X]] ###
+ // CHECK: foo<<X:([0-9]+)>>bar
+ // CHECK: abc<<X>>def
+ // CHECK: ### <<X>> ###
""",
"""
foo1234bar
@@ -153,8 +153,8 @@
"""))
self.assertFalse(self.matches(
"""
- // CHECK: foo[[X:([0-9]+)]]bar
- // CHECK: abc[[X]]def
+ // CHECK: foo<<X:([0-9]+)>>bar
+ // CHECK: abc<<X>>def
""",
"""
foo1234bar