Commit 45f7700f by Jim Stichnoth

Subzero: Fix a cleanup error after the IceString removal CL.

This corrects a "cleanup" mistake in line 414/417 of https://codereview.chromium.org/1838753002/diff/120001/src/IceTargetLoweringX8664.cpp . This wasn't caught before because "make presubmit" doesn't run any sandboxed x86-64 tests. So we add that to the presubmit script. In addition, the "make check-spec" is changed to run each spec component via the "--run" flag of szbuild_spec2k.py. Otherwise, the makefile was hard-coding running the native binary setup instead of the sandboxed or nonsfi setup. BUG= none R=jpp@chromium.org Review URL: https://codereview.chromium.org/1852713004 .
parent a3984a12
......@@ -570,12 +570,10 @@ ifeq ($(TARGET),arm32)
SPEC := --filetype=obj
endif
SPECFLAGS := -O2
SPECBUILDONLY := false
SPECRUN := --run
%.spec2k: % $(OBJDIR)/pnacl-sz make_symlink runtime
./pydir/szbuild_spec2k.py -v \
$(SPECFLAGS) --target=$(TARGETFLAG) $(SPEC) $<
$(SPECBUILDONLY) || ( cd ../../../tests/spec2k; \
./run_all.sh RunTimedBenchmarks $(SETUP) train $< )
$(SPECFLAGS) --target=$(TARGETFLAG) $(SPEC) $< $(SPECRUN)
check-spec: exists-spec $(ALLSPEC:=.spec2k)
......@@ -639,12 +637,15 @@ check-presubmit presubmit: exists-nonsfi-x8632 exists-nonsfi-arm32 \
# Run spec2k/x86-64.
+make -f Makefile.standalone \
TARGET=x8664 check-spec
# Run spec2k/x86-64 with sandboxing.
+make -f Makefile.standalone \
SPECFLAGS='-O2 --sandbox' TARGET=x8664 check-spec
# Build spec2k under -Om1/x86-32, to check for liveness errors.
+make -f Makefile.standalone \
SPECFLAGS='-Om1' SPECBUILDONLY=true check-spec
SPECFLAGS='-Om1' SPECRUN= check-spec
# Build spec2k under -Om1/x86-64, to check for liveness errors.
+make -f Makefile.standalone \
SPECFLAGS='-Om1' TARGET=x8664 SPECBUILDONLY=true check-spec
SPECFLAGS='-Om1' TARGET=x8664 SPECRUN= check-spec
# Run spec2k for x86-32 without advanced phi lowering.
+make -f Makefile.standalone \
SPECFLAGS='-O2 --sz=--phi-edge-split=0' check-spec
......@@ -656,10 +657,10 @@ check-presubmit presubmit: exists-nonsfi-x8632 exists-nonsfi-arm32 \
FORCEASM=1 check-xtest check-lit
# Build spec2k for arm32.
+make -f Makefile.standalone \
TARGET=arm32 SPECBUILDONLY=true check-spec
TARGET=arm32 SPECRUN= check-spec
# Build spec2k under -Om1/arm32.
+make -f Makefile.standalone \
TARGET=arm32 SPECFLAGS='-Om1' SPECBUILDONLY=true check-spec
TARGET=arm32 SPECFLAGS='-Om1' SPECRUN= check-spec
# Run a few spec2k tests for arm32 using qemu. Keep the list sorted in
# roughly reverse order of runtime.
+make -f Makefile.standalone \
......@@ -687,10 +688,10 @@ presubmit-lite: exists-nonsfi-x8632 exists-nonsfi-arm32 \
TARGET=x8664 check-spec
# Build spec2k under -Om1/x86-32, to check for liveness errors.
+make -f Makefile.standalone \
SPECFLAGS='-Om1' SPECBUILDONLY=true check-spec
SPECFLAGS='-Om1' SPECRUN= check-spec
# Build spec2k under -Om1/x86-64, to check for liveness errors.
+make -f Makefile.standalone \
SPECFLAGS='-Om1' TARGET=x8664 SPECBUILDONLY=true check-spec
SPECFLAGS='-Om1' TARGET=x8664 SPECRUN= check-spec
# Run cross tests and lit tests to validate filetype=asm output.
+make -f Makefile.standalone \
FORCEASM=1 check-lit
......@@ -698,7 +699,7 @@ presubmit-lite: exists-nonsfi-x8632 exists-nonsfi-arm32 \
FORCEASM=1 check-xtest-lite
# Build spec2k under -Om1/arm32.
+make -f Makefile.standalone \
TARGET=arm32 SPECFLAGS='-Om1' SPECBUILDONLY=true check-spec
TARGET=arm32 SPECFLAGS='-Om1' SPECRUN= check-spec
# Run a few spec2k tests for arm32 using qemu. Keep the list sorted in
# roughly reverse order of runtime.
+make -f Makefile.standalone \
......
......@@ -406,15 +406,15 @@ Traits::X86OperandMem *TargetX8664::_sandbox_mem_reference(X86OperandMem *Mem) {
}
}
// NeedsLea is a flags indicating whether Mem needs to be materialized to a
// GPR prior to being used. A LEA is needed if Mem.Offset is a constant
// NeedsLea is a flag indicating whether Mem needs to be materialized to a GPR
// prior to being used. A LEA is needed if Mem.Offset is a constant
// relocatable, or if Mem.Offset is negative. In both these cases, the LEA is
// needed to ensure the sandboxed memory operand will only use the lower
// 32-bits of T+Offset.
bool NeedsLea = false;
if (Offset != nullptr) {
if (const auto *CR = llvm::dyn_cast<ConstantRelocatable>(Offset)) {
NeedsLea = CR->getOffset() < 0;
if (llvm::isa<ConstantRelocatable>(Offset)) {
NeedsLea = true;
} else if (const auto *Imm = llvm::dyn_cast<ConstantInteger32>(Offset)) {
NeedsLea = Imm->getValue() < 0;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment