2
0
Эх сурвалжийг харах

Fix line endings and add .gitattributes for default eol normalization (#1597)

Tex Riddell 7 жил өмнө
parent
commit
9ffa90c1e8

+ 1 - 0
.gitattributes

@@ -0,0 +1 @@
+*       text=auto

+ 1 - 1
include/dxc/HLSL/DxilFallbackLayerPass.h

@@ -12,7 +12,7 @@
 #pragma once
 
 namespace llvm {
-    ModulePass *createDxilUpdateMetadataPass();
+    ModulePass *createDxilUpdateMetadataPass();
     ModulePass *createDxilPatchShaderRecordBindingsPass();
 
     void initializeDxilUpdateMetadataPass(llvm::PassRegistry&);

+ 39 - 39
lib/Transforms/Scalar/HoistConstantArray.cpp

@@ -192,23 +192,23 @@ std::vector<StoreInst *> CandidateArray::GetArrayStores() const {
   std::vector<StoreInst *> stores;
   for (User *U : m_Alloca->users())
     if (GEPOperator *gep = dyn_cast<GEPOperator>(U))
-      GetArrayStores(gep, stores);
+      GetArrayStores(gep, stores);
   return stores;
 }
 
-// Recursively collect all the stores that write to the pointer/buffer
+// Recursively collect all the stores that write to the pointer/buffer
 // referred to by this GetElementPtrInst.
 void CandidateArray::GetArrayStores(GEPOperator *gep,
                                     std::vector<StoreInst *> &stores) const {
-  for (User *GU : gep->users()) {
-    if (StoreInst *SI = dyn_cast<StoreInst>(GU)) {
-      stores.push_back(SI);
-    }
-    else if (GEPOperator *GEPI = dyn_cast<GEPOperator>(GU)) {
-      GetArrayStores(GEPI, stores);
-    }
-  }
-}
+  for (User *GU : gep->users()) {
+    if (StoreInst *SI = dyn_cast<StoreInst>(GU)) {
+      stores.push_back(SI);
+    }
+    else if (GEPOperator *GEPI = dyn_cast<GEPOperator>(GU)) {
+      GetArrayStores(GEPI, stores);
+    }
+  }
+}
 // Check to see that all the users of the array are GEPs.
 // If so, populate the `geps` vector with a list of all geps that use the array.
 bool CandidateArray::AllArrayUsersAreGEP(std::vector<GEPOperator *> &geps) {
@@ -228,7 +228,7 @@ bool CandidateArray::AllArrayUsersAreGEP(std::vector<GEPOperator *> &geps) {
 //  1. A store of a constant value that does not overwrite an existing constant
 //     with a different value.
 //  2. A load instruction.
-//  3. Another GetElementPtrInst that itself only has valid uses (recursively)
+//  3. Another GetElementPtrInst that itself only has valid uses (recursively)
 // Any other use is considered invalid.
 bool CandidateArray::AllGEPUsersAreValid(GEPOperator *gep) {
   for (User *U : gep->users()) {
@@ -236,10 +236,10 @@ bool CandidateArray::AllGEPUsersAreValid(GEPOperator *gep) {
       if (!AnalyzeStore(SI))
         return false;
     }
-    else if (GEPOperator *recursive_gep = dyn_cast<GEPOperator>(U)) {
-      if (!AllGEPUsersAreValid(recursive_gep))
-        return false;
-    }
+    else if (GEPOperator *recursive_gep = dyn_cast<GEPOperator>(U)) {
+      if (!AllGEPUsersAreValid(recursive_gep))
+        return false;
+    }
     else if (!isa<LoadInst>(U)) {
       return false;
     }
@@ -273,34 +273,34 @@ void CandidateArray::AnalyzeUses() {
 bool CandidateArray::AnalyzeStore(StoreInst *SI) {
   if (!isa<Constant>(SI->getValueOperand()))
     return false;
-  // Walk up the ladder of GetElementPtr instructions to accumulate the index
-  int64_t index = 0;
-  for (auto iter = SI->getPointerOperand(); iter != m_Alloca;) {
-    GEPOperator *gep = cast<GEPOperator>(iter);
+  // Walk up the ladder of GetElementPtr instructions to accumulate the index
+  int64_t index = 0;
+  for (auto iter = SI->getPointerOperand(); iter != m_Alloca;) {
+    GEPOperator *gep = cast<GEPOperator>(iter);
     if (!gep->hasAllConstantIndices())
       return false;
 
-    // Deal with the 'extra 0' index from what might have been a global pointer
-    // https://www.llvm.org/docs/GetElementPtr.html#why-is-the-extra-0-index-required
-    if ((gep->getNumIndices() == 2) && (gep->getPointerOperand() == m_Alloca)) {
-      // Non-zero offset is unexpected, but could occur in the wild. Bail out if
-      // we see it.
-      ConstantInt *ptrOffset = cast<ConstantInt>(gep->getOperand(1));
+    // Deal with the 'extra 0' index from what might have been a global pointer
+    // https://www.llvm.org/docs/GetElementPtr.html#why-is-the-extra-0-index-required
+    if ((gep->getNumIndices() == 2) && (gep->getPointerOperand() == m_Alloca)) {
+      // Non-zero offset is unexpected, but could occur in the wild. Bail out if
+      // we see it.
+      ConstantInt *ptrOffset = cast<ConstantInt>(gep->getOperand(1));
       if (!ptrOffset->isZero())
         return false;
-    }
-    else if (gep->getNumIndices() != 1) {
-      return false;
-    }
-
-    // Accumulate the index
-    ConstantInt *c = cast<ConstantInt>(gep->getOperand(gep->getNumIndices()));
-    index += c->getSExtValue();
-
-    iter = gep->getPointerOperand();
-  }
-
-  return StoreConstant(index, cast<Constant>(SI->getValueOperand()));
+    }
+    else if (gep->getNumIndices() != 1) {
+      return false;
+    }
+
+    // Accumulate the index
+    ConstantInt *c = cast<ConstantInt>(gep->getOperand(gep->getNumIndices()));
+    index += c->getSExtValue();
+
+    iter = gep->getPointerOperand();
+  }
+
+  return StoreConstant(index, cast<Constant>(SI->getValueOperand()));
 }
 
 // Check if the store is valid and record the value if so.

+ 2 - 2
tools/clang/lib/CodeGen/CGHLSLMS.cpp

@@ -1950,8 +1950,8 @@ void CGMSHLSLRuntime::RemapObsoleteSemantic(DxilParameterAnnotation &paramInfo,
   const ShaderModel *SM = m_pHLModule->GetShaderModel();
   DXIL::SigPointKind sigPointKind = SigPointFromInputQual(paramInfo.GetParamInputQual(), SM->GetKind(), isPatchConstantFunction);
 
-  hlsl::RemapObsoleteSemantic(paramInfo, sigPointKind, CGM.getLLVMContext());
-}
+  hlsl::RemapObsoleteSemantic(paramInfo, sigPointKind, CGM.getLLVMContext());
+}
 
 void CGMSHLSLRuntime::EmitHLSLFunctionProlog(Function *F, const FunctionDecl *FD) {
   // Support clip plane need debug info which not available when create function attribute.

+ 12 - 12
tools/clang/test/CodeGenHLSL/quick-test/anon_struct.hlsl

@@ -1,12 +1,12 @@
-// RUN: %dxc -T ps_6_0 -E main %s | FileCheck %s
-
-// CHECK: %"$Globals" = type { %struct.anon }
-// CHECK: @dx.op.cbufferLoadLegacy
-
-struct {
-    int X;
-} CB;
-
-float main(int N : A, int C : B) : SV_TARGET {
-    return CB.X;
-}
+// RUN: %dxc -T ps_6_0 -E main %s | FileCheck %s
+
+// CHECK: %"$Globals" = type { %struct.anon }
+// CHECK: @dx.op.cbufferLoadLegacy
+
+struct {
+    int X;
+} CB;
+
+float main(int N : A, int C : B) : SV_TARGET {
+    return CB.X;
+}

+ 45 - 45
tools/clang/test/CodeGenHLSL/quick-test/global-var-write-test01.hlsl

@@ -1,46 +1,46 @@
-// RUN: %dxc -E main -T ps_6_0 /Gec -HV 2016 > %s | FileCheck %s
-
-// Writing to globals only supported with HV <= 2016
-// CHECK: define void @main
-// CHECK: ret void
-
-float g_s;
-float4 g_v = float4(1.0, -1.0, 0.0, 1.0);
-// TODO: writing to a global matrix currently causes the compiler to crash. fix it.
-// int2x2 g_m;
-bool g_b = false;
-int g_a[5];
-int g_a2d[3][2];
-float4 main(uint a
-            : A) : SV_Target {
-  // update global scalar
-  g_s = a;
-
-  // update global vector
-  g_v = float4(a + 1, a + 2, a + 3, a + 4);
-
-  /*
-  // update global matrix
-  for (uint i = 0; i < 2; i++)
-    for (uint j = 0; j < 2; j++)
-      g_m[i][j] = a + i + j;
-  */
-  
-  // update global 2d array
-  for (uint i = 0; i < 3; i++)
-    for (uint j = 0; j < 2; j++)
-      g_a2d[i][j] = a + i + j;
-
-  // update global array
-  for (uint i = 0; i < 5; i++)
-    g_a[i] = a + i;
-
-  // update global boolean
-  g_b = true;
-
-  return float4(g_s, g_s, g_s, g_s) +
-         g_v +
-         // float4(g_m[0][0], g_m[0][1], g_m[1][0], g_m[1][1]) +
-         float4(g_a2d[0][0], g_a2d[0][1], g_a2d[1][0], g_a2d[1][1]) +
-         float4(g_a[0], g_a[1], g_a[2], g_a[3]);
+// RUN: %dxc -E main -T ps_6_0 /Gec -HV 2016 > %s | FileCheck %s
+
+// Writing to globals only supported with HV <= 2016
+// CHECK: define void @main
+// CHECK: ret void
+
+float g_s;
+float4 g_v = float4(1.0, -1.0, 0.0, 1.0);
+// TODO: writing to a global matrix currently causes the compiler to crash. fix it.
+// int2x2 g_m;
+bool g_b = false;
+int g_a[5];
+int g_a2d[3][2];
+float4 main(uint a
+            : A) : SV_Target {
+  // update global scalar
+  g_s = a;
+
+  // update global vector
+  g_v = float4(a + 1, a + 2, a + 3, a + 4);
+
+  /*
+  // update global matrix
+  for (uint i = 0; i < 2; i++)
+    for (uint j = 0; j < 2; j++)
+      g_m[i][j] = a + i + j;
+  */
+  
+  // update global 2d array
+  for (uint i = 0; i < 3; i++)
+    for (uint j = 0; j < 2; j++)
+      g_a2d[i][j] = a + i + j;
+
+  // update global array
+  for (uint i = 0; i < 5; i++)
+    g_a[i] = a + i;
+
+  // update global boolean
+  g_b = true;
+
+  return float4(g_s, g_s, g_s, g_s) +
+         g_v +
+         // float4(g_m[0][0], g_m[0][1], g_m[1][0], g_m[1][1]) +
+         float4(g_a2d[0][0], g_a2d[0][1], g_a2d[1][0], g_a2d[1][1]) +
+         float4(g_a[0], g_a[1], g_a[2], g_a[3]);
 }

+ 13 - 13
tools/clang/test/CodeGenHLSL/quick-test/global-var-write-test02.hlsl

@@ -1,14 +1,14 @@
-// RUN: %dxc -E main -T ps_6_0 /Gec -HV 2016 2> %s | FileCheck %s
-
-// Modifying local const should fail even with HV <= 2016
-// CHECK: warning: /Gec flag is a deprecated functionality.
-// CHECK: error: cannot assign to variable 'l_s' with const-qualified type 'const int'
-// CHECK: note: variable 'l_s' declared const here
-
-float main(uint a
-           : A) : SV_Target {
-  // update global scalar
-  const int l_s = 1;
-  l_s *= 2;
-  return 1.33f * l_s;
+// RUN: %dxc -E main -T ps_6_0 /Gec -HV 2016 2> %s | FileCheck %s
+
+// Modifying local const should fail even with HV <= 2016
+// CHECK: warning: /Gec flag is a deprecated functionality.
+// CHECK: error: cannot assign to variable 'l_s' with const-qualified type 'const int'
+// CHECK: note: variable 'l_s' declared const here
+
+float main(uint a
+           : A) : SV_Target {
+  // update global scalar
+  const int l_s = 1;
+  l_s *= 2;
+  return 1.33f * l_s;
 }

+ 20 - 20
tools/clang/test/CodeGenHLSL/quick-test/global-var-write-test03.hlsl

@@ -1,21 +1,21 @@
-// RUN: %dxc -T ps_6_0 -E PSMain /Gec -HV 2016 > %s | FileCheck %s
-
-// CHECK: {{.*cbvar.*}} = constant float 0.000000e+00, align 4
-// CHECK: define void @PSMain()
-// CHECK: call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %"$Globals_cbuffer", i32 0)
-// CHECK: %{{[a-z0-9]+.*[a-z0-9]*}} = fadd fast float %{{[a-z0-9]+.*[a-z0-9]*}}, 5.000000e+00
-// CHECK: %{{[a-z0-9]+.*[a-z0-9]*}} = fmul fast float %{{[a-z0-9]+.*[a-z0-9]*}}, 3.000000e+00
-// CHECK: ret void
-
-float cbvar;
-
-void AddVal() { cbvar += 5.0; }
-void MulVal() { cbvar *= 3.0; }
-float GetVal() { return cbvar; }
-
-float PSMain() : SV_Target
-{
-  AddVal();
-  MulVal();
-  return GetVal();
+// RUN: %dxc -T ps_6_0 -E PSMain /Gec -HV 2016 > %s | FileCheck %s
+
+// CHECK: {{.*cbvar.*}} = constant float 0.000000e+00, align 4
+// CHECK: define void @PSMain()
+// CHECK: call %dx.types.CBufRet.f32 @dx.op.cbufferLoadLegacy.f32(i32 59, %dx.types.Handle %"$Globals_cbuffer", i32 0)
+// CHECK: %{{[a-z0-9]+.*[a-z0-9]*}} = fadd fast float %{{[a-z0-9]+.*[a-z0-9]*}}, 5.000000e+00
+// CHECK: %{{[a-z0-9]+.*[a-z0-9]*}} = fmul fast float %{{[a-z0-9]+.*[a-z0-9]*}}, 3.000000e+00
+// CHECK: ret void
+
+float cbvar;
+
+void AddVal() { cbvar += 5.0; }
+void MulVal() { cbvar *= 3.0; }
+float GetVal() { return cbvar; }
+
+float PSMain() : SV_Target
+{
+  AddVal();
+  MulVal();
+  return GetVal();
 }

+ 45 - 45
tools/clang/test/CodeGenHLSL/quick-test/global-var-write-test04.hlsl

@@ -1,46 +1,46 @@
-// RUN: %dxc -E main -fcgl -T ps_6_0 /Gec -HV 2016 > %s | FileCheck %s
-
-// Writing to globals only supported with HV <= 2016
-
-// CHECK: {{.*g_s1.*}} = constant float 0.000000e+00, align 4
-// CHECK: {{.*g_s2.*}} = constant float 0.000000e+00, align 4
-// CHECK: {{.*g_v.*}} = constant <4 x float> zeroinitializer, align 4
-// CHECK: {{.*g_m1.*}} = constant %class.matrix.int.2.2 zeroinitializer, align 4
-// CHECK: {{.*g_m2.*}} = constant %class.matrix.int.2.2 zeroinitializer, align 4
-// CHECK: {{.*g_b.*}} = constant i32 0, align 1
-// CHECK: {{.*g_a.*}} = constant [5 x i32] zeroinitializer, align 4
-// CHECK: {{.*g_a2d.*}} = constant [3 x [2 x i32]] zeroinitializer, align 4
-// CHECK-NOT: {{(.*g_s1.*)(.*static.copy.*)}} = internal global float 0.000000e+00
-// CHECK: {{(.*g_s2.*)(.*static.copy.*)}} = internal global float 0.000000e+00
-// CHECK-NOT: {{(.*g_v.*)(.*static.copy.*)}} = internal global <4 x float> zeroinitializer
-// CHECK-NOT: {{(.*g_m1.*)(.*static.copy.*)}} = internal global %class.matrix.int.2.2 zeroinitializer
-// CHECK: {{(.*g_m2.*)(.*static.copy.*)}} = internal global %class.matrix.int.2.2 zeroinitializer
-// CHECK-NOT: {{(.*g_b.*)(.*static.copy.*)}} = internal global i32 0
-// CHECK-NOT: {{(.*g_a.*)(.*static.copy.*)}} = internal global [5 x i32] zeroinitializer
-// CHECK-NOT: {{(.*g_a2d.*)(.*static.copy.*)}} = internal global [3 x [2 x i32]] zeroinitializer
-// CHECK: define <4 x float> @main
-// CHECK: ret %dx.types.Handle undef
-
-float g_s1;
-float g_s2; // write enabled
-float4 g_v;
-int2x2 g_m1;
-int2x2 g_m2; // write enabled
-bool g_b;
-int g_a[5];
-int g_a2d[3][2];
-float4 main(uint a
-            : A) : SV_Target {
-  g_s2 = a * 2.0f;
-  
-  for (uint i = 0; i < 2; i++)
-    for (uint j = 0; j < 2; j++)
-      g_m2[i][j] = a + i + j;
-
-      
-  return float4(g_s1, g_s1, g_s2, g_s2) +
-         g_v +
-         float4(g_m1[0][0], g_m1[0][1], g_m2[1][0], g_m2[1][1]) +
-         float4(g_a2d[0][0], g_a2d[0][1], g_a2d[1][0], g_a2d[1][1]) +
-         float4(g_a[0], g_a[1], g_a[2], g_a[3]);
+// RUN: %dxc -E main -fcgl -T ps_6_0 /Gec -HV 2016 > %s | FileCheck %s
+
+// Writing to globals only supported with HV <= 2016
+
+// CHECK: {{.*g_s1.*}} = constant float 0.000000e+00, align 4
+// CHECK: {{.*g_s2.*}} = constant float 0.000000e+00, align 4
+// CHECK: {{.*g_v.*}} = constant <4 x float> zeroinitializer, align 4
+// CHECK: {{.*g_m1.*}} = constant %class.matrix.int.2.2 zeroinitializer, align 4
+// CHECK: {{.*g_m2.*}} = constant %class.matrix.int.2.2 zeroinitializer, align 4
+// CHECK: {{.*g_b.*}} = constant i32 0, align 1
+// CHECK: {{.*g_a.*}} = constant [5 x i32] zeroinitializer, align 4
+// CHECK: {{.*g_a2d.*}} = constant [3 x [2 x i32]] zeroinitializer, align 4
+// CHECK-NOT: {{(.*g_s1.*)(.*static.copy.*)}} = internal global float 0.000000e+00
+// CHECK: {{(.*g_s2.*)(.*static.copy.*)}} = internal global float 0.000000e+00
+// CHECK-NOT: {{(.*g_v.*)(.*static.copy.*)}} = internal global <4 x float> zeroinitializer
+// CHECK-NOT: {{(.*g_m1.*)(.*static.copy.*)}} = internal global %class.matrix.int.2.2 zeroinitializer
+// CHECK: {{(.*g_m2.*)(.*static.copy.*)}} = internal global %class.matrix.int.2.2 zeroinitializer
+// CHECK-NOT: {{(.*g_b.*)(.*static.copy.*)}} = internal global i32 0
+// CHECK-NOT: {{(.*g_a.*)(.*static.copy.*)}} = internal global [5 x i32] zeroinitializer
+// CHECK-NOT: {{(.*g_a2d.*)(.*static.copy.*)}} = internal global [3 x [2 x i32]] zeroinitializer
+// CHECK: define <4 x float> @main
+// CHECK: ret %dx.types.Handle undef
+
+float g_s1;
+float g_s2; // write enabled
+float4 g_v;
+int2x2 g_m1;
+int2x2 g_m2; // write enabled
+bool g_b;
+int g_a[5];
+int g_a2d[3][2];
+float4 main(uint a
+            : A) : SV_Target {
+  g_s2 = a * 2.0f;
+  
+  for (uint i = 0; i < 2; i++)
+    for (uint j = 0; j < 2; j++)
+      g_m2[i][j] = a + i + j;
+
+      
+  return float4(g_s1, g_s1, g_s2, g_s2) +
+         g_v +
+         float4(g_m1[0][0], g_m1[0][1], g_m2[1][0], g_m2[1][1]) +
+         float4(g_a2d[0][0], g_a2d[0][1], g_a2d[1][0], g_a2d[1][1]) +
+         float4(g_a[0], g_a[1], g_a[2], g_a[3]);
 }

+ 14 - 14
tools/clang/test/CodeGenHLSL/quick-test/global-var-write-test05.hlsl

@@ -1,14 +1,14 @@
-// RUN: %dxc -E main -T ps_6_0 /Gec -HV 2016 > %s | FileCheck %s
-
-// CHECK: define void @main()
-// CHECK: ret void
-
-RWTexture2D<float3> Color : register(u0);
-groupshared uint PixelCountH;
-
-uint main( uint2 a : A, float3 b : B ) : SV_Target
-{
- Color[a] = b; 
- PixelCountH = Color[a].x * 1;
- return PixelCountH;
-}
+// RUN: %dxc -E main -T ps_6_0 /Gec -HV 2016 > %s | FileCheck %s
+
+// CHECK: define void @main()
+// CHECK: ret void
+
+RWTexture2D<float3> Color : register(u0);
+groupshared uint PixelCountH;
+
+uint main( uint2 a : A, float3 b : B ) : SV_Target
+{
+ Color[a] = b; 
+ PixelCountH = Color[a].x * 1;
+ return PixelCountH;
+}

+ 13 - 13
tools/clang/test/CodeGenHLSL/quick-test/matrix_idx_with_expr_test01.hlsl

@@ -1,14 +1,14 @@
-// RUN: %dxc -E main -T ps_6_0 > %s | FileCheck %s
-
-// CHECK: define void @main()
-// CHECK: %{{[a-z0-9]+}} = shl i32 %{{[a-z0-9]+}}, 2
-// CHECK: %{{[a-z0-9]+}} = and i32 %{{[a-z0-9]+}}, 8
-// CHECK: %{{[a-z0-9]+}} = or i32 %{{[a-z0-9]+}}, 20
-// CHECK: %{{[a-z0-9]+}} = getelementptr inbounds [4 x float], [4 x float]* %{{[a-z0-9]+}}, i32 0, i32 %{{[a-z0-9]+}}
-// CHECK: %{{[a-z0-9]+}} = getelementptr inbounds [4 x float], [4 x float]* %{{[a-z0-9]+}}, i32 0, i32 %{{[a-z0-9]+}}
-// CHECK: entry
-
-float4x4 buf;
-float main(uint a : A) : SV_Target {
- return buf[a >> 2][(((a & 3) | 5) * 4)] * buf[2][a << 2];
+// RUN: %dxc -E main -T ps_6_0 > %s | FileCheck %s
+
+// CHECK: define void @main()
+// CHECK: %{{[a-z0-9]+}} = shl i32 %{{[a-z0-9]+}}, 2
+// CHECK: %{{[a-z0-9]+}} = and i32 %{{[a-z0-9]+}}, 8
+// CHECK: %{{[a-z0-9]+}} = or i32 %{{[a-z0-9]+}}, 20
+// CHECK: %{{[a-z0-9]+}} = getelementptr inbounds [4 x float], [4 x float]* %{{[a-z0-9]+}}, i32 0, i32 %{{[a-z0-9]+}}
+// CHECK: %{{[a-z0-9]+}} = getelementptr inbounds [4 x float], [4 x float]* %{{[a-z0-9]+}}, i32 0, i32 %{{[a-z0-9]+}}
+// CHECK: entry
+
+float4x4 buf;
+float main(uint a : A) : SV_Target {
+ return buf[a >> 2][(((a & 3) | 5) * 4)] * buf[2][a << 2];
 }

+ 82 - 82
tools/clang/tools/dotnetc/EditorForm.cs

@@ -89,32 +89,32 @@ namespace MainNs
         private const uint DFCC_ILDB = 1111772233;
         private const uint DFCC_SPDB = 1111773267;
 
-        private TabPage HelpTabPage
+        private TabPage HelpTabPage
         {
-            get
-            {
+            get
+            {
                 if (this.helpTabPage == null)
                 {
                     this.helpTabPage = new TabPage("Help");
                     this.AnalysisTabControl.TabPages.Add(helpTabPage);
                 }
-                return this.helpTabPage;
-            }
+                return this.helpTabPage;
+            }
         }
 
-        private RichTextBox HelpControl
-        {
-            get
-            {
-                if (this.helpControl == null)
-                {
-                    this.helpControl = new RichTextBox();
-                    this.HelpTabPage.Controls.Add(this.helpControl);
-                    this.helpControl.Dock = DockStyle.Fill;
-                    this.helpControl.Font = this.CodeBox.Font;
-                }
-                return this.helpControl;
-            }
+        private RichTextBox HelpControl
+        {
+            get
+            {
+                if (this.helpControl == null)
+                {
+                    this.helpControl = new RichTextBox();
+                    this.HelpTabPage.Controls.Add(this.helpControl);
+                    this.helpControl.Dock = DockStyle.Fill;
+                    this.helpControl.Font = this.CodeBox.Font;
+                }
+                return this.helpControl;
+            }
         }
 
         private TabPage RenderViewTabPage
@@ -2784,35 +2784,35 @@ namespace MainNs
 
             string payloadText = GetShaderOpPayload();
 
-            if (this.settingsManager.ExternalRenderEnabled)
-            {
-                string path = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "dndxc-ext-render.xml");
-                try
-                {
-                    System.IO.File.WriteAllText(path, payloadText);
-                }
-                catch (Exception writeErr)
-                {
-                    HandleException(writeErr, "Unable to write render input to " + path);
-                    return;
-                }
-                try
-                {
-                    string arguments = this.settingsManager.ExternalRenderCommand;
-                    arguments = arguments.Replace("%in", path);
-                    var process = System.Diagnostics.Process.Start("cmd.exe", "/c " + arguments);
-                    if (process != null)
-                    {
-                        process.Dispose();
-                    }
-                }
-                catch (Exception runErr)
-                {
-                    HandleException(runErr, "Unable to run external render command.");
-                    return;
-                }
-
-                return;
+            if (this.settingsManager.ExternalRenderEnabled)
+            {
+                string path = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "dndxc-ext-render.xml");
+                try
+                {
+                    System.IO.File.WriteAllText(path, payloadText);
+                }
+                catch (Exception writeErr)
+                {
+                    HandleException(writeErr, "Unable to write render input to " + path);
+                    return;
+                }
+                try
+                {
+                    string arguments = this.settingsManager.ExternalRenderCommand;
+                    arguments = arguments.Replace("%in", path);
+                    var process = System.Diagnostics.Process.Start("cmd.exe", "/c " + arguments);
+                    if (process != null)
+                    {
+                        process.Dispose();
+                    }
+                }
+                catch (Exception runErr)
+                {
+                    HandleException(runErr, "Unable to run external render command.");
+                    return;
+                }
+
+                return;
             }
 
             try
@@ -3370,21 +3370,21 @@ namespace MainNs
             string resultText = "";
             IDxcBlob source = null;
             {
-                try
-                {
-                    var result = compiler.Compile(this.CreateBlobForCodeText(), fileName, fileVars.Entry, fileVars.Target, args, args.Length, null, 0, library.CreateIncludeHandler());
-                    if (result.GetStatus() == 0)
-                    {
-                        source = result.GetResult();
-                    }
-                    else
-                    {
-                        resultText = GetStringFromBlob(result.GetErrors());
-                    }
+                try
+                {
+                    var result = compiler.Compile(this.CreateBlobForCodeText(), fileName, fileVars.Entry, fileVars.Target, args, args.Length, null, 0, library.CreateIncludeHandler());
+                    if (result.GetStatus() == 0)
+                    {
+                        source = result.GetResult();
+                    }
+                    else
+                    {
+                        resultText = GetStringFromBlob(result.GetErrors());
+                    }
                 }
-                catch (System.ArgumentException e)
-                {
-                    MessageBox.Show(this, $"{e.Message}.", "Invalid form entry");
+                catch (System.ArgumentException e)
+                {
+                    MessageBox.Show(this, $"{e.Message}.", "Invalid form entry");
                 }
             }
             return new HighLevelCompileResult() { Blob = source, ResultText = resultText };
@@ -3440,29 +3440,29 @@ namespace MainNs
             form.Sections = TextSection.EnumerateSections(new string[] { "MODULE-PRINT", "Phase:" }, opt.ResultText).ToArray();
             form.StartPosition = FormStartPosition.CenterParent;
             form.Show(this);
-        }
-
-        private void CodeBox_HelpRequested(object sender, HelpEventArgs hlpevent)
-        {
-            RichTextBox rtb = this.CodeBox;
+        }
+
+        private void CodeBox_HelpRequested(object sender, HelpEventArgs hlpevent)
+        {
+            RichTextBox rtb = this.CodeBox;
             SelectionExpandResult expand = SelectionExpandResult.Expand(rtb);
             if (expand.IsEmpty)
-                return;
-            string readmeText;
-            using (System.IO.StreamReader reader =
-                new System.IO.StreamReader(System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceStream("MainNs.README.md")))
-            {
-                readmeText = reader.ReadToEnd();
-            }
-            this.HelpControl.Text = readmeText;
-            (this.HelpTabPage.Parent as TabControl).SelectedTab = this.HelpTabPage;
-            int pos = readmeText.IndexOf(expand.Token, StringComparison.InvariantCultureIgnoreCase);
-            if (pos >= 0)
-            {
-                this.HelpControl.Select(pos, 0);
-                this.HelpControl.ScrollToCaret();
-            }
-        }
+                return;
+            string readmeText;
+            using (System.IO.StreamReader reader =
+                new System.IO.StreamReader(System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceStream("MainNs.README.md")))
+            {
+                readmeText = reader.ReadToEnd();
+            }
+            this.HelpControl.Text = readmeText;
+            (this.HelpTabPage.Parent as TabControl).SelectedTab = this.HelpTabPage;
+            int pos = readmeText.IndexOf(expand.Token, StringComparison.InvariantCultureIgnoreCase);
+            if (pos >= 0)
+            {
+                this.HelpControl.Select(pos, 0);
+                this.HelpControl.ScrollToCaret();
+            }
+        }
     }
 
     public static class RichTextBoxExt