[PATCH] D78157: [AArch64InstrInfo] Ignore debug insts in areCFlagsAccessedBetweenInstrs [6/10]
Vedant Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 15 18:46:47 PDT 2020
vsk updated this revision to Diff 257929.
vsk retitled this revision from "[AArch64InstrInfo] Ignore debug insts in areCFlagsAccessedBetweenInstrs" to "[AArch64InstrInfo] Ignore debug insts in areCFlagsAccessedBetweenInstrs [6/10]".
vsk edited the summary of this revision.
vsk removed reviewers: danielkiss, aprantl.
vsk removed a subscriber: fhahn.
vsk added a comment.
This revision now requires review to proceed.
retitle
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78157/new/
https://reviews.llvm.org/D78157
Files:
llvm/lib/CodeGen/PeepholeOptimizer.cpp
llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
llvm/test/CodeGen/AArch64/arm64-csel.ll
Index: llvm/test/CodeGen/AArch64/arm64-csel.ll
===================================================================
--- llvm/test/CodeGen/AArch64/arm64-csel.ll
+++ llvm/test/CodeGen/AArch64/arm64-csel.ll
@@ -1,4 +1,4 @@
-; RUN: llc -O3 < %s | FileCheck %s
+; RUN: llc -debugify-and-strip-all-safe -O3 < %s | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n32:64"
target triple = "arm64-unknown-unknown"
Index: llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
===================================================================
--- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -1184,9 +1184,8 @@
}) != To->getParent()->rend());
// We iterate backward starting \p To until we hit \p From.
- for (--To; To != From; --To) {
- const MachineInstr &Instr = *To;
-
+ --To;
+ for (const MachineInstr &Instr : reversedInstructionsWithoutDebug(To, From)) {
if (((AccessToCheck & AK_Write) &&
Instr.modifiesRegister(AArch64::NZCV, TRI)) ||
((AccessToCheck & AK_Read) && Instr.readsRegister(AArch64::NZCV, TRI)))
Index: llvm/lib/CodeGen/PeepholeOptimizer.cpp
===================================================================
--- llvm/lib/CodeGen/PeepholeOptimizer.cpp
+++ llvm/lib/CodeGen/PeepholeOptimizer.cpp
@@ -616,6 +616,7 @@
// Attempt to optimize the comparison instruction.
LLVM_DEBUG(dbgs() << "Attempting to optimize compare: " << MI);
if (TII->optimizeCompareInstr(MI, SrcReg, SrcReg2, CmpMask, CmpValue, MRI)) {
+ LLVM_DEBUG(dbgs() << " -> Successfully optimized compare!\n");
++NumCmps;
return true;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78157.257929.patch
Type: text/x-patch
Size: 1734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200416/afacd9f9/attachment.bin>
More information about the llvm-commits
mailing list