Skip to content

Commit 91b50c4

Browse files
committed
rename option nvptx-rsqrt-approx-opt
1 parent 7a86448 commit 91b50c4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ using namespace llvm;
3131
#define PASS_NAME "NVPTX DAG->DAG Pattern Instruction Selection"
3232

3333
static cl::opt<bool>
34-
DisableRsqrtOpt("nvptx-disable-rsqrt-opt", cl::init(false), cl::Hidden,
35-
cl::desc("Disable reciprocal sqrt optimization"));
34+
EnableRsqrtOpt("nvptx-rsqrt-approx-opt", cl::init(true), cl::Hidden,
35+
cl::desc("Enable reciprocal sqrt optimization"));
3636

3737
/// createNVPTXISelDag - This pass converts a legalized DAG into a
3838
/// NVPTX-specific DAG, ready for instruction scheduling.
@@ -78,7 +78,7 @@ bool NVPTXDAGToDAGISel::allowUnsafeFPMath() const {
7878
return TL->allowUnsafeFPMath(*MF);
7979
}
8080

81-
bool NVPTXDAGToDAGISel::doRsqrtOpt() const { return !DisableRsqrtOpt; }
81+
bool NVPTXDAGToDAGISel::doRsqrtOpt() const { return EnableRsqrtOpt; }
8282

8383
/// Select - Select instructions not customized! Used for
8484
/// expanded, promoted and normal instructions.

llvm/test/CodeGen/NVPTX/rsqrt-opt.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
; RUN: llc < %s -march=nvptx64 | FileCheck %s --check-prefixes CHECK,CHECK-APPROX-OPT,CHECK-SQRT-NOOPT
22
; RUN: llc < %s -march=nvptx64 -nvptx-prec-sqrtf32=0 | FileCheck %s --check-prefixes CHECK,CHECK-APPROX-OPT,CHECK-SQRT-OPT
3-
; RUN: llc < %s -march=nvptx64 -nvptx-disable-rsqrt-opt | FileCheck %s --check-prefixes CHECK,CHECK-APPROX-NOOPT,CHECK-SQRT-NOOPT
3+
; RUN: llc < %s -march=nvptx64 -nvptx-rsqrt-approx-opt=0 | FileCheck %s --check-prefixes CHECK,CHECK-APPROX-NOOPT,CHECK-SQRT-NOOPT
44
;
55
; RUN: %if ptxas %{ llc < %s -march=nvptx64 | %ptxas-verify %}
66
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -nvptx-prec-sqrtf32=0 | %ptxas-verify %}
7-
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -nvptx-disable-rsqrt-opt | %ptxas-verify %}
7+
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -nvptx-rsqrt-approx-opt=0 | %ptxas-verify %}
88

99

1010
; CHECK-LABEL: .func{{.*}}test1

0 commit comments

Comments
 (0)