mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +00:00
simplify some code using new predicates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45689 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
13cea0bcef
commit
f86e1df877
@ -26,26 +26,24 @@
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
// Hidden options for help debugging.
|
||||
cl::opt<int> IfCvtFnStart("ifcvt-fn-start", cl::init(-1), cl::Hidden);
|
||||
cl::opt<int> IfCvtFnStop("ifcvt-fn-stop", cl::init(-1), cl::Hidden);
|
||||
cl::opt<int> IfCvtLimit("ifcvt-limit", cl::init(-1), cl::Hidden);
|
||||
cl::opt<bool> DisableSimple("disable-ifcvt-simple",
|
||||
cl::init(false), cl::Hidden);
|
||||
cl::opt<bool> DisableSimpleF("disable-ifcvt-simple-false",
|
||||
cl::init(false), cl::Hidden);
|
||||
cl::opt<bool> DisableTriangle("disable-ifcvt-triangle",
|
||||
cl::init(false), cl::Hidden);
|
||||
cl::opt<bool> DisableTriangleR("disable-ifcvt-triangle-rev",
|
||||
cl::init(false), cl::Hidden);
|
||||
cl::opt<bool> DisableTriangleF("disable-ifcvt-triangle-false",
|
||||
cl::init(false), cl::Hidden);
|
||||
cl::opt<bool> DisableTriangleFR("disable-ifcvt-triangle-false-rev",
|
||||
cl::init(false), cl::Hidden);
|
||||
cl::opt<bool> DisableDiamond("disable-ifcvt-diamond",
|
||||
cl::init(false), cl::Hidden);
|
||||
}
|
||||
// Hidden options for help debugging.
|
||||
static cl::opt<int> IfCvtFnStart("ifcvt-fn-start", cl::init(-1), cl::Hidden);
|
||||
static cl::opt<int> IfCvtFnStop("ifcvt-fn-stop", cl::init(-1), cl::Hidden);
|
||||
static cl::opt<int> IfCvtLimit("ifcvt-limit", cl::init(-1), cl::Hidden);
|
||||
static cl::opt<bool> DisableSimple("disable-ifcvt-simple",
|
||||
cl::init(false), cl::Hidden);
|
||||
static cl::opt<bool> DisableSimpleF("disable-ifcvt-simple-false",
|
||||
cl::init(false), cl::Hidden);
|
||||
static cl::opt<bool> DisableTriangle("disable-ifcvt-triangle",
|
||||
cl::init(false), cl::Hidden);
|
||||
static cl::opt<bool> DisableTriangleR("disable-ifcvt-triangle-rev",
|
||||
cl::init(false), cl::Hidden);
|
||||
static cl::opt<bool> DisableTriangleF("disable-ifcvt-triangle-false",
|
||||
cl::init(false), cl::Hidden);
|
||||
static cl::opt<bool> DisableTriangleFR("disable-ifcvt-triangle-false-rev",
|
||||
cl::init(false), cl::Hidden);
|
||||
static cl::opt<bool> DisableDiamond("disable-ifcvt-diamond",
|
||||
cl::init(false), cl::Hidden);
|
||||
|
||||
STATISTIC(NumSimple, "Number of simple if-conversions performed");
|
||||
STATISTIC(NumSimpleFalse, "Number of simple (F) if-conversions performed");
|
||||
@ -555,7 +553,7 @@ void IfConverter::ScanInstructions(BBInfo &BBI) {
|
||||
BBI.CannotBeCopied = true;
|
||||
|
||||
bool isPredicated = TII->isPredicated(I);
|
||||
bool isCondBr = BBI.IsBrAnalyzable && TID->isBranch() && !TID->isBarrier();
|
||||
bool isCondBr = BBI.IsBrAnalyzable && TID->isConditionalBranch();
|
||||
|
||||
if (!isCondBr) {
|
||||
if (!isPredicated)
|
||||
|
@ -616,8 +616,7 @@ bool LiveIntervals::isReMaterializable(const LiveInterval &li,
|
||||
|
||||
isLoad = false;
|
||||
const TargetInstrDescriptor *TID = MI->getDesc();
|
||||
if ((TID->Flags & M_IMPLICIT_DEF_FLAG) ||
|
||||
tii_->isTriviallyReMaterializable(MI)) {
|
||||
if (TID->isImplicitDef() || tii_->isTriviallyReMaterializable(MI)) {
|
||||
isLoad = TID->isSimpleLoad();
|
||||
return true;
|
||||
}
|
||||
@ -682,7 +681,7 @@ bool LiveIntervals::tryFoldMemoryOperand(MachineInstr* &MI,
|
||||
unsigned MRInfo = 0;
|
||||
const TargetInstrDescriptor *TID = MI->getDesc();
|
||||
// If it is an implicit def instruction, just delete it.
|
||||
if (TID->Flags & M_IMPLICIT_DEF_FLAG) {
|
||||
if (TID->isImplicitDef()) {
|
||||
RemoveMachineInstrFromMaps(MI);
|
||||
vrm.RemoveMachineInstrFromMaps(MI);
|
||||
MI->eraseFromParent();
|
||||
|
Loading…
x
Reference in New Issue
Block a user