[all-commits] [llvm/llvm-project] aaaeb4: [SCEV] Use mustprogress flag on loops (in addition...

Philip Reames via All-commits all-commits at lists.llvm.org
Thu Jun 10 13:20:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aaaeb4b160fe94e0ad3bcd6073eea4807f84a33a
      https://github.com/llvm/llvm-project/commit/aaaeb4b160fe94e0ad3bcd6073eea4807f84a33a
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-06-10 (Thu, 10 Jun 2021)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/test/Analysis/ScalarEvolution/trip-count-unknown-stride.ll

  Log Message:
  -----------
  [SCEV] Use mustprogress flag on loops (in addition to function attribute)

This addresses a performance regression reported against 3c6e4191.  That change (correctly) limited a transform based on assumed finiteness to mustprogress loops, but the previous change (38540d7) which introduced the mustprogress check utility only handled function attributes, not the loop metadata form.

It turns out that clang uses the function attribute form for C++, and the loop metadata form for C.  As a result, 3c6e4191 ended up being a large regression in practice for C code as loops weren't being considered mustprogress despite the language semantics.




More information about the All-commits mailing list