[llvm] f6309db - [Hexagon] Handle L2_loadb[sz]w[24]_io in HII::isValidOffset
Krzysztof Parzyszek via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 5 13:24:39 PST 2022
Author: Krzysztof Parzyszek
Date: 2022-01-05T13:19:02-08:00
New Revision: f6309db719a4bb78a22a80451d1c2998b5dcda01
URL: https://github.com/llvm/llvm-project/commit/f6309db719a4bb78a22a80451d1c2998b5dcda01
DIFF: https://github.com/llvm/llvm-project/commit/f6309db719a4bb78a22a80451d1c2998b5dcda01.diff
LOG: [Hexagon] Handle L2_loadb[sz]w[24]_io in HII::isValidOffset
Added:
Modified:
llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
llvm/lib/Target/Hexagon/HexagonPatterns.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
index 5152060aa921..57dc2f5585b4 100644
--- a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp
@@ -2902,8 +2902,18 @@ bool HexagonInstrInfo::isValidOffset(unsigned Opcode, int Offset,
case Hexagon::S2_pstorerdt_io:
case Hexagon::S2_pstorerdf_io:
return isShiftedUInt<6,3>(Offset);
+
+ case Hexagon::L2_loadbsw2_io:
+ case Hexagon::L2_loadbzw2_io:
+ return isShiftedInt<11,1>(Offset);
+
+ case Hexagon::L2_loadbsw4_io:
+ case Hexagon::L2_loadbzw4_io:
+ return isShiftedInt<11,2>(Offset);
} // switch
+ dbgs() << "Failed Opcode is : " << Opcode << " (" << getName(Opcode)
+ << ")\n";
llvm_unreachable("No offset range is defined for this opcode. "
"Please define it in the above switch statement!");
}
diff --git a/llvm/lib/Target/Hexagon/HexagonPatterns.td b/llvm/lib/Target/Hexagon/HexagonPatterns.td
index cab59626a600..3abbd896c519 100644
--- a/llvm/lib/Target/Hexagon/HexagonPatterns.td
+++ b/llvm/lib/Target/Hexagon/HexagonPatterns.td
@@ -2080,7 +2080,7 @@ let AddedComplexity = 20 in {
defm: Loadxi_pat<sextloadi8, i32, anyimm0, L2_loadrb_io>;
defm: Loadxi_pat<sextloadi16, i32, anyimm1, L2_loadrh_io>;
defm: Loadxi_pat<sextloadv2i8, v2i16, anyimm1, L2_loadbsw2_io>;
- defm: Loadxi_pat<sextloadv4i8, v4i16, anyimm2, L2_loadbzw4_io>;
+ defm: Loadxi_pat<sextloadv4i8, v4i16, anyimm2, L2_loadbsw4_io>;
defm: Loadxi_pat<zextloadi1, i32, anyimm0, L2_loadrub_io>;
defm: Loadxi_pat<zextloadi8, i32, anyimm0, L2_loadrub_io>;
defm: Loadxi_pat<zextloadi16, i32, anyimm1, L2_loadruh_io>;
@@ -2132,7 +2132,7 @@ let AddedComplexity = 60 in {
def: Loadxu_pat<sextloadi8, i32, anyimm0, L4_loadrb_ur>;
def: Loadxu_pat<sextloadi16, i32, anyimm1, L4_loadrh_ur>;
def: Loadxu_pat<sextloadv2i8, v2i16, anyimm1, L4_loadbsw2_ur>;
- def: Loadxu_pat<sextloadv4i8, v4i16, anyimm2, L4_loadbzw4_ur>;
+ def: Loadxu_pat<sextloadv4i8, v4i16, anyimm2, L4_loadbsw4_ur>;
def: Loadxu_pat<zextloadi1, i32, anyimm0, L4_loadrub_ur>;
def: Loadxu_pat<zextloadi8, i32, anyimm0, L4_loadrub_ur>;
def: Loadxu_pat<zextloadi16, i32, anyimm1, L4_loadruh_ur>;
More information about the llvm-commits
mailing list