[PATCH] D63547: [AIX]Global Address Lowering
Hubert Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 1 21:16:12 PDT 2019
hubert.reinterpretcast added inline comments.
================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:5132
+ EVT VT = isPPC64 ? MVT::i64 : MVT::i32;
+ SDNode *Tmp = CurDAG->getMachineNode((isPPC64) ? PPC::ADDIStocHA8 :
+ PPC::ADDIStocHA, dl, VT, TOCbase,
----------------
Remove the extra parentheses and use `clang-format`:
```
SDNode *Tmp = CurDAG->getMachineNode(
isPPC64 ? PPC::ADDIStocHA8 : PPC::ADDIStocHA, dl, VT, TOCbase, GA);
```
================
Comment at: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp:5139
// the address.
- SDNode *MN = CurDAG->getMachineNode(PPC::LDtocL, dl, MVT::i64, GA,
+ SDNode *MN = CurDAG->getMachineNode((isPPC64) ? PPC::LDtocL :
+ PPC::LWZtocL, dl, VT, GA,
----------------
Same comment.
```
SDNode *MN = CurDAG->getMachineNode(isPPC64 ? PPC::LDtocL : PPC::LWZtocL,
dl, VT, GA, SDValue(Tmp, 0));
```
================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:2671
+static SDValue getTOCEntry(SelectionDAG &DAG, const SDLoc &dl, SDValue GA) {
+ const PPCSubtarget& Subtarget =
+ static_cast<const PPCSubtarget&>(DAG.getSubtarget());
----------------
To be consistent with how the function parameters are declared (note the positioning of the space):
```
const PPCSubtarget &Subtarget =
```
Anyhow, I would much like to avoid having this cast here. Can this function be made a private member function of `PPCTargetLowering`?
================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:2673
+ static_cast<const PPCSubtarget&>(DAG.getSubtarget());
+ bool Is64Bit = Subtarget.isPPC64();
EVT VT = Is64Bit ? MVT::i64 : MVT::i32;
----------------
This can be `const`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63547/new/
https://reviews.llvm.org/D63547
More information about the llvm-commits
mailing list