mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
Run codegen dce pass for all targets at all optimization levels. Previously it's
only run for x86 with fastisel. I've found it being very effective in eliminating some obvious dead code as result of formal parameter lowering especially when tail call optimization eliminated the need for some of the loads from fixed frame objects. It also shrinks a number of the tests. A couple of tests no longer make sense and are now eliminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95493 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#define DEBUG_TYPE "codegen-dce"
|
||||
#include "llvm/CodeGen/Passes.h"
|
||||
#include "llvm/Pass.h"
|
||||
#include "llvm/CodeGen/MachineFunctionPass.h"
|
||||
@ -19,8 +20,11 @@
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Target/TargetInstrInfo.h"
|
||||
#include "llvm/Target/TargetMachine.h"
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
using namespace llvm;
|
||||
|
||||
STATISTIC(NumDeletes, "Number of dead instructions deleted");
|
||||
|
||||
namespace {
|
||||
class DeadMachineInstructionElim : public MachineFunctionPass {
|
||||
virtual bool runOnMachineFunction(MachineFunction &MF);
|
||||
@ -126,6 +130,7 @@ bool DeadMachineInstructionElim::runOnMachineFunction(MachineFunction &MF) {
|
||||
DEBUG(dbgs() << "DeadMachineInstructionElim: DELETING: " << *MI);
|
||||
AnyChanges = true;
|
||||
MI->eraseFromParent();
|
||||
++NumDeletes;
|
||||
MIE = MBB->rend();
|
||||
// MII is now pointing to the next instruction to process,
|
||||
// so don't increment it.
|
||||
|
Reference in New Issue
Block a user