[clang] [CIR][NFCI] Update RValue class to reflect changes in classic CodeGen (PR #142779)

Sirui Mu via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 14 07:43:46 PDT 2025


================
@@ -34,28 +32,85 @@ namespace clang::CIRGen {
 class RValue {
   enum Flavor { Scalar, Complex, Aggregate };
 
-  // Stores first value and flavor.
-  llvm::PointerIntPair<mlir::Value, 2, Flavor> v1;
-  // Stores second value and volatility.
-  llvm::PointerIntPair<llvm::PointerUnion<mlir::Value, int *>, 1, bool> v2;
-  // Stores element type for aggregate values.
-  mlir::Type elementType;
+  union {
+    // Stores first and second value.
+    struct {
+      mlir::Value first;
+      mlir::Value second;
+    } vals;
----------------
Lancern wrote:

In the incubator, complex values are also represented by a single `mlir::Value` rather than a pair of `mlir::Value`s, which is different from classic CodeGen. Should we further update this definition to reflect this?

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


More information about the cfe-commits mailing list