[PATCH] D127443: [InstCombine] add zeroinitializer handling to memchr folders

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 07:44:10 PDT 2022


nikic added a comment.

The resulting API here seems pretty unfortunate, because the zeroinitializer case needs to be handled separately from the rest. I also find the fact that passing in ZeroInit changes the interpretation of null bytes somewhat unintuitive.

I think a cleaner alternative would be to accept an additional `std::string *Storage = nullptr` parameter, which gets populated with the zero-filled string, and can then be handled as a StringRef in the same way as all the other cases.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127443/new/

https://reviews.llvm.org/D127443



More information about the llvm-commits mailing list