[PATCH] D148622: [LoongArch] Align functions and loops better according to uarch

Lu Weining via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 2 00:15:36 PDT 2023


SixWeining added inline comments.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp:200
+  // Set preferred alignments.
+  setPrefFunctionAlignment(STI.getPrefFunctionAlignment());
+  setPrefLoopAlignment(STI.getPrefLoopAlignment());
----------------
Almost all parts of this constructor use the member variable `Subtarget` but not the parameter `STI` except line 187 which I will change it later.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchSubtarget.h:55
+  Align PrefLoopAlignment;
+  unsigned MaxBytesForLoopAlignment = 0;
 
----------------
Is this initial value useful? `PrefFunctionAlignment` and `PrefLoopAlignment` do not have initial values?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148622/new/

https://reviews.llvm.org/D148622



More information about the llvm-commits mailing list