gallium/swr: Fix compilation with LLVM 12
[mesa.git] / src / gallium / drivers / swr / rasterizer / jitter / streamout_jit.cpp
index c47acf73228ac7ca85204b45838e236e5ba739da..60259f093a11afa25ae6dacd95a9fd92d059118b 100644 (file)
@@ -138,7 +138,7 @@ struct StreamOutJit : public BuilderGfxMem
             Value* pAttrib = GEP(pStream, C(4 * decl.attribSlot));
 
             // load 4 components from stream
-            Type* simd4Ty    = VectorType::get(IRB()->getFloatTy(), 4);
+            Type* simd4Ty    = getVectorType(IRB()->getFloatTy(), 4);
             Type* simd4PtrTy = PointerType::get(simd4Ty, 0);
             pAttrib          = BITCAST(pAttrib, simd4PtrTy);
             Value* vattrib   = LOAD(pAttrib);
@@ -155,7 +155,7 @@ struct StreamOutJit : public BuilderGfxMem
 
             // cast mask to <4xi1>
             Value* mask = ToMask(packedMask);
-            MASKED_STORE(src, pOut, 4, mask, PointerType::get(simd4Ty, 0), JIT_MEM_CLIENT::GFX_MEM_CLIENT_STREAMOUT);
+            MASKED_STORE(src, pOut, 4, mask, PointerType::get(simd4Ty, 0), MEM_CLIENT::GFX_MEM_CLIENT_STREAMOUT);
         }
 
         // increment SO buffer
@@ -223,7 +223,7 @@ struct StreamOutJit : public BuilderGfxMem
             Value* pBuf              = getSOBuffer(pSoCtx, b);
             Value* pData             = LOAD(pBuf, {0, SWR_STREAMOUT_BUFFER_pBuffer});
             Value* streamOffset      = LOAD(pBuf, {0, SWR_STREAMOUT_BUFFER_streamOffset});
-            pOutBuffer[b] = GEP(pData, streamOffset, PointerType::get(IRB()->getInt32Ty(), 0)); 
+            pOutBuffer[b] = GEP(pData, streamOffset, PointerType::get(IRB()->getInt32Ty(), 0));
             pOutBufferStartVertex[b] = pOutBuffer[b];
 
             outBufferPitch[b] = LOAD(pBuf, {0, SWR_STREAMOUT_BUFFER_pitch});
@@ -314,7 +314,9 @@ struct StreamOutJit : public BuilderGfxMem
         passes.add(createCFGSimplificationPass());
         passes.add(createEarlyCSEPass());
         passes.add(createInstructionCombiningPass());
+#if LLVM_VERSION_MAJOR <= 11
         passes.add(createConstantPropagationPass());
+#endif
         passes.add(createSCCPPass());
         passes.add(createAggressiveDCEPass());