[LLVMdev] setAlreadyVectorized does not delete obsolete metadata?

Robison, Arch arch.robison at intel.com
Wed Aug 13 13:16:27 PDT 2014


I noticed that LoopVectorizeHints::setAlreadyVectorized never deletes old "llvm.loop...." metadata.  It just appends more, possibly contradicting the old metadata.  E.g., after vectorization, a loop previously marked with llvm.loop.vectorize.width ends up with *two* such annotations, like this:

    br i1 %exitcond.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !8
    ...
    !6 = metadata !{metadata !"llvm.loop.vectorize.width", i32 1}
    !7 = metadata !{metadata !"llvm.loop.interleave.count", i32 1}
    !8 = metadata !{metadata !8, metadata !9, metadata !6, metadata !7}
    !9 = metadata !{metadata !"llvm.loop.vectorize.width", i32 4}

!6 and !9 are in the list for loopID !8 and they specify conflicting widths.  Is this a bug, or is there a deliberate convention that if there are multiple llvm.loop.vectorize.width annotations, only the last one counts?

- Arch D. Robison
  Intel Corporation




More information about the llvm-dev mailing list