[all-commits] [llvm/llvm-project] c401db: [llvm][IROutliner] Account for return void in sort...

David Spickett via All-commits all-commits at lists.llvm.org
Fri Aug 5 02:36:58 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c401dbde71fdfdbdb0e77df54429408bab903991
      https://github.com/llvm/llvm-project/commit/c401dbde71fdfdbdb0e77df54429408bab903991
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2022-08-05 (Fri, 05 Aug 2022)

  Changed paths:
    M llvm/lib/Transforms/IPO/IROutliner.cpp

  Log Message:
  -----------
  [llvm][IROutliner] Account for return void in sort comparator

This fixes 69 llvm tests that failed when EXPENSIVE_CHECKS was enabled.
llvm/test/Transforms/IROutliner/outlining-commutative-operands-opposite-order.ll
is one example.

When we have EXPENSIVE_CHECKS, _GLIBCXX_DEBUG is defined. This means
that libstdc++ will call the compare function to check if it is
implemented correctly (that !(a < a) is true).

This happens even if there is only one item and here, we expect
to see one return void or multiple return constant integer.

Don't sort if we have 1 item, but do assert that it is the 1
ret void we expect. In the comparator, assert that neither
Value is a nullptr in case one ended up in a the list somehow.

Reviewed By: AndrewLitteken

Differential Revision: https://reviews.llvm.org/D130230




More information about the All-commits mailing list