[PATCH] D137848: [ConstraintElimination] Add Decomposition class (NFCI)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 12 00:40:47 PST 2022


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:196
+/// Represents an Offset + Coefficient1 * Variable1 + ... decomposition.
+struct Decomposition {
+  int64_t Offset = 0;
----------------
fhahn wrote:
> Could this be a `class` instead of a `struct` to ensure the offsets are only adjusted using the safe methods?
What would we do with the code in `ConstraintInfo::getConstraint`, which actually uses the decomposition in that case? Read-only getters?


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

https://reviews.llvm.org/D137848



More information about the llvm-commits mailing list