Skip to content

Commit 2da5928

Browse files
[Target] Remove unnecessary casts (NFC) (#149342)
getFunction().getParent() already returns Module *.
1 parent 2d7ff09 commit 2da5928

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9308,7 +9308,7 @@ SDValue SITargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
93089308
return DAG.getNode(AMDGPUISD::PERM, DL, MVT::i32, Op.getOperand(1),
93099309
Op.getOperand(2), Op.getOperand(3));
93109310
case Intrinsic::amdgcn_reloc_constant: {
9311-
Module *M = const_cast<Module *>(MF.getFunction().getParent());
9311+
Module *M = MF.getFunction().getParent();
93129312
const MDNode *Metadata = cast<MDNodeSDNode>(Op.getOperand(1))->getMD();
93139313
auto SymbolName = cast<MDString>(Metadata->getOperand(0))->getString();
93149314
auto *RelocSymbol = cast<GlobalVariable>(

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3545,8 +3545,7 @@ SDValue ARMTargetLowering::LowerConstantPool(SDValue Op,
35453545
auto AFI = DAG.getMachineFunction().getInfo<ARMFunctionInfo>();
35463546
auto T = const_cast<Type*>(CP->getType());
35473547
auto C = const_cast<Constant*>(CP->getConstVal());
3548-
auto M = const_cast<Module*>(DAG.getMachineFunction().
3549-
getFunction().getParent());
3548+
auto M = DAG.getMachineFunction().getFunction().getParent();
35503549
auto GV = new GlobalVariable(
35513550
*M, T, /*isConstant=*/true, GlobalVariable::InternalLinkage, C,
35523551
Twine(DAG.getDataLayout().getPrivateGlobalPrefix()) + "CP" +

0 commit comments

Comments
 (0)