Skip to content

Commit 18b064b

Browse files
committed
address comments
1 parent ac4d834 commit 18b064b

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ bool NVPTXDAGToDAGISel::runOnMachineFunction(MachineFunction &MF) {
6868

6969
NVPTX::DivPrecisionLevel
7070
NVPTXDAGToDAGISel::getDivF32Level(const SDNode *N) const {
71-
return Subtarget->getTargetLowering()->getDivF32Level(*MF, N);
71+
return Subtarget->getTargetLowering()->getDivF32Level(*MF, *N);
7272
}
7373

7474
bool NVPTXDAGToDAGISel::usePrecSqrtF32() const {

llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static cl::opt<bool> ForceMinByValParamAlign(
116116

117117
NVPTX::DivPrecisionLevel
118118
NVPTXTargetLowering::getDivF32Level(const MachineFunction &MF,
119-
const SDNode *N) const {
119+
const SDNode &N) const {
120120
// If nvptx-prec-div32=N is used on the command-line, always honor it
121121
if (UsePrecDivF32.getNumOccurrences() > 0)
122122
return UsePrecDivF32;
@@ -125,11 +125,9 @@ NVPTXTargetLowering::getDivF32Level(const MachineFunction &MF,
125125
if (allowUnsafeFPMath(MF))
126126
return NVPTX::DivPrecisionLevel::Approx;
127127

128-
if (N) {
129-
const SDNodeFlags Flags = N->getFlags();
130-
if (Flags.hasApproximateFuncs())
131-
return NVPTX::DivPrecisionLevel::Approx;
132-
}
128+
const SDNodeFlags Flags = N.getFlags();
129+
if (Flags.hasApproximateFuncs())
130+
return NVPTX::DivPrecisionLevel::Approx;
133131

134132
return NVPTX::DivPrecisionLevel::IEEE754;
135133
}

llvm/lib/Target/NVPTX/NVPTXISelLowering.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class NVPTXTargetLowering : public TargetLowering {
217217
// Get the degree of precision we want from 32-bit floating point division
218218
// operations.
219219
NVPTX::DivPrecisionLevel getDivF32Level(const MachineFunction &MF,
220-
const SDNode *N) const;
220+
const SDNode &N) const;
221221

222222
// Get whether we should use a precise or approximate 32-bit floating point
223223
// sqrt instruction.

llvm/lib/Target/NVPTX/NVPTXInstrInfo.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ def FDIV32ri :
12941294
//
12951295
// F32 Accurate reciprocal
12961296
//
1297-
def FDIV321r_prec_ftz :
1297+
def FRCP32r_prec_ftz :
12981298
NVPTXInst<(outs Float32Regs:$dst),
12991299
(ins Float32Regs:$b),
13001300
"rcp.rn.ftz.f32 \t$dst, $b;",

0 commit comments

Comments
 (0)