gallium/swr: Fix compilation with LLVM 12
[mesa.git] / src / gallium / drivers / swr / rasterizer / jitter / builder_misc.cpp
index 0ee727cc8d8a5f6d959649fa7a8c3b625d8c5c99..530752850c611802978fa37942136c7ef14e6b4f 100644 (file)
@@ -134,7 +134,7 @@ namespace SwrJit
     Value* Builder::VIMMED1(uint64_t i)
     {
 #if LLVM_VERSION_MAJOR > 10
-        return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
+        return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
 #else
         return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
 #endif
@@ -143,7 +143,7 @@ namespace SwrJit
     Value* Builder::VIMMED1_16(uint64_t i)
     {
 #if LLVM_VERSION_MAJOR > 10
-        return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
+        return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
 #else
         return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
 #endif
@@ -152,7 +152,7 @@ namespace SwrJit
     Value* Builder::VIMMED1(int i)
     {
 #if LLVM_VERSION_MAJOR > 10
-        return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
+        return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
 #else
         return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
 #endif
@@ -161,7 +161,7 @@ namespace SwrJit
     Value* Builder::VIMMED1_16(int i)
     {
 #if LLVM_VERSION_MAJOR > 10
-        return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
+        return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
 #else
         return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
 #endif
@@ -170,7 +170,7 @@ namespace SwrJit
     Value* Builder::VIMMED1(uint32_t i)
     {
 #if LLVM_VERSION_MAJOR > 10
-        return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
+        return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
 #else
         return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
 #endif
@@ -179,7 +179,7 @@ namespace SwrJit
     Value* Builder::VIMMED1_16(uint32_t i)
     {
 #if LLVM_VERSION_MAJOR > 10
-        return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
+        return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
 #else
         return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
 #endif
@@ -188,7 +188,7 @@ namespace SwrJit
     Value* Builder::VIMMED1(float i)
     {
 #if LLVM_VERSION_MAJOR > 10
-        return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantFP>(C(i)));
+        return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantFP>(C(i)));
 #else
         return ConstantVector::getSplat(mVWidth, cast<ConstantFP>(C(i)));
 #endif
@@ -197,7 +197,7 @@ namespace SwrJit
     Value* Builder::VIMMED1_16(float i)
     {
 #if LLVM_VERSION_MAJOR > 10
-        return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantFP>(C(i)));
+        return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantFP>(C(i)));
 #else
         return ConstantVector::getSplat(mVWidth16, cast<ConstantFP>(C(i)));
 #endif
@@ -206,7 +206,7 @@ namespace SwrJit
     Value* Builder::VIMMED1(bool i)
     {
 #if LLVM_VERSION_MAJOR > 10
-        return ConstantVector::getSplat(ElementCount(mVWidth, false), cast<ConstantInt>(C(i)));
+        return ConstantVector::getSplat(ElementCount::get(mVWidth, false), cast<ConstantInt>(C(i)));
 #else
         return ConstantVector::getSplat(mVWidth, cast<ConstantInt>(C(i)));
 #endif
@@ -215,27 +215,27 @@ namespace SwrJit
     Value* Builder::VIMMED1_16(bool i)
     {
 #if LLVM_VERSION_MAJOR > 10
-        return ConstantVector::getSplat(ElementCount(mVWidth16, false), cast<ConstantInt>(C(i)));
+        return ConstantVector::getSplat(ElementCount::get(mVWidth16, false), cast<ConstantInt>(C(i)));
 #else
         return ConstantVector::getSplat(mVWidth16, cast<ConstantInt>(C(i)));
 #endif
     }
 
-    Value* Builder::VUNDEF_IPTR() { return UndefValue::get(VectorType::get(mInt32PtrTy, mVWidth)); }
+    Value* Builder::VUNDEF_IPTR() { return UndefValue::get(getVectorType(mInt32PtrTy, mVWidth)); }
 
-    Value* Builder::VUNDEF(Type* t) { return UndefValue::get(VectorType::get(t, mVWidth)); }
+    Value* Builder::VUNDEF(Type* t) { return UndefValue::get(getVectorType(t, mVWidth)); }
 
-    Value* Builder::VUNDEF_I() { return UndefValue::get(VectorType::get(mInt32Ty, mVWidth)); }
+    Value* Builder::VUNDEF_I() { return UndefValue::get(getVectorType(mInt32Ty, mVWidth)); }
 
-    Value* Builder::VUNDEF_I_16() { return UndefValue::get(VectorType::get(mInt32Ty, mVWidth16)); }
+    Value* Builder::VUNDEF_I_16() { return UndefValue::get(getVectorType(mInt32Ty, mVWidth16)); }
 
-    Value* Builder::VUNDEF_F() { return UndefValue::get(VectorType::get(mFP32Ty, mVWidth)); }
+    Value* Builder::VUNDEF_F() { return UndefValue::get(getVectorType(mFP32Ty, mVWidth)); }
 
-    Value* Builder::VUNDEF_F_16() { return UndefValue::get(VectorType::get(mFP32Ty, mVWidth16)); }
+    Value* Builder::VUNDEF_F_16() { return UndefValue::get(getVectorType(mFP32Ty, mVWidth16)); }
 
     Value* Builder::VUNDEF(Type* ty, uint32_t size)
     {
-        return UndefValue::get(VectorType::get(ty, size));
+        return UndefValue::get(getVectorType(ty, size));
     }
 
     Value* Builder::VBROADCAST(Value* src, const llvm::Twine& name)
@@ -602,7 +602,7 @@ namespace SwrJit
             // number of 8 bit elements in b
             uint32_t numElms = cast<VectorType>(cB->getType())->getNumElements();
             // output vector
-            Value* vShuf = UndefValue::get(VectorType::get(mInt8Ty, numElms));
+            Value* vShuf = UndefValue::get(getVectorType(mInt8Ty, numElms));
 
             // insert an 8 bit value from the high and low lanes of a per loop iteration
             numElms /= 2;
@@ -643,7 +643,7 @@ namespace SwrJit
     Value* Builder::PMOVSXBD(Value* a)
     {
         // VPMOVSXBD output type
-        Type* v8x32Ty = VectorType::get(mInt32Ty, 8);
+        Type* v8x32Ty = getVectorType(mInt32Ty, 8);
         // Extract 8 values from 128bit lane and sign extend
         return S_EXT(VSHUFFLE(a, a, C<int>({0, 1, 2, 3, 4, 5, 6, 7})), v8x32Ty);
     }
@@ -655,7 +655,7 @@ namespace SwrJit
     Value* Builder::PMOVSXWD(Value* a)
     {
         // VPMOVSXWD output type
-        Type* v8x32Ty = VectorType::get(mInt32Ty, 8);
+        Type* v8x32Ty = getVectorType(mInt32Ty, 8);
         // Extract 8 values from 128bit lane and sign extend
         return S_EXT(VSHUFFLE(a, a, C<int>({0, 1, 2, 3, 4, 5, 6, 7})), v8x32Ty);
     }
@@ -672,9 +672,9 @@ namespace SwrJit
 #else
         uint32_t numElems = a->getType()->getVectorNumElements();
 #endif
-        Value*   input    = BITCAST(a, VectorType::get(mFP16Ty, numElems));
+        Value*   input    = BITCAST(a, getVectorType(mFP16Ty, numElems));
 
-        return FP_EXT(input, VectorType::get(mFP32Ty, numElems), name);
+        return FP_EXT(input, getVectorType(mFP32Ty, numElems), name);
     }
 
     //////////////////////////////////////////////////////////////////////////