summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-10-17 17:33:39 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-10-17 17:33:39 +0000
commitd4bde54da5a2c4054a88bce72a96aa357aa3eacb (patch)
tree03fe553697a9bdddade4f6d80411936d41d837fb /llvm
parent76c85632397cb02f97019716a695b3de704b3bbd (diff)
downloadbcm5719-llvm-d4bde54da5a2c4054a88bce72a96aa357aa3eacb.tar.gz
bcm5719-llvm-d4bde54da5a2c4054a88bce72a96aa357aa3eacb.zip
Admonish that MI is not IR and virtual registers have constraints.
In machine code, you can't just replaceRegWith() the same way you can replaceAllUsesWith() in IR. Virtual registers may have different register classes that need to be merged first. llvm-svn: 142201
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/CodeGen/MachineRegisterInfo.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineRegisterInfo.h b/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
index 3866b2650d0..bd674d2b96d 100644
--- a/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineRegisterInfo.h
@@ -171,6 +171,14 @@ public:
/// replaceRegWith - Replace all instances of FromReg with ToReg in the
/// machine function. This is like llvm-level X->replaceAllUsesWith(Y),
/// except that it also changes any definitions of the register as well.
+ ///
+ /// Note that it is usually necessary to first constrain ToReg's register
+ /// class to match the FromReg constraints using:
+ ///
+ /// constrainRegClass(ToReg, getRegClass(FromReg))
+ ///
+ /// That function will return NULL if the virtual registers have incompatible
+ /// constraints.
void replaceRegWith(unsigned FromReg, unsigned ToReg);
/// getRegUseDefListHead - Return the head pointer for the register use/def
OpenPOWER on IntegriCloud