[llvm] c212183 - [DirectX] add maybe_unused to IsVolatile in legalizeMemCpy. (#143040)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 5 17:41:07 PDT 2025


Author: Farzon Lotfi
Date: 2025-06-05T20:41:03-04:00
New Revision: c21218312ee241de020e440330bb0ec7e557031b

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

LOG: [DirectX] add maybe_unused to IsVolatile in legalizeMemCpy. (#143040)

fixes a warning when building release.

Added: 
    

Modified: 
    llvm/lib/Target/DirectX/DXILLegalizePass.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/DirectX/DXILLegalizePass.cpp b/llvm/lib/Target/DirectX/DXILLegalizePass.cpp
index 79b0cf261ba31..76a46c7a2b760 100644
--- a/llvm/lib/Target/DirectX/DXILLegalizePass.cpp
+++ b/llvm/lib/Target/DirectX/DXILLegalizePass.cpp
@@ -470,7 +470,8 @@ static void legalizeMemCpy(Instruction &I,
   Value *Src = CI->getArgOperand(1);
   ConstantInt *Length = dyn_cast<ConstantInt>(CI->getArgOperand(2));
   assert(Length && "Expected Length to be a ConstantInt");
-  ConstantInt *IsVolatile = dyn_cast<ConstantInt>(CI->getArgOperand(3));
+  [[maybe_unused]] ConstantInt *IsVolatile =
+      dyn_cast<ConstantInt>(CI->getArgOperand(3));
   assert(IsVolatile && "Expected IsVolatile to be a ConstantInt");
   assert(IsVolatile->getZExtValue() == 0 && "Expected IsVolatile to be false");
   emitMemcpyExpansion(Builder, Dst, Src, Length);


        


More information about the llvm-commits mailing list