From edad5bcb76bf472a1487c0f3dd94a5914213a647 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 2 Dec 2017 12:46:23 +0000 Subject: Vendor import of llvm release_50 branch r319231: https://llvm.org/svn/llvm-project/llvm/branches/release_50@319231 --- lib/Target/AArch64/AArch64RedundantCopyElimination.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/Target/AArch64/AArch64RedundantCopyElimination.cpp') diff --git a/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp b/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp index 4e65c0ab6011..22c11c7276d2 100644 --- a/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp +++ b/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp @@ -167,6 +167,9 @@ AArch64RedundantCopyElimination::knownRegValInBlock( // CMP is an alias for SUBS with a dead destination register. case AArch64::SUBSWri: case AArch64::SUBSXri: { + // Sometimes the first operand is a FrameIndex. Bail if tht happens. + if (!PredI.getOperand(1).isReg()) + return None; MCPhysReg SrcReg = PredI.getOperand(1).getReg(); // Must not be a symbolic immediate. -- cgit v1.3