llvm.org GIT mirror llvm / 664dca2
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304320 91177308-0d34-0410-b5e6-96231b3b80d8 Matthias Braun 3 years ago
13 changed file(s) with 51 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
298298 bool addPassesToEmitMC(PassManagerBase &PM, MCContext *&Ctx,
299299 raw_pwrite_stream &OS,
300300 bool DisableVerify = true) override;
301
302 /// Returns true if the target is expected to pass all machine verifier
303 /// checks. This is a stopgap measure to fix targets one by one. We will
304 /// remove this at some point and always enable the verifier when
305 /// EXPENSIVE_CHECKS is enabled.
306 virtual bool isMachineVerifierClean() const { return true; }
301307 };
302308
303309 } // end namespace llvm
429429 }
430430
431431 void TargetPassConfig::addVerifyPass(const std::string &Banner) {
432 if (VerifyMachineCode)
432 bool Verify = VerifyMachineCode;
433 #ifdef EXPENSIVE_CHECKS
434 if (VerifyMachineCode == cl::BOU_UNSET)
435 Verify = TM->isMachineVerifierClean();
436 #endif
437 if (Verify)
433438 PM->add(createMachineVerifierPass(Banner));
434439 }
435440
6868 return -1;
6969 return 0;
7070 }
71
7271 };
7372
7473 //===----------------------------------------------------------------------===//
8887 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
8988
9089 const R600Subtarget *getSubtargetImpl(const Function &) const override;
90
91 bool isMachineVerifierClean() const override {
92 return false;
93 }
9194 };
9295
9396 //===----------------------------------------------------------------------===//
5959 TargetLoweringObjectFile *getObjFileLowering() const override {
6060 return TLOF.get();
6161 }
62
63 bool isMachineVerifierClean() const override {
64 return false;
65 }
6266 };
6367
6468 /// ARM/Thumb little endian target machine.
4040
4141 TargetPassConfig *createPassConfig(PassManagerBase &PM) override;
4242
43 bool isMachineVerifierClean() const override {
44 return false;
45 }
46
4347 private:
4448 std::unique_ptr TLOF;
4549 AVRSubtarget SubTarget;
4848 TargetLoweringObjectFile *getObjFileLowering() const override {
4949 return TLOF.get();
5050 }
51
52 bool isMachineVerifierClean() const override {
53 return false;
54 }
5155 };
5256 } // namespace llvm
5357
6565
6666 bool isLittleEndian() const { return isLittle; }
6767 const MipsABIInfo &getABI() const { return ABI; }
68
69 bool isMachineVerifierClean() const override {
70 return false;
71 }
6872 };
6973
7074 /// Mips32/64 big endian target machine.
6464
6565 TargetIRAnalysis getTargetIRAnalysis() override;
6666
67 bool isMachineVerifierClean() const override {
68 return false;
69 }
6770 }; // NVPTXTargetMachine.
6871
6972 class NVPTXTargetMachine32 : public NVPTXTargetMachine {
5454 const Triple &TT = getTargetTriple();
5555 return (TT.getArch() == Triple::ppc64 || TT.getArch() == Triple::ppc64le);
5656 };
57
58 bool isMachineVerifierClean() const override {
59 return false;
60 }
5761 };
5862
5963 /// PowerPC 32-bit target machine.
3939 TargetLoweringObjectFile *getObjFileLowering() const override {
4040 return TLOF.get();
4141 }
42
43 bool isMachineVerifierClean() const override {
44 return false;
45 }
4246 };
4347
4448 /// Sparc 32-bit target machine
5050 }
5151
5252 bool targetSchedulesPostRAScheduling() const override { return true; };
53
54 bool isMachineVerifierClean() const override { return false; }
5355 };
5456
5557 } // end namespace llvm
4848 TargetLoweringObjectFile *getObjFileLowering() const override {
4949 return TLOF.get();
5050 }
51
52 bool isMachineVerifierClean() const override {
53 return false;
54 }
5155 };
5256
5357 } // end namespace llvm
66 # This test ensures that the command line accepts
77 # several run passes on the same command line and
88 # actually create the proper pipeline for it.
9 # PSEUDO_PEEPHOLE: -expand-isel-pseudos -peephole-opt
10 # PEEPHOLE_PSEUDO: -peephole-opt -expand-isel-pseudos
9 # PSEUDO_PEEPHOLE: -expand-isel-pseudos {{(-machineverifier )?}}-peephole-opt
10 # PEEPHOLE_PSEUDO: -peephole-opt {{(-machineverifier )?}}-expand-isel-pseudos
1111
1212 # Make sure there are no other passes happening after what we asked.
1313 # CHECK-NEXT: --- |