[llvm] [DirectX] Infrastructure to collect shader flags for each function (PR #112967)
S. Bharadwaj Yadavalli via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 22 08:25:50 PST 2024
================
@@ -13,36 +13,79 @@
#include "DXILShaderFlags.h"
#include "DirectX.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/IR/DiagnosticInfo.h"
+#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Module.h"
+#include "llvm/Support/Error.h"
#include "llvm/Support/FormatVariadic.h"
+#include "llvm/Support/raw_ostream.h"
using namespace llvm;
using namespace llvm::dxil;
-static void updateFlags(ComputedShaderFlags &Flags, const Instruction &I) {
- Type *Ty = I.getType();
- if (Ty->isDoubleTy()) {
- Flags.Doubles = true;
+namespace {
+/// A simple Wrapper DiagnosticInfo that generates Module-level diagnostic
+/// for Shader Flags Analysis pass
+class DiagnosticInfoShaderFlags : public DiagnosticInfo {
+private:
+ const Twine &Msg;
----------------
bharadwajy wrote:
Deleted diagnostic. Error reporting simplified to use `report_fatal_error()` as the anticipated error conditions are not expected to be triggered during analysis of a well-formed module.
https://github.com/llvm/llvm-project/pull/112967
More information about the llvm-commits
mailing list