Index: llvm/trunk/lib/Transforms/Scalar/LoopInterchange.cpp =================================================================== --- llvm/trunk/lib/Transforms/Scalar/LoopInterchange.cpp +++ llvm/trunk/lib/Transforms/Scalar/LoopInterchange.cpp @@ -985,6 +985,13 @@ continue; DEBUG(dbgs() << "Loops with call instructions cannot be interchanged " << "safely."); + ORE->emit([&]() { + return OptimizationRemarkMissed(DEBUG_TYPE, "CallInst", + CI->getDebugLoc(), + CI->getParent()) + << "Cannot interchange loops due to call instruction."; + }); + return false; } Index: llvm/trunk/test/Transforms/LoopInterchange/call-instructions.ll =================================================================== --- llvm/trunk/test/Transforms/LoopInterchange/call-instructions.ll +++ llvm/trunk/test/Transforms/LoopInterchange/call-instructions.ll @@ -1,5 +1,5 @@ -; REQUIRES: asserts -; RUN: opt < %s -basicaa -loop-interchange -verify-dom-info -S -debug 2>&1 | FileCheck %s +; RUN: opt < %s -basicaa -loop-interchange -pass-remarks-missed='loop-interchange' -pass-remarks-output=%t +; RUN: FileCheck --input-file=%t %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" @@ -13,42 +13,37 @@ ;; Not safe to interchange, because the called function `foo` is not marked as ;; readnone, so it could introduce dependences. ;; -;; for(int i=0;i