فهرست منبع

Renamed from "poison" to "invalidate"

Tristan Labelle 6 سال پیش
والد
کامیت
9559442f3f
5فایلهای تغییر یافته به همراه15 افزوده شده و 15 حذف شده
  1. 2 2
      include/dxc/HLSL/DxilGenerationPass.h
  2. 1 1
      lib/HLSL/DxcOptimizer.cpp
  3. 10 10
      lib/HLSL/DxilPreparePasses.cpp
  4. 1 1
      lib/Transforms/IPO/PassManagerBuilder.cpp
  5. 1 1
      utils/hct/hctdb.py

+ 2 - 2
include/dxc/HLSL/DxilGenerationPass.h

@@ -67,7 +67,7 @@ ModulePass *createDxilLegalizeResources();
 ModulePass *createDxilLegalizeEvalOperationsPass();
 ModulePass *createDxilLegalizeEvalOperationsPass();
 FunctionPass *createDxilLegalizeSampleOffsetPass();
 FunctionPass *createDxilLegalizeSampleOffsetPass();
 FunctionPass *createDxilSimpleGVNHoistPass();
 FunctionPass *createDxilSimpleGVNHoistPass();
-ModulePass *createPoisonUndefResourcesPass();
+ModulePass *createInvalidateUndefResourcesPass();
 FunctionPass *createSimplifyInstPass();
 FunctionPass *createSimplifyInstPass();
 ModulePass *createDxilTranslateRawBuffer();
 ModulePass *createDxilTranslateRawBuffer();
 ModulePass *createNoPausePassesPass();
 ModulePass *createNoPausePassesPass();
@@ -99,7 +99,7 @@ void initializeDxilLegalizeResourcesPass(llvm::PassRegistry&);
 void initializeDxilLegalizeEvalOperationsPass(llvm::PassRegistry&);
 void initializeDxilLegalizeEvalOperationsPass(llvm::PassRegistry&);
 void initializeDxilLegalizeSampleOffsetPassPass(llvm::PassRegistry&);
 void initializeDxilLegalizeSampleOffsetPassPass(llvm::PassRegistry&);
 void initializeDxilSimpleGVNHoistPass(llvm::PassRegistry&);
 void initializeDxilSimpleGVNHoistPass(llvm::PassRegistry&);
-void initializePoisonUndefResourcesPass(llvm::PassRegistry&);
+void initializeInvalidateUndefResourcesPass(llvm::PassRegistry&);
 void initializeSimplifyInstPass(llvm::PassRegistry&);
 void initializeSimplifyInstPass(llvm::PassRegistry&);
 void initializeDxilTranslateRawBufferPass(llvm::PassRegistry&);
 void initializeDxilTranslateRawBufferPass(llvm::PassRegistry&);
 void initializeNoPausePassesPass(llvm::PassRegistry&);
 void initializeNoPausePassesPass(llvm::PassRegistry&);

+ 1 - 1
lib/HLSL/DxcOptimizer.cpp

@@ -110,7 +110,7 @@ HRESULT SetupRegistryPassForHLSL() {
     initializeDynamicIndexingVectorToArrayPass(Registry);
     initializeDynamicIndexingVectorToArrayPass(Registry);
     initializeEarlyCSELegacyPassPass(Registry);
     initializeEarlyCSELegacyPassPass(Registry);
     initializeEliminateAvailableExternallyPass(Registry);
     initializeEliminateAvailableExternallyPass(Registry);
-    initializePoisonUndefResourcesPass(Registry);
+    initializeInvalidateUndefResourcesPass(Registry);
     initializeFloat2IntPass(Registry);
     initializeFloat2IntPass(Registry);
     initializeFunctionAttrsPass(Registry);
     initializeFunctionAttrsPass(Registry);
     initializeGVNPass(Registry);
     initializeGVNPass(Registry);

+ 10 - 10
lib/HLSL/DxilPreparePasses.cpp

@@ -36,27 +36,27 @@ using namespace llvm;
 using namespace hlsl;
 using namespace hlsl;
 
 
 namespace {
 namespace {
-class PoisonUndefResources : public ModulePass {
+class InvalidateUndefResources : public ModulePass {
 public:
 public:
   static char ID;
   static char ID;
 
 
-  explicit PoisonUndefResources() : ModulePass(ID) {
+  explicit InvalidateUndefResources() : ModulePass(ID) {
     initializeScalarizerPass(*PassRegistry::getPassRegistry());
     initializeScalarizerPass(*PassRegistry::getPassRegistry());
   }
   }
 
 
-  const char *getPassName() const override { return "Poison undef resources"; }
+  const char *getPassName() const override { return "Invalidate undef resources"; }
 
 
   bool runOnModule(Module &M) override;
   bool runOnModule(Module &M) override;
 };
 };
 }
 }
 
 
-char PoisonUndefResources::ID = 0;
+char InvalidateUndefResources::ID = 0;
 
 
-ModulePass *llvm::createPoisonUndefResourcesPass() { return new PoisonUndefResources(); }
+ModulePass *llvm::createInvalidateUndefResourcesPass() { return new InvalidateUndefResources(); }
 
 
-INITIALIZE_PASS(PoisonUndefResources, "poison-undef-resource", "Poison undef resources", false, false)
+INITIALIZE_PASS(InvalidateUndefResources, "invalidate-undef-resource", "Invalidate undef resources", false, false)
 
 
-bool PoisonUndefResources::runOnModule(Module &M) {
+bool InvalidateUndefResources::runOnModule(Module &M) {
   // Undef resources typically indicate uninitialized locals being used
   // Undef resources typically indicate uninitialized locals being used
   // in some code path, which we should catch and report. However, some
   // in some code path, which we should catch and report. However, some
   // code patterns in large shaders cause dead undef resources to momentarily,
   // code patterns in large shaders cause dead undef resources to momentarily,
@@ -64,7 +64,7 @@ bool PoisonUndefResources::runOnModule(Module &M) {
   // have run to know whether we must produce an error.
   // have run to know whether we must produce an error.
   // However, we can't leave the undef values in because they could eliminated,
   // However, we can't leave the undef values in because they could eliminated,
   // such as by reading from resources seen in a code path that was not taken.
   // such as by reading from resources seen in a code path that was not taken.
-  // We avoid the problem by replacing undef values by another poison
+  // We avoid the problem by replacing undef values by another invalid
   // value that we can identify later.
   // value that we can identify later.
   for (auto &F : M.functions()) {
   for (auto &F : M.functions()) {
     if (GetHLOpcodeGroupByName(&F) == HLOpcodeGroup::HLCreateHandle) {
     if (GetHLOpcodeGroupByName(&F) == HLOpcodeGroup::HLCreateHandle) {
@@ -72,8 +72,8 @@ bool PoisonUndefResources::runOnModule(Module &M) {
         HLOperandIndex::kCreateHandleResourceOpIdx);
         HLOperandIndex::kCreateHandleResourceOpIdx);
       UndefValue *UndefRes = UndefValue::get(ResTy);
       UndefValue *UndefRes = UndefValue::get(ResTy);
       if (!UndefRes->use_empty()) {
       if (!UndefRes->use_empty()) {
-        Constant *PoisonRes = ConstantAggregateZero::get(ResTy);
-        UndefRes->replaceAllUsesWith(PoisonRes);
+        Constant *InvalidRes = ConstantAggregateZero::get(ResTy);
+        UndefRes->replaceAllUsesWith(InvalidRes);
       }
       }
     }
     }
   }
   }

+ 1 - 1
lib/Transforms/IPO/PassManagerBuilder.cpp

@@ -277,7 +277,7 @@ static void addHLSLPasses(bool HLSLHighLevel, unsigned OptLevel, hlsl::HLSLExten
   MPM.add(createDxilPromoteLocalResources());
   MPM.add(createDxilPromoteLocalResources());
   MPM.add(createDxilPromoteStaticResources());
   MPM.add(createDxilPromoteStaticResources());
   // Verify no undef resource again after promotion
   // Verify no undef resource again after promotion
-  MPM.add(createPoisonUndefResourcesPass());
+  MPM.add(createInvalidateUndefResourcesPass());
 
 
   MPM.add(createDxilGenerationPass(NoOpt, ExtHelper));
   MPM.add(createDxilGenerationPass(NoOpt, ExtHelper));
 
 

+ 1 - 1
utils/hct/hctdb.py

@@ -1560,7 +1560,7 @@ class db_dxil(object):
         add_pass('hlsl-dxil-legalize-eval-operations', 'DxilLegalizeEvalOperations', 'DXIL legalize eval operations', [])
         add_pass('hlsl-dxil-legalize-eval-operations', 'DxilLegalizeEvalOperations', 'DXIL legalize eval operations', [])
         add_pass('dxilgen', 'DxilGenerationPass', 'HLSL DXIL Generation', [
         add_pass('dxilgen', 'DxilGenerationPass', 'HLSL DXIL Generation', [
             {'n':'NotOptimized','t':'bool','c':1}])
             {'n':'NotOptimized','t':'bool','c':1}])
-        add_pass('poison-undef-resource', 'PoisonUndefResources', 'Poison undef resources', [])
+        add_pass('invalidate-undef-resource', 'InvalidateUndefResources', 'Invalidate undef resources', [])
         add_pass('simplify-inst', 'SimplifyInst', 'Simplify Instructions', [])
         add_pass('simplify-inst', 'SimplifyInst', 'Simplify Instructions', [])
         add_pass('hlsl-dxil-precise', 'DxilPrecisePropagatePass', 'DXIL precise attribute propagate', [])
         add_pass('hlsl-dxil-precise', 'DxilPrecisePropagatePass', 'DXIL precise attribute propagate', [])
         add_pass('dxil-legalize-sample-offset', 'DxilLegalizeSampleOffsetPass', 'DXIL legalize sample offset', [])
         add_pass('dxil-legalize-sample-offset', 'DxilLegalizeSampleOffsetPass', 'DXIL legalize sample offset', [])