From 08434a23a58775bf83f89ef733eaaf5ed44fc580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jovan=20Dmitrovi=C4=87?= Date: Wed, 26 Jul 2023 11:32:20 +0200 Subject: [PATCH] [RISCV] Options for Load/Store pairs --- clang/lib/Driver/ToolChains/Clang.cpp | 4 ++-- llvm/lib/Target/RISCV/RISCVSubtarget.cpp | 2 +- llvm/test/CodeGen/RISCV/load-store-pair.ll | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index d0c8402c883e..234351fb8ca6 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -2089,9 +2089,9 @@ void Clang::AddRISCVTargetArgs(const ArgList &Args, if (Arg *A = Args.getLastArg(options::OPT_mload_store_pairs, options::OPT_mno_load_store_pairs)) { - if (A->getOption().matches(options::OPT_mno_load_store_pairs)) { + if (A->getOption().matches(options::OPT_mload_store_pairs)) { CmdArgs.push_back("-mllvm"); - CmdArgs.push_back("-riscv-load-store-pairs=0"); + CmdArgs.push_back("-riscv-load-store-pairs=1"); } } diff --git a/llvm/lib/Target/RISCV/RISCVSubtarget.cpp b/llvm/lib/Target/RISCV/RISCVSubtarget.cpp index 2464846674e6..c2e5d27f322d 100644 --- a/llvm/lib/Target/RISCV/RISCVSubtarget.cpp +++ b/llvm/lib/Target/RISCV/RISCVSubtarget.cpp @@ -68,7 +68,7 @@ static cl::opt RISCVMinimumJumpTableEntries( static cl::opt UseLoadStorePairsOpt( "riscv-load-store-pairs", cl::desc("RISCV: Optimize for load-store bonding"), - cl::init(true), cl::Hidden); + cl::init(false), cl::Hidden); static cl::opt UseCCMovInsn( "riscv-ccmov", diff --git a/llvm/test/CodeGen/RISCV/load-store-pair.ll b/llvm/test/CodeGen/RISCV/load-store-pair.ll index 96e193136811..c16e38c76075 100644 --- a/llvm/test/CodeGen/RISCV/load-store-pair.ll +++ b/llvm/test/CodeGen/RISCV/load-store-pair.ll @@ -7,15 +7,15 @@ ; RUN: | FileCheck %s -check-prefix=RV64I ; RUN: llc -mtriple=riscv64 -target-abi lp64d -mattr=+d -verify-machineinstrs < %s \ ; RUN: | FileCheck %s -check-prefix=RV64D -; RUN: llc -mtriple=riscv32 -mattr=+load-store-pairs -verify-machineinstrs < %s \ +; RUN: llc -mtriple=riscv32 -mattr=+load-store-pairs -riscv-load-store-pairs=1 -verify-machineinstrs < %s \ ; RUN: | FileCheck %s -check-prefix=RV32I_PAIR -; RUN: llc -mtriple=riscv32 -target-abi ilp32d -mattr=+d,+load-store-pairs -verify-machineinstrs < %s \ +; RUN: llc -mtriple=riscv32 -target-abi ilp32d -mattr=+d,+load-store-pairs -riscv-load-store-pairs=1 -verify-machineinstrs < %s \ ; RUN: | FileCheck %s -check-prefix=RV32D_PAIR -; RUN: llc -mtriple=riscv64 -mattr=+load-store-pairs -verify-machineinstrs < %s \ +; RUN: llc -mtriple=riscv64 -mattr=+load-store-pairs -riscv-load-store-pairs=1 -verify-machineinstrs < %s \ ; RUN: | FileCheck %s -check-prefix=RV64I_PAIR -; RUN: llc -mtriple=riscv64 -mcpu i8500 -verify-machineinstrs < %s \ +; RUN: llc -mtriple=riscv64 -mcpu i8500 -mattr=+load-store-pairs -riscv-load-store-pairs=1 -verify-machineinstrs < %s \ ; RUN: | FileCheck %s -check-prefix=RV64I_8500 -; RUN: llc -mtriple=riscv64 -target-abi lp64d -mattr=+d,+load-store-pairs -verify-machineinstrs < %s \ +; RUN: llc -mtriple=riscv64 -target-abi lp64d -mattr=+d,+load-store-pairs -riscv-load-store-pairs=1 -verify-machineinstrs < %s \ ; RUN: | FileCheck %s -check-prefix=RV64D_PAIR ; RUN: llc -mtriple=riscv64 -target-abi lp64d -mattr=+d -verify-machineinstrs < %s \ ; RUN: | FileCheck %s -check-prefix=RV64D_8500