Skip to content

Commit

Permalink
[test] Fix use of 'sort -b' in SimpleLoopUnswitch on NetBSD
Browse files Browse the repository at this point in the history
Add '-k 1' to 'sort -b' calls in SimpleLoopUnswitch tests, as required
for sort implementation on NetBSD.  The '-b' modifier is ineffective
if specified without any key.  Per the manpage:

  Note that the -b option has no effect unless key fields are specified.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348097 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
mgorny committed Dec 2, 2018
1 parent 6008df2 commit 69204ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
; RUN: opt < %s -enable-nontrivial-unswitch -enable-unswitch-cost-multiplier=true \
; RUN: -unswitch-num-initial-unscaled-candidates=4 -unswitch-siblings-toplevel-div=1 \
; RUN: -passes='loop(unswitch),print<loops>' -disable-output 2>&1 | \
; RUN: sort -b | FileCheck %s --check-prefixes=LOOP-UNSCALE4-DIV1
; RUN: sort -b -k 1 | FileCheck %s --check-prefixes=LOOP-UNSCALE4-DIV1
;
; NB: sort -b is essential here and below, otherwise blanks might lead to different
; order depending on locale.
;
; RUN: opt < %s -enable-nontrivial-unswitch -enable-unswitch-cost-multiplier=true \
; RUN: -unswitch-num-initial-unscaled-candidates=4 -unswitch-siblings-toplevel-div=2 \
; RUN: -passes='loop(unswitch),print<loops>' -disable-output 2>&1 | \
; RUN: sort -b | FileCheck %s --check-prefixes=LOOP-UNSCALE4-DIV2
; RUN: sort -b -k 1 | FileCheck %s --check-prefixes=LOOP-UNSCALE4-DIV2
;
;
; Get
Expand All @@ -35,7 +35,7 @@
;
; RUN: opt < %s -enable-nontrivial-unswitch -enable-unswitch-cost-multiplier=false \
; RUN: -passes='loop(unswitch),print<loops>' -disable-output 2>&1 | \
; RUN: sort -b | FileCheck %s --check-prefixes=LOOP32
; RUN: sort -b -k 1 | FileCheck %s --check-prefixes=LOOP32
;
; Single loop nest, not unswitched
; LOOP1: Loop at depth 1 containing:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@
; RUN: opt < %s -enable-nontrivial-unswitch -enable-unswitch-cost-multiplier=true \
; RUN: -unswitch-num-initial-unscaled-candidates=3 -unswitch-siblings-toplevel-div=1 \
; RUN: -passes='loop(unswitch),print<loops>' -disable-output 2>&1 | \
; RUN: sort -b | FileCheck %s --check-prefixes=LOOP-UNSCALE3-DIV1
; RUN: sort -b -k 1 | FileCheck %s --check-prefixes=LOOP-UNSCALE3-DIV1
;
; NB: sort -b is essential here and below, otherwise blanks might lead to different
; order depending on locale.
;
; RUN: opt < %s -enable-nontrivial-unswitch -enable-unswitch-cost-multiplier=true \
; RUN: -unswitch-num-initial-unscaled-candidates=3 -unswitch-siblings-toplevel-div=2 \
; RUN: -passes='loop(unswitch),print<loops>' -disable-output 2>&1 | \
; RUN: sort -b | FileCheck %s --check-prefixes=LOOP-UNSCALE3-DIV2
; RUN: sort -b -k 1 | FileCheck %s --check-prefixes=LOOP-UNSCALE3-DIV2
;
; With disabled cost-multiplier we get maximal possible amount of unswitches.
;
; RUN: opt < %s -enable-nontrivial-unswitch -enable-unswitch-cost-multiplier=false \
; RUN: -passes='loop(unswitch),print<loops>' -disable-output 2>&1 | \
; RUN: sort -b | FileCheck %s --check-prefixes=LOOP-MAX
; RUN: sort -b -k 1 | FileCheck %s --check-prefixes=LOOP-MAX
;
; Single loop nest, not unswitched
; LOOP1: Loop at depth 1 containing:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
; RUN: opt < %s -enable-nontrivial-unswitch -enable-unswitch-cost-multiplier=true \
; RUN: -unswitch-num-initial-unscaled-candidates=8 -unswitch-siblings-toplevel-div=1 \
; RUN: -passes='loop(unswitch),print<loops>' -disable-output 2>&1 | \
; RUN: sort -b | FileCheck %s --check-prefixes=LOOP-RELAX
; RUN: sort -b -k 1 | FileCheck %s --check-prefixes=LOOP-RELAX
;
; With relaxed candidates multiplier (unscaled candidates == 8) and with relaxed
; siblings multiplier for top-level loops (toplevel-div == 8) we should get
Expand All @@ -33,13 +33,13 @@
; RUN: opt < %s -enable-nontrivial-unswitch -enable-unswitch-cost-multiplier=true \
; RUN: -unswitch-num-initial-unscaled-candidates=8 -unswitch-siblings-toplevel-div=8 \
; RUN: -passes='loop(unswitch),print<loops>' -disable-output 2>&1 | \
; RUN: sort -b | FileCheck %s --check-prefixes=LOOP-RELAX2
; RUN: sort -b -k 1 | FileCheck %s --check-prefixes=LOOP-RELAX2
;
; We get hundreds of copies of the loop when cost multiplier is disabled:
;
; RUN: opt < %s -enable-nontrivial-unswitch -enable-unswitch-cost-multiplier=false \
; RUN: -passes='loop(unswitch),print<loops>' -disable-output 2>&1 | \
; RUN: sort -b | FileCheck %s --check-prefixes=LOOP-MAX
; RUN: sort -b -k 1 | FileCheck %s --check-prefixes=LOOP-MAX
;

; Single loop nest, not unswitched
Expand Down

0 comments on commit 69204ee

Please sign in to comment.