[llvm] 9308210 - [NFC][Alignment] Use getAlign in DXILBitcodeWriter

Guillaume Chatelet via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 13 06:36:50 PDT 2022


Author: Guillaume Chatelet
Date: 2022-06-13T13:36:36Z
New Revision: 93082108b73d9bed6c959eb172f211e9c62176f8

URL: https://github.com/llvm/llvm-project/commit/93082108b73d9bed6c959eb172f211e9c62176f8
DIFF: https://github.com/llvm/llvm-project/commit/93082108b73d9bed6c959eb172f211e9c62176f8.diff

LOG: [NFC][Alignment] Use getAlign in DXILBitcodeWriter

Added: 
    

Modified: 
    llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp b/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
index f575a3a9d4bf9..0e2773af930eb 100644
--- a/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
+++ b/llvm/lib/Target/DirectX/DXILWriter/DXILBitcodeWriter.cpp
@@ -2461,7 +2461,7 @@ void DXILBitcodeWriter::writeInstruction(const Instruction &I, unsigned InstID,
         AbbrevToUse = (unsigned)FUNCTION_INST_LOAD_ABBREV;
     }
     Vals.push_back(getTypeID(I.getType()));
-    Vals.push_back(Log2_32(cast<LoadInst>(I).getAlignment()) + 1);
+    Vals.push_back(Log2(cast<LoadInst>(I).getAlign()) + 1);
     Vals.push_back(cast<LoadInst>(I).isVolatile());
     if (cast<LoadInst>(I).isAtomic()) {
       Vals.push_back(getEncodedOrdering(cast<LoadInst>(I).getOrdering()));
@@ -2475,7 +2475,7 @@ void DXILBitcodeWriter::writeInstruction(const Instruction &I, unsigned InstID,
       Code = bitc::FUNC_CODE_INST_STORE;
     pushValueAndType(I.getOperand(1), InstID, Vals); // ptrty + ptr
     pushValueAndType(I.getOperand(0), InstID, Vals); // valty + val
-    Vals.push_back(Log2_32(cast<StoreInst>(I).getAlignment()) + 1);
+    Vals.push_back(Log2(cast<StoreInst>(I).getAlign()) + 1);
     Vals.push_back(cast<StoreInst>(I).isVolatile());
     if (cast<StoreInst>(I).isAtomic()) {
       Vals.push_back(getEncodedOrdering(cast<StoreInst>(I).getOrdering()));


        


More information about the llvm-commits mailing list