summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGExprScalar.cpp
diff options
context:
space:
mode:
authorSaurabh Jha <saurabh.jhaa@gmail.com>2021-05-03 14:57:31 +0100
committerFlorian Hahn <flo@fhahn.com>2021-05-03 15:31:43 +0100
commit696becbd139e4bbbe304ce2231de0fb50f307b68 (patch)
tree6e1960042be1baec56b94c844fca06eb0bc9a2a3 /clang/lib/CodeGen/CGExprScalar.cpp
parent2e4cc9a7256b8a23421727522059ec5c67500cf3 (diff)
[Matrix] Remove bitcast when casting between matrices of the same size
In matrix type casts, we were doing bitcast when the matrices had the same size. This was incorrect and this patch fixes that. Also added some new CodeGen tests for signed <-> usigned conversions Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D101754
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index b469a4454f15..89ab9abc7dad 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -1205,10 +1205,6 @@ Value *ScalarExprEmitter::EmitScalarCast(Value *Src, QualType SrcType,
QualType SrcElementType;
QualType DstElementType;
if (SrcType->isMatrixType() && DstType->isMatrixType()) {
- // Allow bitcast between matrixes of the same size.
- if (SrcTy->getPrimitiveSizeInBits() == DstTy->getPrimitiveSizeInBits())
- return Builder.CreateBitCast(Src, DstTy, "conv");
-
SrcElementTy = cast<llvm::VectorType>(SrcTy)->getElementType();
DstElementTy = cast<llvm::VectorType>(DstTy)->getElementType();
SrcElementType = SrcType->castAs<MatrixType>()->getElementType();