[clang] f42b195 - [CodeGen][RISCV] Avoid deprecated address constructor
Nikita Popov via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 22 02:15:27 PDT 2022
Author: Nikita Popov
Date: 2022-03-22T10:15:19+01:00
New Revision: f42b1954a0e85fadd421d5e345cb8343c410b34d
URL: https://github.com/llvm/llvm-project/commit/f42b1954a0e85fadd421d5e345cb8343c410b34d
DIFF: https://github.com/llvm/llvm-project/commit/f42b1954a0e85fadd421d5e345cb8343c410b34d.diff
LOG: [CodeGen][RISCV] Avoid deprecated address constructor
Added:
Modified:
clang/include/clang/Basic/riscv_vector.td
Removed:
################################################################################
diff --git a/clang/include/clang/Basic/riscv_vector.td b/clang/include/clang/Basic/riscv_vector.td
index 7f0ad2ee20996..556f6c244cee5 100644
--- a/clang/include/clang/Basic/riscv_vector.td
+++ b/clang/include/clang/Basic/riscv_vector.td
@@ -641,8 +641,8 @@ multiclass RVVVLEFFBuiltin<list<string> types> {
// Store new_vl.
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(1)->getType());
- Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {1}),
- Address::deprecated(NewVL, Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {1});
+ Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align));
return V;
}
}],
@@ -661,8 +661,8 @@ multiclass RVVVLEFFBuiltin<list<string> types> {
// Store new_vl.
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(3)->getType());
- Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {1}),
- Address::deprecated(NewVL, Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {1});
+ Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align));
return V;
}
}] in {
@@ -879,8 +879,8 @@ multiclass RVVUnitStridedSegLoad<string op> {
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
- V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
- Address::deprecated(Ops[I], Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I});
+ V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align));
}
return V;
}
@@ -905,8 +905,8 @@ multiclass RVVUnitStridedSegLoad<string op> {
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
- V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
- Address::deprecated(Ops[I], Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I});
+ V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align));
}
return V;
}
@@ -950,12 +950,12 @@ multiclass RVVUnitStridedSegLoadFF<string op> {
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
for (unsigned I = 0; I < NF; ++I) {
- Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
- Address::deprecated(Ops[I], Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I});
+ Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align));
}
// Store new_vl.
- return Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {NF}),
- Address::deprecated(NewVL, Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF});
+ return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align));
}
}],
ManualCodegenMask = [{
@@ -978,12 +978,12 @@ multiclass RVVUnitStridedSegLoadFF<string op> {
clang::CharUnits Align =
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
for (unsigned I = 0; I < NF; ++I) {
- Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
- Address::deprecated(Ops[I], Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I});
+ Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align));
}
// Store new_vl.
- return Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {NF}),
- Address::deprecated(NewVL, Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {NF});
+ return Builder.CreateStore(Val, Address(NewVL, Val->getType(), Align));
}
}] in {
defvar PV = PVString<nf, /*signed=*/true>.S;
@@ -1025,8 +1025,8 @@ multiclass RVVStridedSegLoad<string op> {
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
- V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
- Address::deprecated(Ops[I], Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I});
+ V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align));
}
return V;
}
@@ -1052,8 +1052,8 @@ multiclass RVVStridedSegLoad<string op> {
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
- V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
- Address::deprecated(Ops[I], Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I});
+ V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align));
}
return V;
}
@@ -1092,8 +1092,8 @@ multiclass RVVIndexedSegLoad<string op> {
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
- V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
- Address::deprecated(Ops[I], Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I});
+ V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align));
}
return V;
}
@@ -1119,8 +1119,8 @@ multiclass RVVIndexedSegLoad<string op> {
CGM.getNaturalPointeeTypeAlignment(E->getArg(0)->getType());
llvm::Value *V;
for (unsigned I = 0; I < NF; ++I) {
- V = Builder.CreateStore(Builder.CreateExtractValue(LoadValue, {I}),
- Address::deprecated(Ops[I], Align));
+ llvm::Value *Val = Builder.CreateExtractValue(LoadValue, {I});
+ V = Builder.CreateStore(Val, Address(Ops[I], Val->getType(), Align));
}
return V;
}
More information about the cfe-commits
mailing list