Skip to content

Commit 724a3e3

Browse files
igorban-inteligcbot
authored andcommitted
[Autobackout][FuncReg]Revert of change: 28b91fe
Refactor current VisaRegalloc and corresponding CisaBuilder-calls * VisaRegalloc::getSigned must be constant * VisaRegalloc::getRegForValue method not really needed
1 parent 3471793 commit 724a3e3

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXCisaBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4248,8 +4248,8 @@ GenXKernelBuilder::getRegForValueOrNullAndSaveAlias(Args &&... args) {
42484248
*/
42494249
template <typename... Args>
42504250
GenXKernelBuilder::Register *
4251-
GenXKernelBuilder::getRegForValueAndSaveAlias(Args &&...args) {
4252-
Register *R = RegAlloc->getOrCreateRegForValue(std::forward<Args>(args)...);
4251+
GenXKernelBuilder::getRegForValueAndSaveAlias(Args &&... args) {
4252+
Register *R = RegAlloc->getRegForValue(std::forward<Args>(args)...);
42534253
SimpleValue SV = std::get<0>(std::make_tuple(args...));
42544254
IGC_ASSERT_MESSAGE(R, "getRegForValue must return non-nullptr register");
42554255
LastUsedAliasMap[SV.getValue()] = R;

IGC/VectorCompiler/lib/GenXCodeGen/GenXVisaRegAlloc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,8 @@ GenXVisaRegAlloc::getOrCreateRegForValue(SimpleValue V, Signedness Signed,
792792
* different signedness between source and destination can make the jitter
793793
* generate less efficient code.
794794
*/
795-
genx::Signedness GenXVisaRegAlloc::getSigned(const Reg *R) const {
795+
genx::Signedness GenXVisaRegAlloc::getSigned(Reg* R)
796+
{
796797
return (R && R->Category == vc::RegCategory::General) ? R->Signed
797798
: DONTCARESIGNED;
798799
}

IGC/VectorCompiler/lib/GenXCodeGen/GenXVisaRegAlloc.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@ namespace llvm {
186186
std::list<Reg>& getRegStorage() {
187187
return RegStorage;
188188
}
189+
// Get the vISA virtual register for a value (assertion failure if none).
190+
Reg *getRegForValue(genx::SimpleValue V,
191+
genx::Signedness Signed = genx::DONTCARESIGNED,
192+
Type *OverrideType = nullptr, bool IsBF = false) {
193+
Reg *R = getOrCreateRegForValue(V, Signed, OverrideType, IsBF);
194+
IGC_ASSERT_MESSAGE(R, "no register allocated for this value");
195+
return R;
196+
}
189197
// Get the vISA virtual register for a value or nullptr if there is no
190198
// register associated with given value.
191199
Reg *getRegForValueOrNull(genx::SimpleValue V,
@@ -205,7 +213,7 @@ namespace llvm {
205213
Reg *getRegForValueUntyped(genx::SimpleValue V) const;
206214

207215
// Get the signedness of a register.
208-
genx::Signedness getSigned(const Reg *R) const;
216+
genx::Signedness getSigned(Reg* R);
209217

210218
// Set callback that will be called each time new register is created.
211219
// It is used in CisaBuilder when new aliases are created.

0 commit comments

Comments
 (0)