[PATCH] Don't try to emit loopVectorize warning if DebugLoc isn't available

Davide Italiano dccitaliano at gmail.com
Sat May 2 18:25:57 PDT 2015


Hi nadav, dexonsmith,

This is a (hopefullly) reasonable attempt to fix PR23380 
https://llvm.org/bugs/show_bug.cgi?id=23380

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9463

Files:
  lib/Transforms/Vectorize/LoopVectorize.cpp

Index: lib/Transforms/Vectorize/LoopVectorize.cpp
===================================================================
--- lib/Transforms/Vectorize/LoopVectorize.cpp
+++ lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -1144,17 +1144,20 @@
 
 static void emitMissedWarning(Function *F, Loop *L,
                               const LoopVectorizeHints &LH) {
+  DebugLoc DL = L->getStartLoc();
+  if (!DL)
+    return;
   emitOptimizationRemarkMissed(F->getContext(), DEBUG_TYPE, *F,
-                               L->getStartLoc(), LH.emitRemark());
+                               DL, LH.emitRemark());
 
   if (LH.getForce() == LoopVectorizeHints::FK_Enabled) {
     if (LH.getWidth() != 1)
       emitLoopVectorizeWarning(
-          F->getContext(), *F, L->getStartLoc(),
+          F->getContext(), *F, DL,
           "failed explicitly specified loop vectorization");
     else if (LH.getInterleave() != 1)
       emitLoopInterleaveWarning(
-          F->getContext(), *F, L->getStartLoc(),
+          F->getContext(), *F, DL,
           "failed explicitly specified loop interleaving");
   }
 }

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9463.24863.patch
Type: text/x-patch
Size: 1099 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150503/ba839413/attachment.bin>


More information about the llvm-commits mailing list