[llvm] 1f3d70a - [Transforms][DXIL] Basic debug output in dxil-upgrade. NFC
Justin Bogner via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 20 13:07:15 PST 2023
Author: Justin Bogner
Date: 2023-12-20T14:06:42-07:00
New Revision: 1f3d70a95a98ee77ff31c37f3587dba52fa5f250
URL: https://github.com/llvm/llvm-project/commit/1f3d70a95a98ee77ff31c37f3587dba52fa5f250
DIFF: https://github.com/llvm/llvm-project/commit/1f3d70a95a98ee77ff31c37f3587dba52fa5f250.diff
LOG: [Transforms][DXIL] Basic debug output in dxil-upgrade. NFC
Added:
Modified:
llvm/lib/Transforms/Utils/DXILUpgrade.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/DXILUpgrade.cpp b/llvm/lib/Transforms/Utils/DXILUpgrade.cpp
index 735686ddce381b..09991f628224ce 100644
--- a/llvm/lib/Transforms/Utils/DXILUpgrade.cpp
+++ b/llvm/lib/Transforms/Utils/DXILUpgrade.cpp
@@ -7,14 +7,26 @@
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/Utils/DXILUpgrade.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/Metadata.h"
+#include "llvm/IR/Module.h"
+#include "llvm/Support/Debug.h"
using namespace llvm;
+#define DEBUG_TYPE "dxil-upgrade"
+
static bool handleValVerMetadata(Module &M) {
NamedMDNode *ValVer = M.getNamedMetadata("dx.valver");
if (!ValVer)
return false;
+ LLVM_DEBUG({
+ MDNode *N = ValVer->getOperand(0);
+ auto X = mdconst::extract<ConstantInt>(N->getOperand(0))->getZExtValue();
+ auto Y = mdconst::extract<ConstantInt>(N->getOperand(1))->getZExtValue();
+ dbgs() << "DXIL: validation version: " << X << "." << Y << "\n";
+ });
// We don't need the validation version internally, so we drop it.
ValVer->dropAllReferences();
ValVer->eraseFromParent();
More information about the llvm-commits
mailing list