[PATCH] D78157: [AArch64InstrInfo] Ignore debug insts in areCFlagsAccessedBetweenInstrs
Vedant Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 15 14:19:43 PDT 2020
vsk updated this revision to Diff 257843.
vsk added a subscriber: fhahn.
vsk added a comment.
Update to use range helper from D78151 <https://reviews.llvm.org/D78151> (as suggested by @fhahn)
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.257843.patch
Type: text/x-patch
Size: 1734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200415/81c8f5b7/attachment.bin>
More information about the llvm-commits
mailing list