From b7242fec0a03f49db2935335c0022f239fb737c8 Mon Sep 17 00:00:00 2001 From: Max Kazantsev Date: Thu, 14 Feb 2019 11:10:29 +0000 Subject: [PATCH] Make widenable condition transparent for MemoryWriteTracking Side effects of widenable condition intrinsic are modelled via InaccessibleMemOnly, and there is no way to say that it isn't really writing any memory. This patch teaches MemoryWriteTracking ignore this intrinsic. llvm-svn: 354021 --- lib/Analysis/InstructionPrecedenceTracking.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Analysis/InstructionPrecedenceTracking.cpp b/lib/Analysis/InstructionPrecedenceTracking.cpp index 0afce7ebbd3..35190ce3e11 100644 --- a/lib/Analysis/InstructionPrecedenceTracking.cpp +++ b/lib/Analysis/InstructionPrecedenceTracking.cpp @@ -19,6 +19,7 @@ #include "llvm/Analysis/InstructionPrecedenceTracking.h" #include "llvm/Analysis/ValueTracking.h" +#include "llvm/IR/PatternMatch.h" using namespace llvm; @@ -152,5 +153,8 @@ bool ImplicitControlFlowTracking::isSpecialInstruction( bool MemoryWriteTracking::isSpecialInstruction( const Instruction *Insn) const { + using namespace PatternMatch; + if (match(Insn, m_Intrinsic())) + return false; return Insn->mayWriteToMemory(); }