[PATCH] D121898: [Verifier] Verify parameter alignment.

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 21 06:04:11 PDT 2022


pengfei added inline comments.


================
Comment at: llvm/lib/IR/Verifier.cpp:3149-3157
+    Align ABIAlign = DL.getABITypeAlign(Ty);
+    // ArgFlagsTy::MemAlign only have 4 bits for alignment, so the
+    // alignment size should not exceed 2^15. Since encode(Align)
+    // would plus the shift value by 1, the alignment size should
+    // not exceed 2^14, otherwise it can NOT be properly lowered
+    // in backend.
+    Align MaxAlign(1 << 15);
----------------
The variables are only used in Assert, should add `#ifndef NDEBUG` to them? Surprisingly I didn't find an example in this file.


================
Comment at: llvm/test/Verifier/param-ret-align.ll:1
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+
----------------
Can we merge them to one file?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121898



More information about the llvm-commits mailing list