Skip to content

Commit ebf3cce

Browse files
committed
address comments
1 parent e78887d commit ebf3cce

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp

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

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

7373
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
@@ -215,7 +215,7 @@ class NVPTXTargetLowering : public TargetLowering {
215215
// Get the degree of precision we want from 32-bit floating point division
216216
// operations.
217217
NVPTX::DivPrecisionLevel getDivF32Level(const MachineFunction &MF,
218-
const SDNode *N) const;
218+
const SDNode &N) const;
219219

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

0 commit comments

Comments
 (0)