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

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 5 15:57:40 PDT 2025


https://github.com/farzonl updated https://github.com/llvm/llvm-project/pull/143040

>From 134879972d3858598656b53a0ed987a1886d3703 Mon Sep 17 00:00:00 2001
From: Farzon Lotfi <farzonlotfi at microsoft.com>
Date: Thu, 5 Jun 2025 18:37:28 -0400
Subject: [PATCH] [DirectX] add maybe_unused to IsVolatile in legalizeMemCpy.

---
 llvm/lib/Target/DirectX/DXILLegalizePass.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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