Skip to content

[CodeGen] Remove IsVolatile from DominatingValue<RValue>::save_type #95165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2024

Conversation

ahatanak
Copy link
Collaborator

Prior to 84780af, the class didn't have any information about whether the saved value was volatile.

This is NFC as far as I can tell.

Prior to 84780af, the class didn't have
any information about whether the saved value was volatile.

This is NFC as far as I can tell.
@ahatanak ahatanak marked this pull request as ready for review June 11, 2024 19:23
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:codegen IR generation bugs: mangling, exceptions, etc. labels Jun 11, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 11, 2024

@llvm/pr-subscribers-clang-codegen

Author: Akira Hatanaka (ahatanak)

Changes

Prior to 84780af, the class didn't have any information about whether the saved value was volatile.

This is NFC as far as I can tell.


Full diff: https://github.com/llvm/llvm-project/pull/95165.diff

2 Files Affected:

  • (modified) clang/lib/CodeGen/CGCleanup.cpp (+5-5)
  • (modified) clang/lib/CodeGen/CodeGenFunction.h (+1-3)
diff --git a/clang/lib/CodeGen/CGCleanup.cpp b/clang/lib/CodeGen/CGCleanup.cpp
index 469e0363b744a..4e210a9e3c95f 100644
--- a/clang/lib/CodeGen/CGCleanup.cpp
+++ b/clang/lib/CodeGen/CGCleanup.cpp
@@ -48,10 +48,10 @@ DominatingValue<RValue>::saved_type::save(CodeGenFunction &CGF, RValue rv) {
 
   assert(rv.isAggregate());
   Address V = rv.getAggregateAddress();
-  return saved_type(
-      DominatingValue<Address>::save(CGF, V), rv.isVolatileQualified(),
-      DominatingValue<Address>::needsSaving(V) ? AggregateAddress
-                                               : AggregateLiteral);
+  return saved_type(DominatingValue<Address>::save(CGF, V),
+                    DominatingValue<Address>::needsSaving(V)
+                        ? AggregateAddress
+                        : AggregateLiteral);
 }
 
 /// Given a saved r-value produced by SaveRValue, perform the code
@@ -65,7 +65,7 @@ RValue DominatingValue<RValue>::saved_type::restore(CodeGenFunction &CGF) {
   case AggregateLiteral:
   case AggregateAddress:
     return RValue::getAggregate(
-        DominatingValue<Address>::restore(CGF, AggregateAddr), IsVolatile);
+        DominatingValue<Address>::restore(CGF, AggregateAddr));
   case ComplexAddress: {
     llvm::Value *real = DominatingLLVMValue::restore(CGF, Vals.first);
     llvm::Value *imag = DominatingLLVMValue::restore(CGF, Vals.second);
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 5739fbaaa9194..06fc7259b5901 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -221,7 +221,6 @@ template <> struct DominatingValue<RValue> {
     };
     LLVM_PREFERRED_TYPE(Kind)
     unsigned K : 3;
-    unsigned IsVolatile : 1;
 
     saved_type(DominatingLLVMValue::saved_type Val1, unsigned K)
         : Vals{Val1, DominatingLLVMValue::saved_type()}, K(K) {}
@@ -230,8 +229,7 @@ template <> struct DominatingValue<RValue> {
                DominatingLLVMValue::saved_type Val2)
         : Vals{Val1, Val2}, K(ComplexAddress) {}
 
-    saved_type(DominatingValue<Address>::saved_type AggregateAddr,
-               bool IsVolatile, unsigned K)
+    saved_type(DominatingValue<Address>::saved_type AggregateAddr, unsigned K)
         : AggregateAddr(AggregateAddr), K(K) {}
 
   public:

@llvmbot
Copy link
Member

llvmbot commented Jun 11, 2024

@llvm/pr-subscribers-clang

Author: Akira Hatanaka (ahatanak)

Changes

Prior to 84780af, the class didn't have any information about whether the saved value was volatile.

This is NFC as far as I can tell.


Full diff: https://github.com/llvm/llvm-project/pull/95165.diff

2 Files Affected:

  • (modified) clang/lib/CodeGen/CGCleanup.cpp (+5-5)
  • (modified) clang/lib/CodeGen/CodeGenFunction.h (+1-3)
diff --git a/clang/lib/CodeGen/CGCleanup.cpp b/clang/lib/CodeGen/CGCleanup.cpp
index 469e0363b744a..4e210a9e3c95f 100644
--- a/clang/lib/CodeGen/CGCleanup.cpp
+++ b/clang/lib/CodeGen/CGCleanup.cpp
@@ -48,10 +48,10 @@ DominatingValue<RValue>::saved_type::save(CodeGenFunction &CGF, RValue rv) {
 
   assert(rv.isAggregate());
   Address V = rv.getAggregateAddress();
-  return saved_type(
-      DominatingValue<Address>::save(CGF, V), rv.isVolatileQualified(),
-      DominatingValue<Address>::needsSaving(V) ? AggregateAddress
-                                               : AggregateLiteral);
+  return saved_type(DominatingValue<Address>::save(CGF, V),
+                    DominatingValue<Address>::needsSaving(V)
+                        ? AggregateAddress
+                        : AggregateLiteral);
 }
 
 /// Given a saved r-value produced by SaveRValue, perform the code
@@ -65,7 +65,7 @@ RValue DominatingValue<RValue>::saved_type::restore(CodeGenFunction &CGF) {
   case AggregateLiteral:
   case AggregateAddress:
     return RValue::getAggregate(
-        DominatingValue<Address>::restore(CGF, AggregateAddr), IsVolatile);
+        DominatingValue<Address>::restore(CGF, AggregateAddr));
   case ComplexAddress: {
     llvm::Value *real = DominatingLLVMValue::restore(CGF, Vals.first);
     llvm::Value *imag = DominatingLLVMValue::restore(CGF, Vals.second);
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index 5739fbaaa9194..06fc7259b5901 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -221,7 +221,6 @@ template <> struct DominatingValue<RValue> {
     };
     LLVM_PREFERRED_TYPE(Kind)
     unsigned K : 3;
-    unsigned IsVolatile : 1;
 
     saved_type(DominatingLLVMValue::saved_type Val1, unsigned K)
         : Vals{Val1, DominatingLLVMValue::saved_type()}, K(K) {}
@@ -230,8 +229,7 @@ template <> struct DominatingValue<RValue> {
                DominatingLLVMValue::saved_type Val2)
         : Vals{Val1, Val2}, K(ComplexAddress) {}
 
-    saved_type(DominatingValue<Address>::saved_type AggregateAddr,
-               bool IsVolatile, unsigned K)
+    saved_type(DominatingValue<Address>::saved_type AggregateAddr, unsigned K)
         : AggregateAddr(AggregateAddr), K(K) {}
 
   public:

@ahatanak ahatanak merged commit ad7a9d6 into llvm:main Jun 12, 2024
12 checks passed
@ahatanak ahatanak deleted the remove-isvolatile branch June 12, 2024 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:codegen IR generation bugs: mangling, exceptions, etc. clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants