diff options
| author | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2019-01-23 07:42:26 +0000 |
|---|---|---|
| committer | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2019-01-23 07:42:26 +0000 |
| commit | 961c47ec9833ae15ad4cbf71ecfb1403baed465c (patch) | |
| tree | ed39d3cdd914f4bf3fc6b21d0c01aaf0cfe51ee2 /llvm/lib/Target/SystemZ/SystemZElimCompare.cpp | |
| parent | b5a505570417169218263bb0ed6d84a815a6e2c5 (diff) | |
| download | bcm5719-llvm-961c47ec9833ae15ad4cbf71ecfb1403baed465c.tar.gz bcm5719-llvm-961c47ec9833ae15ad4cbf71ecfb1403baed465c.zip | |
[SystemZ] Handle DBG_VALUE instructions in two places in backend.
Two backend optimizations failed to handle cases when compiled with -g, due
to failing to consider DBG_VALUE instructions. This was in
SystemZTargetLowering::emitSelect() and
SystemZElimCompare::getRegReferences().
This patch makes sure that DBG_VALUEs are recognized so that they do not
affect these optimizations.
Tests for branch-on-count, load-and-trap and consecutive selects.
Review: Ulrich Weigand
https://reviews.llvm.org/D57048
llvm-svn: 351928
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZElimCompare.cpp')
| -rw-r--r-- | llvm/lib/Target/SystemZ/SystemZElimCompare.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp b/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp index 0028ae7eb6f..4c13cd6bfca 100644 --- a/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp +++ b/llvm/lib/Target/SystemZ/SystemZElimCompare.cpp @@ -146,6 +146,9 @@ static bool resultTests(MachineInstr &MI, unsigned Reg) { // Describe the references to Reg or any of its aliases in MI. Reference SystemZElimCompare::getRegReferences(MachineInstr &MI, unsigned Reg) { Reference Ref; + if (MI.isDebugInstr()) + return Ref; + for (unsigned I = 0, E = MI.getNumOperands(); I != E; ++I) { const MachineOperand &MO = MI.getOperand(I); if (MO.isReg()) { |

