[llvm] [Utils] Use boolean false, not 0 (NFC) (PR #99828)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 21 16:41:46 PDT 2024


https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/99828

>From 7cce6ce4e7e5d92ecd9ede1a5434f18d19c431bb Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Sun, 21 Jul 2024 13:36:12 -0400
Subject: [PATCH] [Utils] Use boolean false, not 0 (NFC)

---
 llvm/lib/Transforms/Utils/DXILResource.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Transforms/Utils/DXILResource.cpp b/llvm/lib/Transforms/Utils/DXILResource.cpp
index bf45654a591b5..de2b6512a6d1c 100644
--- a/llvm/lib/Transforms/Utils/DXILResource.cpp
+++ b/llvm/lib/Transforms/Utils/DXILResource.cpp
@@ -329,8 +329,8 @@ std::pair<uint32_t, uint32_t> ResourceInfo::getAnnotateProps() const {
   uint32_t ResourceKind = llvm::to_underlying(Kind);
   uint32_t AlignLog2 = isStruct() ? Log2(Struct.Alignment) : 0;
   bool IsUAV = isUAV();
-  bool IsROV = IsUAV ? UAVFlags.IsROV : 0;
-  bool IsGloballyCoherent = IsUAV ? UAVFlags.GloballyCoherent : 0;
+  bool IsROV = IsUAV && UAVFlags.IsROV;
+  bool IsGloballyCoherent = IsUAV && UAVFlags.GloballyCoherent;
   uint8_t SamplerCmpOrHasCounter = 0;
   if (IsUAV)
     SamplerCmpOrHasCounter = UAVFlags.HasCounter;



More information about the llvm-commits mailing list