Skip to content

Commit 1f3d70a

Browse files
committed
[Transforms][DXIL] Basic debug output in dxil-upgrade. NFC
1 parent bbc2976 commit 1f3d70a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

llvm/lib/Transforms/Utils/DXILUpgrade.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,26 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "llvm/Transforms/Utils/DXILUpgrade.h"
10+
#include "llvm/IR/Constants.h"
11+
#include "llvm/IR/Metadata.h"
12+
#include "llvm/IR/Module.h"
13+
#include "llvm/Support/Debug.h"
1014

1115
using namespace llvm;
1216

17+
#define DEBUG_TYPE "dxil-upgrade"
18+
1319
static bool handleValVerMetadata(Module &M) {
1420
NamedMDNode *ValVer = M.getNamedMetadata("dx.valver");
1521
if (!ValVer)
1622
return false;
1723

24+
LLVM_DEBUG({
25+
MDNode *N = ValVer->getOperand(0);
26+
auto X = mdconst::extract<ConstantInt>(N->getOperand(0))->getZExtValue();
27+
auto Y = mdconst::extract<ConstantInt>(N->getOperand(1))->getZExtValue();
28+
dbgs() << "DXIL: validation version: " << X << "." << Y << "\n";
29+
});
1830
// We don't need the validation version internally, so we drop it.
1931
ValVer->dropAllReferences();
2032
ValVer->eraseFromParent();

0 commit comments

Comments
 (0)