summaryrefslogtreecommitdiff
path: root/clang/utils/TableGen/RISCVVEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/utils/TableGen/RISCVVEmitter.cpp')
-rw-r--r--clang/utils/TableGen/RISCVVEmitter.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/clang/utils/TableGen/RISCVVEmitter.cpp b/clang/utils/TableGen/RISCVVEmitter.cpp
index 068e6a0c072c..db4cd77d8c53 100644
--- a/clang/utils/TableGen/RISCVVEmitter.cpp
+++ b/clang/utils/TableGen/RISCVVEmitter.cpp
@@ -105,6 +105,16 @@ void emitCodeGenSwitchBody(const RVVIntrinsic *RVVI, raw_ostream &OS) {
return;
}
+ // Cast pointer operand of vector load intrinsic.
+ for (const auto &I : enumerate(RVVI->getInputTypes())) {
+ if (I.value()->isPointer()) {
+ assert(RVVI->getIntrinsicTypes().front() == -1 &&
+ "RVVI should be vector load intrinsic.");
+ OS << " Ops[" << I.index() << "] = Builder.CreateBitCast(Ops[";
+ OS << I.index() << "], ResultType->getPointerTo());\n";
+ }
+ }
+
if (RVVI->isMasked()) {
if (RVVI->hasVL()) {
OS << " std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end() - 1);\n";
@@ -218,7 +228,7 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
auto T = RVVType::computeType(BasicType::Int8, Log2LMUL,
PrototypeDescriptor::Mask);
if (T)
- printType(T.getValue());
+ printType(T.value());
}
// Print RVV int/float types.
for (char I : StringRef("csil")) {
@@ -226,13 +236,13 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
for (int Log2LMUL : Log2LMULs) {
auto T = RVVType::computeType(BT, Log2LMUL, PrototypeDescriptor::Vector);
if (T) {
- printType(T.getValue());
+ printType(T.value());
auto UT = RVVType::computeType(
BT, Log2LMUL,
PrototypeDescriptor(BaseTypeModifier::Vector,
VectorTypeModifier::NoModifier,
TypeModifier::UnsignedInteger));
- printType(UT.getValue());
+ printType(UT.value());
}
}
}
@@ -241,7 +251,7 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
auto T = RVVType::computeType(BasicType::Float16, Log2LMUL,
PrototypeDescriptor::Vector);
if (T)
- printType(T.getValue());
+ printType(T.value());
}
OS << "#endif\n";
@@ -250,7 +260,7 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
auto T = RVVType::computeType(BasicType::Float32, Log2LMUL,
PrototypeDescriptor::Vector);
if (T)
- printType(T.getValue());
+ printType(T.value());
}
OS << "#endif\n";
@@ -259,7 +269,7 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
auto T = RVVType::computeType(BasicType::Float64, Log2LMUL,
PrototypeDescriptor::Vector);
if (T)
- printType(T.getValue());
+ printType(T.value());
}
OS << "#endif\n\n";