Skip to content

Commit

Permalink
ValueDominanceValidation: rm deadcode
Browse files Browse the repository at this point in the history
Signed-off-by: Alyssa Rosenzweig <[email protected]>
  • Loading branch information
alyssarosenzweig committed Apr 8, 2024
1 parent 7b3e031 commit 063954c
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions FEXCore/Source/Interface/IR/Passes/ValueDominanceValidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ desc: Sanity Checking
#include <stdint.h>
#include <utility>

namespace {
struct BlockInfo {
fextl::vector<FEXCore::IR::OrderedNode *> Predecessors;
fextl::vector<FEXCore::IR::OrderedNode *> Successors;
};
}

namespace FEXCore::IR::Validation {
class ValueDominanceValidation final : public FEXCore::IR::Pass {
public:
Expand All @@ -43,50 +36,6 @@ bool ValueDominanceValidation::Run(IREmitter *IREmit) {
auto CurrentIR = IREmit->ViewIR();

fextl::ostringstream Errors;
fextl::unordered_map<IR::NodeID, BlockInfo> OffsetToBlockMap;

for (auto [BlockNode, BlockHeader] : CurrentIR.GetBlocks()) {

BlockInfo *CurrentBlock = &OffsetToBlockMap.try_emplace(CurrentIR.GetID(BlockNode)).first->second;

for (auto [CodeNode, IROp] : CurrentIR.GetCode(BlockNode)) {
switch (IROp->Op) {
case IR::OP_CONDJUMP: {
auto Op = IROp->CW<IR::IROp_CondJump>();

OrderedNode *TrueTargetNode = CurrentIR.GetNode(Op->TrueBlock);
OrderedNode *FalseTargetNode = CurrentIR.GetNode(Op->FalseBlock);

CurrentBlock->Successors.emplace_back(TrueTargetNode);
CurrentBlock->Successors.emplace_back(FalseTargetNode);

{
auto Block = &OffsetToBlockMap.try_emplace(Op->TrueBlock.ID()).first->second;
Block->Predecessors.emplace_back(BlockNode);
}

{
auto Block = &OffsetToBlockMap.try_emplace(Op->FalseBlock.ID()).first->second;
Block->Predecessors.emplace_back(BlockNode);
}

break;
}
case IR::OP_JUMP: {
auto Op = IROp->CW<IR::IROp_Jump>();
OrderedNode *TargetNode = CurrentIR.GetNode(Op->Header.Args[0]);
CurrentBlock->Successors.emplace_back(TargetNode);

{
auto Block = OffsetToBlockMap.try_emplace(Op->Header.Args[0].ID()).first;
Block->second.Predecessors.emplace_back(BlockNode);
}
break;
}
default: break;
}
}
}

for (auto [BlockNode, BlockHeader] : CurrentIR.GetBlocks()) {
auto BlockIROp = BlockHeader->CW<FEXCore::IR::IROp_CodeBlock>();
Expand Down

0 comments on commit 063954c

Please sign in to comment.