[PATCH] D20262: [DSE]Split memset when the memset is small enough to be lowered to stores

Jun Bum Lim via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 08:47:37 PDT 2016


junbuml added a comment.

> http://llvm.org/docs/doxygen/html/Module_8cpp_source.html#l00375

> "const DataLayout &Module::getDataLayout() const { return DL; }"

> It returns a reference, so it is guaranteed to not be null.

> "No data layout in the Textual IR means "use the default data layout" for the triple."


Thanks for clarifying this. So, we are guaranteed to DL even without datalayout in the textual IR. However, this doesn't mean that we can always get the non-zero from DL.getLargestLegalIntTypeSizeInBits().  As I test, we can use an empty datalayout in IR like : target datalayout="".

> Wouldn't DL.getLargestLegalIntTypeSizeInBits() == 0 imply that you can have icmp or select? Hence almost nothing in llvm would work?


Although we can make DL.getLargestLegalIntTypeSizeInBits() return  0, I also doubt when this is meaningful. If this doesn't make sense, I will add  assert in getLargestLegalIntTypeSizeInBits().  Can anyone give us any feedback if there is any situation where we need to consider getLargestLegalIntTypeSizeInBits() == 0 ?  As far as I test, I didn't see any unit test failure with the assert in getLargestLegalIntTypeSizeInBits() == 0.


http://reviews.llvm.org/D20262





More information about the llvm-commits mailing list