diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-04-20 21:45:33 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2012-04-20 21:45:33 +0000 |
commit | 7111a630d5407288ab8cb063033ce28572f40e3e (patch) | |
tree | b955321b050a89e8e36d9e99654528bbe165502c /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | 6d66ce67d75ec2dbc42d028084ab0801c1f4fcd6 (diff) | |
download | llvm-7111a630d5407288ab8cb063033ce28572f40e3e.zip llvm-7111a630d5407288ab8cb063033ce28572f40e3e.tar.gz llvm-7111a630d5407288ab8cb063033ce28572f40e3e.tar.bz2 |
Print <def,read-undef> to avoid confusion.
The <undef> flag on a def operand only applies to partial register
redefinitions. Only print the flag when relevant, and print it as
<def,read-undef> to make it clearer what it means.
llvm-svn: 155239
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index e553a04..46ea003 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -255,6 +255,10 @@ void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const { OS << "imp-"; OS << "def"; NeedComma = true; + // <def,read-undef> only makes sense when getSubReg() is set. + // Don't clutter the output otherwise. + if (isUndef() && getSubReg()) + OS << ",read-undef"; } else if (isImplicit()) { OS << "imp-use"; NeedComma = true; @@ -271,7 +275,7 @@ void MachineOperand::print(raw_ostream &OS, const TargetMachine *TM) const { OS << "dead"; NeedComma = true; } - if (isUndef()) { + if (isUndef() && isUse()) { if (NeedComma) OS << ','; OS << "undef"; NeedComma = true; |