[PATCH] D86844: [LoopDeletion] Allows deletion of possibly infinite side-effect free loops

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 05:08:37 PST 2021


xbolva00 added a comment.

  int a, b;
  
  int f(void) {
      while (1) {
          if (a != b) return 1;
      }
      return 0;
  }
  
  int g(int a, int b) {
      while (1) {
          if (a != b) return 1;
      }
      return 0;
  }

LLVM does not catch these cases; gcc does.

https://godbolt.org/z/jW7son


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86844



More information about the llvm-commits mailing list