[PATCH] D128128: [GlobalOpt] Perform store->dominated load forwarding for stored once globals

Aaron H Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 22 09:42:40 PDT 2022


AaronLiu added a comment.

Reduced TC that fail with `-O3 -flto`:

  int counter = 0;
  
  struct S {
          int m;
          S(int i=0) : m(i) { }
          S(S&) { counter++; }
          S& operator=(S&) { counter++; return *this; }
  } s;
  
  int main(void)
  {
          try {   
                  try {   
                          throw s;
                  }
                  catch (...) {
                          counter = 0;
                          throw;
                  }
          }
          catch (...) {
          }
  
          if (counter != 0) {
                  return 1;
          }
  
          return  0;
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128128



More information about the llvm-commits mailing list