[PATCH] D153829: [AArch64] Move branch relaxation after bbsection assignment

Daniel Hoekwater via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 12:01:12 PDT 2023


dhoekwater added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetPassConfig.h:443
+  /// instructions are finalized. All passes a target implements in this
+  /// function can assume that no pass after it will modify or move any
+  /// instructions. Note that the first pass in this function *can* modify and
----------------
arsenm wrote:
> This is quite the claim, given that the wonderfully named "addPreEmitPass2" already exist
I assumed that because addPreEmitPass2 happens after branch relaxation on AArch64 that it’s true on other targets, but ARM shows that’s not true. I’ll have to update this to loosen the guarantees to “happens after basic block sections are assigned”.


================
Comment at: llvm/include/llvm/CodeGen/TargetPassConfig.h:444
+  /// function can assume that no pass after it will modify or move any
+  /// instructions. Note that the first pass in this function *can* modify and
+  /// insert instructions as necessary, but no subsequent passes can do so.
----------------
arsenm wrote:
> I don't understand this, how can such a restriction exist on the use of this?
It can’t for the same reasons that your other comment addresses, so I’ll have to remove this. I named and documentation this function as I did to convey some of the invariants of the pipeline at the point they’re called, but now I’m confused. Are there _any_ guarantees between `addPreEmitPass` and `addPreEmitPass2` other than Pass 2 happening after pass 1?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153829



More information about the llvm-commits mailing list