[llvm] [PowerPC] Peephole address calculation in TOC memops (PR #76488)

Sean Fertile via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 07:23:49 PDT 2024


================
@@ -7662,238 +7662,212 @@ static void foldADDIForLocalExecAccesses(SDNode *N, SelectionDAG *DAG) {
     DAG->RemoveDeadNode(InitialADDI.getNode());
 }
 
-void PPCDAGToDAGISel::PeepholePPC64() {
-  SelectionDAG::allnodes_iterator Position = CurDAG->allnodes_end();
-
-  while (Position != CurDAG->allnodes_begin()) {
-    SDNode *N = &*--Position;
-    // Skip dead nodes and any non-machine opcodes.
-    if (N->use_empty() || !N->isMachineOpcode())
-      continue;
+static bool isValidMemOp(SDNode *N, bool &IsLoad, MaybeAlign &ExtraAlign) {
----------------
mandlebug wrote:

I had a previous comment about splitting this function up which seems to have got lost in one of the rebases but can still be seen from the conversation. I still think splitting this up can help make the calling code much clearer. Also isn't `ExtraAlign`  an encoding limitation and not an alignment?

https://github.com/llvm/llvm-project/pull/76488


More information about the llvm-commits mailing list