File tree Expand file tree Collapse file tree
llvm/lib/Transforms/Instrumentation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -873,11 +873,12 @@ void ThreadSanitizer::eliminateInstrByPrePostDominance(
873873 if (CurrUnderlyingObj == DomUnderlyingObj ||
874874 (CurrUnderlyingObj && DomUnderlyingObj &&
875875 AA->isMustAlias (CurrAddr, DomAddr))) {
876- const bool CurrIsWrite =
877- isa<StoreInst>(*CurrInst) ||
878- (CurrII.Flags & InstructionInfo::kCompoundRW );
879- const bool DomIsWrite = isa<StoreInst>(*DomInst) ||
880- (DomII.Flags & InstructionInfo::kCompoundRW );
876+ auto isWriteOperation = [](const InstructionInfo &II) {
877+ return isa<StoreInst>(II.Inst ) ||
878+ (II.Flags & InstructionInfo::kCompoundRW );
879+ };
880+ const bool CurrIsWrite = isWriteOperation (CurrII);
881+ const bool DomIsWrite = isWriteOperation (DomII);
881882
882883 // Check compatibility logic (DomInst covers CurrInst):
883884 // 1. If DomInst is a write, it covers both read and write of
You can’t perform that action at this time.
0 commit comments