WebKit Bugzilla
Attachment 362096 Details for
Bug 194637
: testb3 and testair should test O0/O1/O2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP
patch.diff (text/plain), 25.36 KB, created by
Saam Barati
on 2019-02-14 22:41:21 PST
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Saam Barati
Created:
2019-02-14 22:41:21 PST
Size:
25.36 KB
patch
obsolete
>Index: Source/JavaScriptCore/b3/testb3.cpp >=================================================================== >--- Source/JavaScriptCore/b3/testb3.cpp (revision 241576) >+++ Source/JavaScriptCore/b3/testb3.cpp (working copy) >@@ -3534,7 +3534,7 @@ void testBitNotOnBooleanAndBranch32(int6 > root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1)); > Value* argsAreEqual = root->appendNew<Value>(proc, Equal, Origin(), arg1, arg2); > Value* argsAreNotEqual = root->appendNew<Value>(proc, BitXor, Origin(), >- root->appendNew<Const32Value>(proc, Origin(), -1), >+ root->appendNew<Const32Value>(proc, Origin(), 1), > argsAreEqual); > > root->appendNewControlValue( >@@ -8257,6 +8257,13 @@ void testSimplePatchpointWithOuputClobbe > // spill everything else. > > Procedure proc; >+ if (proc.optLevel() < 1) { >+ // FIXME: Air O0 allocator can't handle such programs. We rely on WasmAirIRGenerator >+ // to not use any such constructs where the register allocator is cornered in such >+ // a way. >+ // https://bugs.webkit.org/show_bug.cgi?id=194633 >+ return; >+ } > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); > Value* arg2 = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1); >@@ -8330,6 +8337,13 @@ void testSimplePatchpointWithoutOuputClo > void testSimplePatchpointWithOuputClobbersFPArgs() > { > Procedure proc; >+ if (proc.optLevel() < 1) { >+ // FIXME: Air O0 allocator can't handle such programs. We rely on WasmAirIRGenerator >+ // to not use any such constructs where the register allocator is cornered in such >+ // a way. >+ // https://bugs.webkit.org/show_bug.cgi?id=194633 >+ return; >+ } > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<ArgumentRegValue>(proc, Origin(), FPRInfo::argumentFPR0); > Value* arg2 = root->appendNew<ArgumentRegValue>(proc, Origin(), FPRInfo::argumentFPR1); >@@ -8380,10 +8394,13 @@ void testPatchpointWithEarlyClobber() > patchpoint->append(ConstrainedValue(arg1, ValueRep::SomeRegister)); > patchpoint->append(ConstrainedValue(arg2, ValueRep::SomeRegister)); > patchpoint->clobberEarly(RegisterSet(registerToClobber)); >+ unsigned optLevel = proc.optLevel(); > patchpoint->setGenerator( > [&] (CCallHelpers& jit, const StackmapGenerationParams& params) { >- CHECK((params[1].gpr() == GPRInfo::argumentGPR0) == arg1InArgGPR); >- CHECK((params[2].gpr() == GPRInfo::argumentGPR1) == arg2InArgGPR); >+ if (optLevel > 0) { >+ CHECK((params[1].gpr() == GPRInfo::argumentGPR0) == arg1InArgGPR); >+ CHECK((params[2].gpr() == GPRInfo::argumentGPR1) == arg2InArgGPR); >+ } > > add32(jit, params[1].gpr(), params[2].gpr(), params[0].gpr()); > }); >@@ -8719,6 +8736,8 @@ void testPatchpointWithAnyResult() > void testSimpleCheck() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); > CheckValue* check = root->appendNew<CheckValue>(proc, Check, Origin(), arg); >@@ -8748,9 +8767,11 @@ void testCheckFalse() > BasicBlock* root = proc.addBlock(); > CheckValue* check = root->appendNew<CheckValue>( > proc, Check, Origin(), root->appendNew<Const32Value>(proc, Origin(), 0)); >+ unsigned optLevel = proc.optLevel(); > check->setGenerator( > [&] (CCallHelpers&, const StackmapGenerationParams&) { >- CHECK(!"This should not have executed"); >+ if (optLevel > 1) >+ CHECK(!"This should not have executed"); > }); > root->appendNewControlValue( > proc, Return, Origin(), root->appendNew<Const32Value>(proc, Origin(), 0)); >@@ -8763,13 +8784,17 @@ void testCheckFalse() > void testCheckTrue() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > CheckValue* check = root->appendNew<CheckValue>( > proc, Check, Origin(), root->appendNew<Const32Value>(proc, Origin(), 1)); >+ unsigned optLevel = proc.optLevel(); > check->setGenerator( > [&] (CCallHelpers& jit, const StackmapGenerationParams& params) { > AllowMacroScratchRegisterUsage allowScratch(jit); >- CHECK(params.value()->opcode() == Patchpoint); >+ if (optLevel > 1) >+ CHECK(params.value()->opcode() == Patchpoint); > CHECK(!params.size()); > > // This should always work because a function this simple should never have callee >@@ -8789,6 +8814,8 @@ void testCheckTrue() > void testCheckLessThan() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg = root->appendNew<Value>( > proc, Trunc, Origin(), >@@ -8824,6 +8851,8 @@ void testCheckLessThan() > void testCheckMegaCombo() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* base = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); > Value* index = root->appendNew<Value>( >@@ -8876,6 +8905,8 @@ void testCheckMegaCombo() > void testCheckTrickyMegaCombo() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* base = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); > Value* index = root->appendNew<Value>( >@@ -8931,6 +8962,8 @@ void testCheckTrickyMegaCombo() > void testCheckTwoMegaCombos() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* base = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); > Value* index = root->appendNew<Value>( >@@ -8995,6 +9028,8 @@ void testCheckTwoMegaCombos() > void testCheckTwoNonRedundantMegaCombos() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > > BasicBlock* root = proc.addBlock(); > BasicBlock* thenCase = proc.addBlock(); >@@ -9088,6 +9123,8 @@ void testCheckTwoNonRedundantMegaCombos( > void testCheckAddImm() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Value>( > proc, Trunc, Origin(), >@@ -9124,6 +9161,8 @@ void testCheckAddImm() > void testCheckAddImmCommute() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Value>( > proc, Trunc, Origin(), >@@ -9160,6 +9199,8 @@ void testCheckAddImmCommute() > void testCheckAddImmSomeRegister() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Value>( > proc, Trunc, Origin(), >@@ -9195,6 +9236,8 @@ void testCheckAddImmSomeRegister() > void testCheckAdd() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Value>( > proc, Trunc, Origin(), >@@ -9232,6 +9275,8 @@ void testCheckAdd() > void testCheckAdd64() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); > Value* arg2 = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1); >@@ -9269,9 +9314,11 @@ void testCheckAddFold(int a, int b) > Value* arg1 = root->appendNew<Const32Value>(proc, Origin(), a); > Value* arg2 = root->appendNew<Const32Value>(proc, Origin(), b); > CheckValue* checkAdd = root->appendNew<CheckValue>(proc, CheckAdd, Origin(), arg1, arg2); >+ unsigned optLevel = proc.optLevel(); > checkAdd->setGenerator( > [&] (CCallHelpers&, const StackmapGenerationParams&) { >- CHECK(!"Should have been folded"); >+ if (optLevel > 1) >+ CHECK(!"Should have been folded"); > }); > root->appendNewControlValue(proc, Return, Origin(), checkAdd); > >@@ -9283,6 +9330,8 @@ void testCheckAddFold(int a, int b) > void testCheckAddFoldFail(int a, int b) > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Const32Value>(proc, Origin(), a); > Value* arg2 = root->appendNew<Const32Value>(proc, Origin(), b); >@@ -9384,6 +9433,8 @@ void testCheckAddArgumentAliasing32() > void testCheckAddSelfOverflow64() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); > CheckValue* checkAdd = root->appendNew<CheckValue>(proc, CheckAdd, Origin(), arg, arg); >@@ -9413,6 +9464,8 @@ void testCheckAddSelfOverflow64() > void testCheckAddSelfOverflow32() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg = root->appendNew<Value>( > proc, Trunc, Origin(), >@@ -9444,6 +9497,8 @@ void testCheckAddSelfOverflow32() > void testCheckSubImm() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Value>( > proc, Trunc, Origin(), >@@ -9480,6 +9535,8 @@ void testCheckSubImm() > void testCheckSubBadImm() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Value>( > proc, Trunc, Origin(), >@@ -9522,6 +9579,8 @@ void testCheckSubBadImm() > void testCheckSub() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Value>( > proc, Trunc, Origin(), >@@ -9564,6 +9623,8 @@ NEVER_INLINE double doubleSub(double a, > void testCheckSub64() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); > Value* arg2 = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1); >@@ -9601,9 +9662,11 @@ void testCheckSubFold(int a, int b) > Value* arg1 = root->appendNew<Const32Value>(proc, Origin(), a); > Value* arg2 = root->appendNew<Const32Value>(proc, Origin(), b); > CheckValue* checkSub = root->appendNew<CheckValue>(proc, CheckSub, Origin(), arg1, arg2); >+ unsigned optLevel = proc.optLevel(); > checkSub->setGenerator( > [&] (CCallHelpers&, const StackmapGenerationParams&) { >- CHECK(!"Should have been folded"); >+ if (optLevel > 1) >+ CHECK(!"Should have been folded"); > }); > root->appendNewControlValue(proc, Return, Origin(), checkSub); > >@@ -9615,6 +9678,8 @@ void testCheckSubFold(int a, int b) > void testCheckSubFoldFail(int a, int b) > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Const32Value>(proc, Origin(), a); > Value* arg2 = root->appendNew<Const32Value>(proc, Origin(), b); >@@ -9636,6 +9701,8 @@ void testCheckSubFoldFail(int a, int b) > void testCheckNeg() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Const32Value>(proc, Origin(), 0); > Value* arg2 = root->appendNew<Value>( >@@ -9668,6 +9735,8 @@ void testCheckNeg() > void testCheckNeg64() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Const64Value>(proc, Origin(), 0); > Value* arg2 = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); >@@ -9698,6 +9767,8 @@ void testCheckNeg64() > void testCheckMul() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Value>( > proc, Trunc, Origin(), >@@ -9735,6 +9806,8 @@ void testCheckMul() > void testCheckMulMemory() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > > int left; >@@ -9787,6 +9860,8 @@ void testCheckMulMemory() > void testCheckMul2() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Value>( > proc, Trunc, Origin(), >@@ -9823,6 +9898,8 @@ void testCheckMul2() > void testCheckMul64() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR0); > Value* arg2 = root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1); >@@ -9860,9 +9937,11 @@ void testCheckMulFold(int a, int b) > Value* arg1 = root->appendNew<Const32Value>(proc, Origin(), a); > Value* arg2 = root->appendNew<Const32Value>(proc, Origin(), b); > CheckValue* checkMul = root->appendNew<CheckValue>(proc, CheckMul, Origin(), arg1, arg2); >+ unsigned optLevel = proc.optLevel(); > checkMul->setGenerator( > [&] (CCallHelpers&, const StackmapGenerationParams&) { >- CHECK(!"Should have been folded"); >+ if (optLevel > 1) >+ CHECK(!"Should have been folded"); > }); > root->appendNewControlValue(proc, Return, Origin(), checkMul); > >@@ -9874,6 +9953,8 @@ void testCheckMulFold(int a, int b) > void testCheckMulFoldFail(int a, int b) > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Const32Value>(proc, Origin(), a); > Value* arg2 = root->appendNew<Const32Value>(proc, Origin(), b); >@@ -9975,6 +10056,8 @@ void testCheckMulArgumentAliasing32() > void testCheckMul64SShr() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > Value* arg1 = root->appendNew<Value>( > proc, SShr, Origin(), >@@ -12180,6 +12263,8 @@ void testSelectInvert() > void testCheckSelect() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > > CheckValue* check = root->appendNew<CheckValue>( >@@ -12222,6 +12307,8 @@ void testCheckSelect() > void testCheckSelectCheckSelect() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > > CheckValue* check = root->appendNew<CheckValue>( >@@ -12295,6 +12382,8 @@ void testCheckSelectCheckSelect() > void testCheckSelectAndCSE() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > BasicBlock* root = proc.addBlock(); > > auto* selectValue = root->appendNew<Value>( >@@ -13029,6 +13118,13 @@ void testSpillUseLargerThanDef() > void testLateRegister() > { > Procedure proc; >+ >+ if (!proc.optLevel()) { >+ // FIXME: Make O0 handle such situations: >+ // https://bugs.webkit.org/show_bug.cgi?id=194633 >+ return; >+ } >+ > BasicBlock* root = proc.addBlock(); > > // This works by making all but 1 register be input to the first patchpoint as LateRegister. >@@ -13340,6 +13436,8 @@ void testInterpreter() > void testReduceStrengthCheckBottomUseInAnotherBlock() > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > > BasicBlock* one = proc.addBlock(); > BasicBlock* two = proc.addBlock(); >@@ -13782,12 +13880,15 @@ void testSomeEarlyRegister() > if (succeed) > patchpoint->resultConstraint = ValueRep::SomeEarlyRegister; > bool ranSecondPatchpoint = false; >+ unsigned optLevel = proc.optLevel(); > patchpoint->setGenerator( > [&] (CCallHelpers&, const StackmapGenerationParams& params) { > if (succeed) > CHECK(params[0].gpr() != params[1].gpr()); >- else >- CHECK(params[0].gpr() == params[1].gpr()); >+ else { >+ if (optLevel > 1) >+ CHECK(params[0].gpr() == params[1].gpr()); >+ } > ranSecondPatchpoint = true; > }); > >@@ -14372,9 +14473,11 @@ void testPinRegisters() > a, b, c); > PatchpointValue* patchpoint = root->appendNew<PatchpointValue>(proc, Void, Origin()); > patchpoint->appendSomeRegister(d); >+ unsigned optLevel = proc.optLevel(); > patchpoint->setGenerator( > [&] (CCallHelpers&, const StackmapGenerationParams& params) { >- CHECK_EQ(params[0].gpr(), GPRInfo::regCS0); >+ if (optLevel > 1) >+ CHECK_EQ(params[0].gpr(), GPRInfo::regCS0); > }); > root->appendNew<Value>(proc, Return, Origin()); > auto code = compileProc(proc); >@@ -14390,6 +14493,11 @@ void testPinRegisters() > }); > } > } >+ if (proc.optLevel() < 2) { >+ // Our less good register allocators may use the >+ // pinned CSRs in a move. >+ usesCSRs = false; >+ } > for (const RegisterAtOffset& regAtOffset : proc.calleeSaveRegisterAtOffsetList()) > usesCSRs |= csrs.get(regAtOffset.reg()); > CHECK_EQ(usesCSRs, !pin); >@@ -14417,7 +14525,10 @@ void testX86LeaAddAddShlLeft() > root->appendNew<Value>(proc, Return, Origin(), result); > > auto code = compileProc(proc); >- checkUsesInstruction(*code, "lea 0x64(%rdi,%rsi,4), %rax"); >+ if (proc.optLevel() > 1) >+ checkUsesInstruction(*code, "lea 0x64(%rdi,%rsi,4), %rax"); >+ else >+ checkUsesInstruction(*code, "lea"); > CHECK_EQ(invoke<intptr_t>(*code, 1, 2), (1 + (2 << 2)) + 100); > } > >@@ -14439,7 +14550,10 @@ void testX86LeaAddAddShlRight() > root->appendNew<Value>(proc, Return, Origin(), result); > > auto code = compileProc(proc); >- checkUsesInstruction(*code, "lea 0x64(%rdi,%rsi,4), %rax"); >+ if (proc.optLevel() > 1) >+ checkUsesInstruction(*code, "lea 0x64(%rdi,%rsi,4), %rax"); >+ else >+ checkUsesInstruction(*code, "lea"); > CHECK_EQ(invoke<intptr_t>(*code, 1, 2), (1 + (2 << 2)) + 100); > } > >@@ -14459,13 +14573,15 @@ void testX86LeaAddAdd() > > auto code = compileProc(proc); > CHECK_EQ(invoke<intptr_t>(*code, 1, 2), (1 + 2) + 100); >- checkDisassembly( >- *code, >- [&] (const char* disassembly) -> bool { >- return strstr(disassembly, "lea 0x64(%rdi,%rsi), %rax") >- || strstr(disassembly, "lea 0x64(%rsi,%rdi), %rax"); >- }, >- "Expected to find something like lea 0x64(%rdi,%rsi), %rax but didn't!"); >+ if (proc.optLevel() > 1) { >+ checkDisassembly( >+ *code, >+ [&] (const char* disassembly) -> bool { >+ return strstr(disassembly, "lea 0x64(%rdi,%rsi), %rax") >+ || strstr(disassembly, "lea 0x64(%rsi,%rdi), %rax"); >+ }, >+ "Expected to find something like lea 0x64(%rdi,%rsi), %rax but didn't!"); >+ } > } > > void testX86LeaAddShlRight() >@@ -14483,7 +14599,10 @@ void testX86LeaAddShlRight() > root->appendNew<Value>(proc, Return, Origin(), result); > > auto code = compileProc(proc); >- checkUsesInstruction(*code, "lea (%rdi,%rsi,4), %rax"); >+ if (proc.optLevel() > 1) >+ checkUsesInstruction(*code, "lea (%rdi,%rsi,4), %rax"); >+ else >+ checkUsesInstruction(*code, "lea"); > CHECK_EQ(invoke<intptr_t>(*code, 1, 2), 1 + (2 << 2)); > } > >@@ -14503,13 +14622,15 @@ void testX86LeaAddShlLeftScale1() > > auto code = compileProc(proc); > CHECK_EQ(invoke<intptr_t>(*code, 1, 2), 1 + 2); >- checkDisassembly( >- *code, >- [&] (const char* disassembly) -> bool { >- return strstr(disassembly, "lea (%rdi,%rsi), %rax") >- || strstr(disassembly, "lea (%rsi,%rdi), %rax"); >- }, >- "Expected to find something like lea (%rdi,%rsi), %rax but didn't!"); >+ if (proc.optLevel() > 1) { >+ checkDisassembly( >+ *code, >+ [&] (const char* disassembly) -> bool { >+ return strstr(disassembly, "lea (%rdi,%rsi), %rax") >+ || strstr(disassembly, "lea (%rsi,%rdi), %rax"); >+ }, >+ "Expected to find something like lea (%rdi,%rsi), %rax but didn't!"); >+ } > } > > void testX86LeaAddShlLeftScale2() >@@ -14527,7 +14648,10 @@ void testX86LeaAddShlLeftScale2() > root->appendNew<Value>(proc, Return, Origin(), result); > > auto code = compileProc(proc); >- checkUsesInstruction(*code, "lea (%rdi,%rsi,2), %rax"); >+ if (proc.optLevel() > 1) >+ checkUsesInstruction(*code, "lea (%rdi,%rsi,2), %rax"); >+ else >+ checkUsesInstruction(*code, "lea"); > CHECK_EQ(invoke<intptr_t>(*code, 1, 2), 1 + (2 << 1)); > } > >@@ -14546,7 +14670,10 @@ void testX86LeaAddShlLeftScale4() > root->appendNew<Value>(proc, Return, Origin(), result); > > auto code = compileProc(proc); >- checkUsesInstruction(*code, "lea (%rdi,%rsi,4), %rax"); >+ if (proc.optLevel() > 1) >+ checkUsesInstruction(*code, "lea (%rdi,%rsi,4), %rax"); >+ else >+ checkUsesInstruction(*code, "lea"); > CHECK_EQ(invoke<intptr_t>(*code, 1, 2), 1 + (2 << 2)); > } > >@@ -14565,7 +14692,10 @@ void testX86LeaAddShlLeftScale8() > root->appendNew<Value>(proc, Return, Origin(), result); > > auto code = compileProc(proc); >- checkUsesInstruction(*code, "lea (%rdi,%rsi,8), %rax"); >+ if (proc.optLevel() > 1) >+ checkUsesInstruction(*code, "lea (%rdi,%rsi,8), %rax"); >+ else >+ checkUsesInstruction(*code, "lea"); > CHECK_EQ(invoke<intptr_t>(*code, 1, 2), 1 + (2 << 3)); > } > >@@ -14684,7 +14814,7 @@ void testLoadBaseIndexShift2() > root->appendNew<ArgumentRegValue>(proc, Origin(), GPRInfo::argumentGPR1), > root->appendNew<Const32Value>(proc, Origin(), 2))))); > auto code = compileProc(proc); >- if (isX86()) >+ if (isX86() && proc.optLevel() > 1) > checkUsesInstruction(*code, "(%rdi,%rsi,4)"); > int32_t value = 12341234; > char* ptr = bitwise_cast<char*>(&value); >@@ -14719,6 +14849,9 @@ void testLoadBaseIndexShift32() > void testOptimizeMaterialization() > { > Procedure proc; >+ if (proc.optLevel() < 2) >+ return; >+ > BasicBlock* root = proc.addBlock(); > root->appendNew<CCallValue>( > proc, Void, Origin(), >@@ -14847,6 +14980,10 @@ static void noOpFunction() > void testLICMPure() > { > Procedure proc; >+ >+ if (proc.optLevel() < 2) >+ return; >+ > generateLoop( > proc, > [&] (BasicBlock* loop, Value*) -> Value* { >@@ -14864,6 +15001,8 @@ void testLICMPure() > void testLICMPureSideExits() > { > Procedure proc; >+ if (proc.optLevel() < 2) >+ return; > generateLoop( > proc, > [&] (BasicBlock* loop, Value*) -> Value* { >@@ -14887,6 +15026,8 @@ void testLICMPureSideExits() > void testLICMPureWritesPinned() > { > Procedure proc; >+ if (proc.optLevel() < 2) >+ return; > generateLoop( > proc, > [&] (BasicBlock* loop, Value*) -> Value* { >@@ -14910,6 +15051,8 @@ void testLICMPureWritesPinned() > void testLICMPureWrites() > { > Procedure proc; >+ if (proc.optLevel() < 2) >+ return; > generateLoop( > proc, > [&] (BasicBlock* loop, Value*) -> Value* { >@@ -14952,6 +15095,8 @@ void testLICMReadsLocalState() > void testLICMReadsPinned() > { > Procedure proc; >+ if (proc.optLevel() < 2) >+ return; > generateLoop( > proc, > [&] (BasicBlock* loop, Value*) -> Value* { >@@ -14971,6 +15116,8 @@ void testLICMReadsPinned() > void testLICMReads() > { > Procedure proc; >+ if (proc.optLevel() < 2) >+ return; > generateLoop( > proc, > [&] (BasicBlock* loop, Value*) -> Value* { >@@ -14990,6 +15137,8 @@ void testLICMReads() > void testLICMPureNotBackwardsDominant() > { > Procedure proc; >+ if (proc.optLevel() < 2) >+ return; > auto array = makeArrayForLoops(); > generateLoopNotBackwardsDominant( > proc, array, >@@ -15026,6 +15175,8 @@ void testLICMPureFoiledByChild() > void testLICMPureNotBackwardsDominantFoiledByChild() > { > Procedure proc; >+ if (proc.optLevel() < 2) >+ return; > auto array = makeArrayForLoops(); > generateLoopNotBackwardsDominant( > proc, array, >@@ -15140,6 +15291,8 @@ void testLICMWritesPinned() > void testLICMControlDependent() > { > Procedure proc; >+ if (proc.optLevel() < 2) >+ return; > generateLoop( > proc, > [&] (BasicBlock* loop, Value*) -> Value* { >@@ -15159,6 +15312,8 @@ void testLICMControlDependent() > void testLICMControlDependentNotBackwardsDominant() > { > Procedure proc; >+ if (proc.optLevel() < 2) >+ return; > auto array = makeArrayForLoops(); > generateLoopNotBackwardsDominant( > proc, array, >@@ -15229,6 +15384,8 @@ void testLICMReadsPinnedWritesPinned() > void testLICMReadsWritesDifferentHeaps() > { > Procedure proc; >+ if (proc.optLevel() < 2) >+ return; > generateLoop( > proc, > [&] (BasicBlock* loop, Value*) -> Value* { >@@ -16010,6 +16167,8 @@ void testDepend64() > void testWasmBoundsCheck(unsigned offset) > { > Procedure proc; >+ if (proc.optLevel() < 1) >+ return; > GPRReg pinned = GPRInfo::argumentGPR1; > proc.pinRegister(pinned); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194637
:
362096
|
362242
|
362253