[PATCH] D81711: [SDAG] Add new AssertAlign ISD node.

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 08:38:14 PDT 2020


hliao marked an inline comment as done.
hliao added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:3175
+    Known.Zero.setLowBits(LogOfAlign);
+    Known.One.clearLowBits(LogOfAlign);
+    break;
----------------
craig.topper wrote:
> Known.One should already be all 0s.  I don't think you need to clear it. Though maybe you should call computeKnownBits to propagate from the input? Then you would need to clear it.
`AssertAlign` is intended to be used with `align` function attributes, which could be used to annotate alignment on return value or arguments. Most of them are lowered into register copies. It's difficult and almost no way to trace back the original alignment embedded in LLVM IR. `AssertAlign` is added to propagate the alignment info from IR into DAG. It helps `computeKnowBits` instead of relying on it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81711





More information about the llvm-commits mailing list