Commit 59f2d925 by John Porto

Subzero. Misc fixes.

This CL disables the X86 assembler tests by default. They take too long to compile, so there's very little point in running them with the other unittests. This CL fixes a bug introduced in https://codereview.chromium.org/1260163003/ that caused liveness analysis to assert due to a uninitialized Variable. BUG= R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/1266863002.
parent 28068adb
......@@ -221,8 +221,12 @@ SB_OBJS=$(patsubst %.cpp, $(SB_OBJDIR)/%.o, $(SRCS))
UNITTEST_SRCS = \
BitcodeMunge.cpp \
IceELFSectionTest.cpp \
IceParseInstsTest.cpp \
AssemblerX8632/LowLevel.cpp \
IceParseInstsTest.cpp
# The X86 assembler tests take too long to compile. Given how infrequently the
# assembler will change, we disable them.
ifdef CHECK_X86_ASM
UNITTEST_SRCS += AssemblerX8632/LowLevel.cpp \
AssemblerX8632/DataMov.cpp \
AssemblerX8632/Locked.cpp \
AssemblerX8632/GPRArith.cpp \
......@@ -237,7 +241,7 @@ UNITTEST_SRCS = \
AssemblerX8664/XmmArith.cpp \
AssemblerX8664/ControlFlow.cpp \
AssemblerX8664/Other.cpp
endif
UNITTEST_OBJS = $(patsubst %.cpp, $(OBJDIR)/unittest/%.o, $(UNITTEST_SRCS))
UNITTEST_LIB_OBJS = $(filter-out $(OBJDIR)/main.o,$(OBJS))
......
......@@ -1939,8 +1939,7 @@ void TargetX86Base<Machine>::lowerArithmetic(const InstArithmetic *Inst) {
Context.insert(InstFakeDef::create(Func, T_eax));
_xor(T_eax, T_eax);
_mov(T, Src0, Traits::RegisterSet::Reg_eax);
Variable *T_al = makeReg(IceType_i8, Traits::RegisterSet::Reg_eax);
_div(T_al, Src1, T);
_div(T, Src1, T);
// shr $8, %eax shifts ah (i.e., the 8 bit remainder) into al. We don't
// mov %ah, %al because it would make x86-64 codegen more complicated. If
// this ever becomes a problem we can introduce a pseudo rem instruction
......@@ -1948,7 +1947,7 @@ void TargetX86Base<Machine>::lowerArithmetic(const InstArithmetic *Inst) {
// %ah to %al.)
static constexpr uint8_t AlSizeInBits = 8;
_shr(T_eax, Ctx->getConstantInt8(AlSizeInBits));
_mov(Dest, T_al);
_mov(Dest, T);
Context.insert(InstFakeUse::create(Func, T_eax));
} else {
Constant *Zero = Ctx->getConstantZero(IceType_i32);
......
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