[PATCH] D78156: [AArch64ConditionalCompares] Ignore debug insts in findConvertibleCompare
Vedant Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 14 14:39:24 PDT 2020
vsk created this revision.
vsk added reviewers: t.p.northover, paquette, aemerson.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.
Herald added a project: LLVM.
Fix an issue where the presence of debug info could disable the ccmp
optimization due to findConvertibleCompare failing too early (the error
is "Can't create ccmp with multiple uses", where the "use" is a
DBG_VALUE inst).
Depends on D78151 <https://reviews.llvm.org/D78151>.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D78156
Files:
llvm/lib/Target/AArch64/AArch64ConditionalCompares.cpp
llvm/test/CodeGen/AArch64/arm64-ccmp.ll
Index: llvm/test/CodeGen/AArch64/arm64-ccmp.ll
===================================================================
--- llvm/test/CodeGen/AArch64/arm64-ccmp.ll
+++ llvm/test/CodeGen/AArch64/arm64-ccmp.ll
@@ -1,4 +1,4 @@
-; RUN: llc < %s -mcpu=cyclone -verify-machineinstrs -aarch64-enable-ccmp -aarch64-stress-ccmp | FileCheck %s
+; RUN: llc < %s -debugify-and-strip-all-safe -mcpu=cyclone -verify-machineinstrs -aarch64-enable-ccmp -aarch64-stress-ccmp | FileCheck %s
target triple = "arm64-apple-ios"
; CHECK: single_same
Index: llvm/lib/Target/AArch64/AArch64ConditionalCompares.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64ConditionalCompares.cpp
+++ llvm/lib/Target/AArch64/AArch64ConditionalCompares.cpp
@@ -318,6 +318,7 @@
// Now find the instruction controlling the terminator.
for (MachineBasicBlock::iterator B = MBB->begin(); I != B;) {
--I;
+ I = skipDebugInstructionsBackward(I, MBB->begin());
assert(!I->isTerminator() && "Spurious terminator");
switch (I->getOpcode()) {
// cmp is an alias for subs with a dead destination register.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78156.257500.patch
Type: text/x-patch
Size: 1142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200414/a95756c6/attachment.bin>
More information about the llvm-commits
mailing list