Skip to content

Commit daa4e57

Browse files
authored
[Hexagon] Add opcode V6_vS32Ub_npred_ai for offset validity check (#161618)
Check for a valid offset for unaligned vector store V6_vS32Ub_npred_ai. isValidOffset() is updated to evaluate offset of this instruction. Fixes #160647
1 parent 11b0cf8 commit daa4e57

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2804,6 +2804,7 @@ bool HexagonInstrInfo::isValidOffset(unsigned Opcode, int Offset,
28042804
case Hexagon::V6_vL32b_nt_cur_npred_ai:
28052805
case Hexagon::V6_vL32b_nt_tmp_pred_ai:
28062806
case Hexagon::V6_vL32b_nt_tmp_npred_ai:
2807+
case Hexagon::V6_vS32Ub_npred_ai:
28072808
case Hexagon::V6_vgathermh_pseudo:
28082809
case Hexagon::V6_vgathermw_pseudo:
28092810
case Hexagon::V6_vgathermhw_pseudo:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
; RUN: llc -march=hexagon -mcpu=hexagonv68 -mattr=+hvxv68,+hvx-length128B < %s | FileCheck %s
2+
; REQUIRES: asserts
3+
4+
; Check that the test does not assert when unaligned vector store V6_vS32Ub_npred_ai is generated.
5+
; CHECK: if (!p{{[0-3]}}) vmemu
6+
7+
target triple = "hexagon-unknown-unknown-elf"
8+
9+
define fastcc void @test(i1 %cmp.i.i) {
10+
entry:
11+
%call.i.i.i172 = load ptr, ptr null, align 4
12+
%add.ptr = getelementptr i8, ptr %call.i.i.i172, i32 1
13+
store <32 x i32> zeroinitializer, ptr %add.ptr, align 128
14+
%add.ptr4.i4 = getelementptr i8, ptr %call.i.i.i172, i32 129
15+
br i1 %cmp.i.i, label %common.ret, label %if.end.i.i
16+
17+
common.ret: ; preds = %if.end.i.i, %entry
18+
ret void
19+
20+
if.end.i.i: ; preds = %entry
21+
store <32 x i32> zeroinitializer, ptr %add.ptr4.i4, align 1
22+
br label %common.ret
23+
}

0 commit comments

Comments
 (0)