vitalybuka marked an inline comment as done. vitalybuka added inline comments.
================ Comment at: clang/lib/CodeGen/CGDecl.cpp:873 return true; - if (isa<llvm::ConstantInt>(Init) || isa<llvm::ConstantFP>(Init) || + if (BWInit || isa<llvm::ConstantInt>(Init) || isa<llvm::ConstantFP>(Init) || isa<llvm::ConstantVector>(Init) || isa<llvm::BlockAddress>(Init) || ---------------- vitalybuka wrote: > jfb wrote: > > I'm not sure I understand what this bit does. If something isn't a bytewise > > value then we now automatically assume it can be stored to with a single > > store. That's not necessarily true. I think you need to drop `BWInit ||` > > from here, and conditionalize this entire branch with `if (BWInit)` instead > > (so, an `&&` on it all). > If value is bytewise, we will emit BWInit >> If value is bytewise, we will emit BWInit If value is bytewise, we will emit memset, which we can count as one store. It's not always true that memset costs as a single store. However this is a heuristic, as the limit 6 itself. Here I try to keep behavior close to original for zeroes. In future patches I'd like to try to remove this function and use just "density" ((count memset bytes that match initializer)/(full size of initializer)). This will be simpler, should work good enough for exiting cases, and cover new cases with large initializers where 6 is not enough, Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64382/new/ https://reviews.llvm.org/D64382 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits