[PATCH] D34467: [SelectionDAG] set dereferenceable flag when expanding memcpy/memmove

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 22 09:59:02 PDT 2017


inouehrs added inline comments.


================
Comment at: lib/CodeGen/MachineInstr.cpp:576
+  // to specify the size and offset for isDereferenceablePointer.
+  unsigned PtrSize = DL.getPointerSize();
+  SmallVector<Value*, 1> Idxs;
----------------
hfinkel wrote:
> Creating temporary instructions in helper functions is something we try very hard not to do. Please don't do it here.
> 
> The underlying isDereferenceableAndAlignedPointer implementation function in lib/Analysis/Loads.cpp actually takes a size. Feel free to expose an interface directly to that functionality if necessary.
> 
I added an interface to pass size as a parameter in isDereferenceableAndAlignedPointer and eliminated the temporary instructions in the helper.
Thank you for the suggestion.



https://reviews.llvm.org/D34467





More information about the llvm-commits mailing list