[llvm] 27bbc8e - [Alignment][NFC] Migrate TargetTransformInfo::CreateVariableSizedObject to Align

Guillaume Chatelet via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 07:31:31 PDT 2020


Author: Guillaume Chatelet
Date: 2020-07-01T14:31:21Z
New Revision: 27bbc8ede127fb1ea8b6a853a5d2fe70f206408b

URL: https://github.com/llvm/llvm-project/commit/27bbc8ede127fb1ea8b6a853a5d2fe70f206408b
DIFF: https://github.com/llvm/llvm-project/commit/27bbc8ede127fb1ea8b6a853a5d2fe70f206408b.diff

LOG: [Alignment][NFC] Migrate TargetTransformInfo::CreateVariableSizedObject to Align

This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Differential Revision: https://reviews.llvm.org/D82939

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/MachineFrameInfo.h
    llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/MachineFrameInfo.h b/llvm/include/llvm/CodeGen/MachineFrameInfo.h
index cd6eafb2b571..5cd7f9cde674 100644
--- a/llvm/include/llvm/CodeGen/MachineFrameInfo.h
+++ b/llvm/include/llvm/CodeGen/MachineFrameInfo.h
@@ -785,7 +785,9 @@ class MachineFrameInfo {
   /// created, whether or not the index returned is actually used.
   int CreateVariableSizedObject(Align Alignment, const AllocaInst *Alloca);
   /// FIXME: Remove this function when transition to Align is over.
-  int CreateVariableSizedObject(unsigned Alignment, const AllocaInst *Alloca) {
+  LLVM_ATTRIBUTE_DEPRECATED(int CreateVariableSizedObject(
+                                unsigned Alignment, const AllocaInst *Alloca),
+                            "Use the version that takes an Align instead") {
     return CreateVariableSizedObject(assumeAligned(Alignment), Alloca);
   }
 

diff  --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 7a5fd7d24c68..5cf83cff3a90 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -190,7 +190,7 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf,
           // stack allocation for each one.
           // Inform the Frame Information that we have variable-sized objects.
           MF->getFrameInfo().CreateVariableSizedObject(
-              Alignment <= StackAlign ? 0 : Alignment.value(), AI);
+              Alignment <= StackAlign ? Align(1) : Alignment, AI);
         }
       }
 


        


More information about the llvm-commits mailing list