[PATCH] D114832: [SROA] Improve SROA to prevent generating redundant coalescing operations.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 1 16:07:32 PST 2021


davidxl added a comment.

The key is an aggregate is written field by field (piecemeal), but not read as such (e.g, as a whole), so splitting messes up the IR. For this reason, the pattern should probably be relaxed more (i.e. not requiring constant values in the stores). Example:

struct RetVal {

  int x;
  int y;

};
typedef RetVal (*Parser)();
RetVal Parse(bool test, Parser p, int v) {

  if (test) return {v, v};
  return p();

}


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114832



More information about the llvm-commits mailing list