summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineCopyPropagation.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-02-20 03:56:33 +0000
committerMatthias Braun <matze@braunis.de>2016-02-20 03:56:33 +0000
commit57b5f11aa706a182a85c6d7a89e762aa63661c18 (patch)
tree861ae13231f6447ba2faacd77e2714cea9cf8ef9 /llvm/lib/CodeGen/MachineCopyPropagation.cpp
parent342c671b6668ae40be79788de0e23cb8f0ff4b41 (diff)
downloadbcm5719-llvm-57b5f11aa706a182a85c6d7a89e762aa63661c18.tar.gz
bcm5719-llvm-57b5f11aa706a182a85c6d7a89e762aa63661c18.zip
MachineCopyPropagation: Use assert() instead of if{report_error()} for 'impossible' condition
llvm-svn: 261405
Diffstat (limited to 'llvm/lib/CodeGen/MachineCopyPropagation.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCopyPropagation.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index 117e1ebe3de..240c7e68387 100644
--- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -21,7 +21,6 @@
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
-#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
@@ -143,10 +142,9 @@ bool MachineCopyPropagation::CopyPropagateBlock(MachineBasicBlock &MBB) {
unsigned Def = MI->getOperand(0).getReg();
unsigned Src = MI->getOperand(1).getReg();
- if (TargetRegisterInfo::isVirtualRegister(Def) ||
- TargetRegisterInfo::isVirtualRegister(Src))
- report_fatal_error("MachineCopyPropagation should be run after"
- " register allocation!");
+ assert(!TargetRegisterInfo::isVirtualRegister(Def) &&
+ !TargetRegisterInfo::isVirtualRegister(Src) &&
+ "MachineCopyPropagation should be run after register allocation!");
DenseMap<unsigned, MachineInstr*>::iterator CI = AvailCopyMap.find(Src);
if (CI != AvailCopyMap.end()) {
@@ -241,9 +239,8 @@ bool MachineCopyPropagation::CopyPropagateBlock(MachineBasicBlock &MBB) {
if (!Reg)
continue;
- if (TargetRegisterInfo::isVirtualRegister(Reg))
- report_fatal_error("MachineCopyPropagation should be run after"
- " register allocation!");
+ assert(!TargetRegisterInfo::isVirtualRegister(Reg) &&
+ "MachineCopyPropagation should be run after register allocation!");
if (MO.isDef()) {
Defs.push_back(Reg);
OpenPOWER on IntegriCloud