From 95304222ef659e6b604ce793b42b24ce9b90556e Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Wed, 11 Dec 2024 13:54:42 +0000 Subject: [PATCH] remove dead code --- ir/x86_intrinsics.cpp | 34 +++++++++++----------------------- ir/x86_intrinsics.h | 2 -- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/ir/x86_intrinsics.cpp b/ir/x86_intrinsics.cpp index 22d2ec398..0762265e4 100644 --- a/ir/x86_intrinsics.cpp +++ b/ir/x86_intrinsics.cpp @@ -1,10 +1,8 @@ #include "ir/x86_intrinsics.h" -#include "smt/expr.h" using namespace smt; using namespace std; -namespace IR { // the shape of a vector is stored as <# of lanes, element bits> static constexpr std::pair binop_shape_op0[] = { #define PROCESS(NAME, A, B, C, D, E, F) std::make_pair(C, D), @@ -30,9 +28,7 @@ static constexpr unsigned binop_ret_width[] = { #undef PROCESS }; -unsigned X86IntrinBinOp::getRetWidth(Op op) { - return binop_ret_width[op]; -} +namespace IR { vector X86IntrinBinOp::operands() const { return {a, b}; @@ -51,19 +47,17 @@ void X86IntrinBinOp::rauw(const Value &what, Value &with) { RAUW(b); } -string X86IntrinBinOp::getOpName(Op op) { +void X86IntrinBinOp::print(ostream &os) const { + const char *name; switch (op) { #define PROCESS(NAME, A, B, C, D, E, F) \ case NAME: \ - return #NAME; + name = #NAME; \ + break; #include "x86_intrinsics_binop.inc" #undef PROCESS } - UNREACHABLE(); -} - -void X86IntrinBinOp::print(ostream &os) const { - os << getName() << " = " << getOpName(op) << " " << *a << ", " << *b; + os << getName() << " = " << name << ' ' << *a << ", " << *b; } StateValue X86IntrinBinOp::toSMT(State &s) const { @@ -641,23 +635,17 @@ static constexpr unsigned terop_ret_width[] = { #undef PROCESS }; -string X86IntrinTerOp::getOpName(Op op) { +void X86IntrinTerOp::print(ostream &os) const { + const char *name; switch (op) { #define PROCESS(NAME, A, B, C, D, E, F, G, H) \ case NAME: \ - return #NAME; + name = #NAME; \ + break; #include "x86_intrinsics_terop.inc" #undef PROCESS } - UNREACHABLE(); -} - -unsigned X86IntrinTerOp::getRetWidth(Op op) { - return terop_ret_width[op]; -} - -void X86IntrinTerOp::print(ostream &os) const { - os << getName() << " = " << getOpName(op) << " " << *a << ", " << *b; + os << getName() << " = " << name << ' ' << *a << ", " << *b; } StateValue X86IntrinTerOp::toSMT(State &s) const { diff --git a/ir/x86_intrinsics.h b/ir/x86_intrinsics.h index aaa09c989..6830a02ed 100644 --- a/ir/x86_intrinsics.h +++ b/ir/x86_intrinsics.h @@ -16,7 +16,6 @@ class X86IntrinBinOp final : public Instr { Op op; public: - static unsigned getRetWidth(Op op); X86IntrinBinOp(Type &type, std::string &&name, Value &a, Value &b, Op op) : Instr(type, std::move(name)), a(&a), b(&b), op(op) {} std::vector operands() const override; @@ -44,7 +43,6 @@ class X86IntrinTerOp final : public Instr { Op op; public: - static unsigned getRetWidth(Op op); X86IntrinTerOp(Type &type, std::string &&name, Value &a, Value &b, Value &c, Op op) : Instr(type, std::move(name)), a(&a), b(&b), c(&c), op(op) {}