From 7d49a3a81698a2a9508084b6cb9a8daf5d617252 Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Mon, 12 Nov 2018 09:29:58 +0000 Subject: [LICM] Hoist guards from non-header blocks This patch relaxes overconservative checks on whether or not we could write memory before we execute an instruction. This allows us to hoist guards out of loops even if they are not in the header block. Differential Revision: https://reviews.llvm.org/D50891 Reviewed By: fedor.sergeev llvm-svn: 346643 --- llvm/lib/Analysis/InstructionPrecedenceTracking.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/Analysis/InstructionPrecedenceTracking.cpp') diff --git a/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp b/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp index c667c282281..b98975b006a 100644 --- a/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp +++ b/llvm/lib/Analysis/InstructionPrecedenceTracking.cpp @@ -142,3 +142,8 @@ bool ImplicitControlFlowTracking::isSpecialInstruction( } return true; } + +bool MemoryWriteTracking::isSpecialInstruction( + const Instruction *Insn) const { + return Insn->mayWriteToMemory(); +} -- cgit v1.2.3