[PATCH] D155957: [PPC][AIX] Fix toc-data peephole bug and some related cleanup.
Hubert Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 4 17:32:06 PDT 2023
hubert.reinterpretcast added a comment.
LGTM with minor comments. Thanks for the patch!
================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:7656
+ // model when a global is defined in the TOC.
+ const bool OpcodeIsAIXTocData =
+ BaseOpcode == PPC::ADDItoc || BaseOpcode == PPC::ADDItoc8;
----------------
Suggest rename to `OpcodeIsAIXSmallTocData`.
================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:7663-7664
+ if (OpcodeIsAIXTocData) {
+ RegOperand = Base->getOperand(1);
+ ImmOpnd = Base->getOperand(0);
+ } else {
----------------
Minor nit: Be consistent on whether to call `getOperand` through the `SDValue` or on the `SDNode` directly.
================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:7670-7674
+ SDValue HBase;
bool UpdateHBase = false;
- SDValue HBase = Base.getOperand(0);
int Offset = N->getConstantOperandVal(FirstOp);
+
----------------
Move variables meant to be set by the block to immediately before the block.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D155957/new/
https://reviews.llvm.org/D155957
More information about the llvm-commits
mailing list