mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
TargetMachine: Indicate whether machine verifier passes.
This adds a callback to the LLVMTargetMachine that lets target indicate that they do not pass the machine verifier checks in all cases yet. This is intended to be a temporary measure while the targets are fixed allowing us to enable the machine verifier by default with EXPENSIVE_CHECKS enabled! Differential Revision: https://reviews.llvm.org/D33696 llvm-svn: 304320
This commit is contained in:
parent
24ca2b4bfb
commit
6d04c8c1dc
@ -299,6 +299,12 @@ public:
|
||||
bool addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx,
|
||||
raw_pwrite_stream &OS,
|
||||
bool DisableVerify = true) override;
|
||||
|
||||
/// Returns true if the target is expected to pass all machine verifier
|
||||
/// checks. This is a stopgap measure to fix targets one by one. We will
|
||||
/// remove this at some point and always enable the verifier when
|
||||
/// EXPENSIVE_CHECKS is enabled.
|
||||
virtual bool isMachineVerifierClean() const { return true; }
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
@ -430,7 +430,12 @@ void TargetPassConfig::addPrintPass(const std::string &Banner) {
|
||||
}
|
||||
|
||||
void TargetPassConfig::addVerifyPass(const std::string &Banner) {
|
||||
if (VerifyMachineCode)
|
||||
bool Verify = VerifyMachineCode;
|
||||
#ifdef EXPENSIVE_CHECKS
|
||||
if (VerifyMachineCode == cl::BOU_UNSET)
|
||||
Verify = TM->isMachineVerifierClean();
|
||||
#endif
|
||||
if (Verify)
|
||||
PM->add(createMachineVerifierPass(Banner));
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,6 @@ public:
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
@ -89,6 +88,10 @@ public:
|
||||
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
||||
|
||||
const R600Subtarget *getSubtargetImpl(const Function &) const override;
|
||||
|
||||
bool isMachineVerifierClean() const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -60,6 +60,10 @@ public:
|
||||
TargetLoweringObjectFile *getObjFileLowering() const override {
|
||||
return TLOF.get();
|
||||
}
|
||||
|
||||
bool isMachineVerifierClean() const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/// ARM/Thumb little endian target machine.
|
||||
|
@ -41,6 +41,10 @@ public:
|
||||
|
||||
TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
|
||||
|
||||
bool isMachineVerifierClean() const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
std::unique_ptr<TargetLoweringObjectFile> TLOF;
|
||||
AVRSubtarget SubTarget;
|
||||
|
@ -49,6 +49,10 @@ public:
|
||||
TargetLoweringObjectFile *getObjFileLowering() const override {
|
||||
return TLOF.get();
|
||||
}
|
||||
|
||||
bool isMachineVerifierClean() const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
} // namespace llvm
|
||||
|
||||
|
@ -66,6 +66,10 @@ public:
|
||||
|
||||
bool isLittleEndian() const { return isLittle; }
|
||||
const MipsABIInfo &getABI() const { return ABI; }
|
||||
|
||||
bool isMachineVerifierClean() const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/// Mips32/64 big endian target machine.
|
||||
|
@ -65,6 +65,9 @@ public:
|
||||
|
||||
TargetIRAnalysis getTargetIRAnalysis() override;
|
||||
|
||||
bool isMachineVerifierClean() const override {
|
||||
return false;
|
||||
}
|
||||
}; // NVPTXTargetMachine.
|
||||
|
||||
class NVPTXTargetMachine32 : public NVPTXTargetMachine {
|
||||
|
@ -55,6 +55,10 @@ public:
|
||||
const Triple &TT = getTargetTriple();
|
||||
return (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le);
|
||||
};
|
||||
|
||||
bool isMachineVerifierClean() const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/// PowerPC 32-bit target machine.
|
||||
|
@ -40,6 +40,10 @@ public:
|
||||
TargetLoweringObjectFile *getObjFileLowering() const override {
|
||||
return TLOF.get();
|
||||
}
|
||||
|
||||
bool isMachineVerifierClean() const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/// Sparc 32-bit target machine
|
||||
|
@ -51,6 +51,8 @@ public:
|
||||
}
|
||||
|
||||
bool targetSchedulesPostRAScheduling() const override { return true; };
|
||||
|
||||
bool isMachineVerifierClean() const override { return false; }
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
@ -49,6 +49,10 @@ public:
|
||||
TargetLoweringObjectFile *getObjFileLowering() const override {
|
||||
return TLOF.get();
|
||||
}
|
||||
|
||||
bool isMachineVerifierClean() const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
} // end namespace llvm
|
||||
|
@ -7,8 +7,8 @@
|
||||
# This test ensures that the command line accepts
|
||||
# several run passes on the same command line and
|
||||
# actually create the proper pipeline for it.
|
||||
# PSEUDO_PEEPHOLE: -expand-isel-pseudos -peephole-opt
|
||||
# PEEPHOLE_PSEUDO: -peephole-opt -expand-isel-pseudos
|
||||
# PSEUDO_PEEPHOLE: -expand-isel-pseudos {{(-machineverifier )?}}-peephole-opt
|
||||
# PEEPHOLE_PSEUDO: -peephole-opt {{(-machineverifier )?}}-expand-isel-pseudos
|
||||
|
||||
# Make sure there are no other passes happening after what we asked.
|
||||
# CHECK-NEXT: --- |
|
||||
|
Loading…
Reference in New Issue
Block a user