Files
clang-p2996/llvm/tools/llvm-reduce/deltas/ReduceUsingSimplifyCFG.h
Matt Arsenault 08d1c43c70 llvm-reduce: Add conditional reduction passes
Copy this technique from bugpoint. Before trying to blindly
delete blocks, try to fold branch conditions. This intuitively
makes more sense for a faster reduction, since you can find
dead paths in the function to prune out before trying to bisect
blocks in source order.

Seems to provide some speedup on my multi-hour reduction samples.

This does have the potential to produce testcases with unreachable
blocks. This is already a problem with the existing block
reduction pass. I'm struggling dealing with invalid reductions
in these cases, so in the future this should probably start
deleting those. However, I do sometimes try to reduce failures
in code that becomes unreachable, so I'm not totally sure
what to do here.
2022-10-23 15:39:39 -07:00

26 lines
926 B
C++

//===- ReduceUsingSimplifyCFG.h - Specialized Delta Pass --------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file implements a function which calls the Generic Delta pass in order
// to call SimplifyCFG on individual basic blocks.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_TOOLS_LLVM_REDUCE_DELTAS_SIMPLIFYCFG_H
#define LLVM_TOOLS_LLVM_REDUCE_DELTAS_SIMPLIFYCFG_H
#include "Delta.h"
namespace llvm {
void reduceUsingSimplifyCFGDeltaPass(TestRunner &Test);
void reduceConditionalsTrueDeltaPass(TestRunner &Test);
void reduceConditionalsFalseDeltaPass(TestRunner &Test);
} // namespace llvm
#endif