[llvm] [MachineBlockPlacement][X86] Use max of MDAlign and TLIAlign to align Loops. (PR #71026)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 00:54:27 PST 2023


================
@@ -66,6 +67,14 @@ class MachineLoop : public LoopBase<MachineBasicBlock, MachineLoop> {
   /// it returns an unknown location.
   DebugLoc getStartLoc() const;
 
+  /// \brief Find the llvm.loop metadata for this loop.
+  /// If each branch to the header of this loop contains the same llvm.loop
+  /// metadata, then this metadata node is returned. Otherwise, if any
+  /// latch instruction does not contain the llvm.loop metadata or
+  /// multiple latch instructions contain different llvm.loop metadata nodes,
+  /// then null is returned.
----------------
KanRobert wrote:

Why null? Should we use the max value of alignment if multiple latch instructions contain different `llvm.loop` metadata nodes.

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


More information about the llvm-commits mailing list