flyingforyou added a comment. Thanks Geoff. Is that safe for other optimization passes? Actually, I am not sure that merging memref lists is safe. If you think it is safe, I will do that. please let me know. http://reviews.llvm.org/D14797