summaryrefslogtreecommitdiff
path: root/lib/CodeGen/InlineSpiller.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2014-01-07 07:31:10 +0000
committerAndrew Trick <atrick@apple.com>2014-01-07 07:31:10 +0000
commit9c15f4c9c98d884ff5427df69f9859a95b75c2fb (patch)
tree0ab46ac28a7eecc2b48c939ded7d50cbcf2aabeb /lib/CodeGen/InlineSpiller.cpp
parentb4e0c9b85d7a6c5adc05059c85e4cc52dd2d92b2 (diff)
downloadllvm-9c15f4c9c98d884ff5427df69f9859a95b75c2fb.tar.gz
llvm-9c15f4c9c98d884ff5427df69f9859a95b75c2fb.tar.bz2
llvm-9c15f4c9c98d884ff5427df69f9859a95b75c2fb.tar.xz
Fix for PR18396: Assertion: MO->isDead "Cannot fold physreg def".
InlineSpiller::foldMemoryOperand needs to handle undef call operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198679 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/InlineSpiller.cpp')
-rw-r--r--lib/CodeGen/InlineSpiller.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/InlineSpiller.cpp b/lib/CodeGen/InlineSpiller.cpp
index bb0e642313..70d97c0f55 100644
--- a/lib/CodeGen/InlineSpiller.cpp
+++ b/lib/CodeGen/InlineSpiller.cpp
@@ -1098,12 +1098,11 @@ foldMemoryOperand(ArrayRef<std::pair<MachineInstr*, unsigned> > Ops,
MRI.isReserved(Reg)) {
continue;
}
+ // Skip non-Defs, including undef uses and internal reads.
+ if (MO->isUse())
+ continue;
MIBundleOperands::PhysRegInfo RI =
MIBundleOperands(FoldMI).analyzePhysReg(Reg, &TRI);
- if (MO->readsReg()) {
- assert(RI.Reads && "Cannot fold physreg reader");
- continue;
- }
if (RI.Defines)
continue;
// FoldMI does not define this physreg. Remove the LI segment.