Skip to content

Commit

Permalink
[AIE2] Enable HL by default
Browse files Browse the repository at this point in the history
  • Loading branch information
andcarminati committed Aug 1, 2024
1 parent 8febe27 commit fab10ba
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Target/AIE/AIE2TargetTransformInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ using namespace llvm;
static cl::opt<bool>
EnableAIEHardwareLoops("enable-aie-hardware-loops",
cl::desc("Enable hardware loops on AIE"),
cl::init(false), cl::Hidden);
cl::init(true), cl::Hidden);

static cl::opt<bool>
AllowAIEZOL("enable-aie-zero-overhead-loops",
cl::desc("Enable true zero overhead hardware loops on AIE"),
cl::init(false), cl::Hidden);
cl::init(true), cl::Hidden);

static cl::opt<int> MinIterCountHLReject(
"aie-hardware-loops-minitercount", cl::Hidden, cl::init(3),
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/CodeGen/AIE/aie2/end-to-end/Conv2D-red-swp.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
;
; (c) Copyright 2024 Advanced Micro Devices, Inc. or its affiliates
; RUN: llc -O2 -mtriple=aie2 --enable-pipeliner=1 %s -o - | FileCheck %s --check-prefix=DCL
; RUN: llc -O2 -mtriple=aie2 --enable-pipeliner=1 --enable-aie-hardware-loops=true \
; RUN: --enable-aie-zero-overhead-loops=true %s -o - | FileCheck %s --check-prefix=ZOL
; RUN: llc -O2 -mtriple=aie2 --enable-pipeliner=1 --enable-aie-hardware-loops=false \
; RUN: --enable-aie-zero-overhead-loops=false %s -o - | FileCheck %s --check-prefix=DCL
; RUN: llc -O2 -mtriple=aie2 --enable-pipeliner=1 %s -o - | FileCheck %s --check-prefix=ZOL
; RUN: llc -O2 -mtriple=aie2 --enable-pipeliner=0 %s -o - --debug-only=machine-scheduler \
; RUN: 2>&1 | %imisched -d - \
; RUN: | FileCheck %s --check-prefix=SCHED-DUMP
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/AIE/aie2/hardware-loops/nested.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
;
; (c) Copyright 2023-2024 Advanced Micro Devices, Inc. or its affiliates
; RUN: llc -O2 -mtriple=aie2 --issue-limit=1 --enable-aie-hardware-loops \
; RUN: llc -O2 -mtriple=aie2 --issue-limit=1 --enable-aie-zero-overhead-loops=false \
; RUN: --aie-force-hl-gen=true %s -o - | FileCheck %s

; Check that we recognize the two level nested loops as hardware loop candidates.
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/AIE/aie2/hardware-loops/sibling.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
;
; (c) Copyright 2023-2024 Advanced Micro Devices, Inc. or its affiliates
; RUN: llc -O2 -mtriple=aie2 --issue-limit=1 --enable-aie-hardware-loops \
; RUN: llc -O2 -mtriple=aie2 --issue-limit=1 --enable-aie-zero-overhead-loops=false \
; RUN: --aie-force-hl-gen=true %s -o - | FileCheck %s

define void @sibling(ptr nocapture %out, ptr nocapture readonly %in, i32 noundef %size, i32 noundef %size2) {
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/AIE/aie2/hardware-loops/simple.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
;
; (c) Copyright 2023-2024 Advanced Micro Devices, Inc. or its affiliates
; RUN: llc -O2 -mtriple=aie2 --issue-limit=1 --enable-aie-hardware-loops \
; RUN: llc -O2 -mtriple=aie2 --issue-limit=1 --enable-aie-zero-overhead-loops=false \
; RUN: --aie-force-hl-gen=true %s -o - | FileCheck %s

define void @simple(ptr nocapture %out, ptr nocapture readonly %in, i32 noundef %size) {
Expand Down
8 changes: 4 additions & 4 deletions llvm/test/Transforms/HardwareLoops/AIE/profitable.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
;
; (c) Copyright 2023-2024 Advanced Micro Devices, Inc. or its affiliates
; RUN: opt -mtriple=aie2 --passes="hardware-loops" --enable-aie-hardware-loops --aie-force-hl-gen \
; RUN: %s -S -o - | FileCheck %s
; RUN: opt -mtriple=aie2 --passes="hardware-loops" --enable-aie-hardware-loops \
; RUN: --enable-aie-zero-overhead-loops --aie-force-hl-gen %s -S -o - | \
; RUN: opt -mtriple=aie2 --passes="hardware-loops" --aie-force-hl-gen \
; RUN: --enable-aie-zero-overhead-loops=false %s -S -o - | FileCheck %s
; RUN: opt -mtriple=aie2 --passes="hardware-loops" \
; RUN: --aie-force-hl-gen %s -S -o - | \
; RUN: FileCheck %s --check-prefix=CHECK-ZOL

; We can support nested hardware loops.
Expand Down
9 changes: 4 additions & 5 deletions llvm/test/Transforms/HardwareLoops/AIE/unprofitable.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
;
; (c) Copyright 2023-2024 Advanced Micro Devices, Inc. or its affiliates
; RUN: opt -mtriple=aie2 --passes="hardware-loops" --enable-aie-hardware-loops \
; RUN: opt -mtriple=aie2 --passes="hardware-loops" --enable-aie-zero-overhead-loops=false \
; RUN: --aie-force-hl-gen %s -S -o - | FileCheck %s
; RUN: opt -mtriple=aie2 --passes="hardware-loops" --enable-aie-hardware-loops \
; RUN: --enable-aie-zero-overhead-loops --aie-force-hl-gen %s -S -o - | \
; RUN: opt -mtriple=aie2 --passes="hardware-loops" --aie-force-hl-gen %s -S -o - | \
; RUN: FileCheck --check-prefix=CHECK-ZOL %s
; RUN: opt -mtriple=aie2 --passes="hardware-loops" --enable-aie-hardware-loops \
; RUN: -pass-remarks-analysis=hardware-loops --aie-force-hl-gen %s -S -o - 2>&1 | \
; RUN: opt -mtriple=aie2 --passes="hardware-loops" -pass-remarks-analysis=hardware-loops \
; RUN: --aie-force-hl-gen %s -S -o - 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-REMARKS


Expand Down

0 comments on commit fab10ba

Please sign in to comment.