[PATCH] [LoopVectorize]Teach Loop Vectorizer about interleaved memory access

Renato Golin renato.golin at linaro.org
Mon May 18 05:56:12 PDT 2015


================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:401
@@ +400,3 @@
+
+    delete this;
+  }
----------------
Ouch, no!

If you do this, than a perfectly valid sequence like this:

    group.eraseFromMap(Map);
    group.getDelta(); // there's no way to know that this won't work

will segfault.

A quick fix would be to leave the deletion to whomever is calling the function, so it's clear on the lifetime of the object:

    group.eraseFromMap(Map);
    group.getDelta();
    delete group;
    group.getReverse(); // this is obviously wrong

But again, it seems to me that such logic is spread out too much. 

So a better fix would be to coalesce all of it into a class in itself. One that contains the maps, the groups, and the control over the lifetime of all its groups in a consistent way, without requiring the caller to know about it.

I'm ok with the temporary solution, as long as you add a FIXME to that effect.

http://reviews.llvm.org/D9368

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list