Skip to content

Commit 02cd8a6

Browse files
committed
[ARM] Allow smaller VMOVL in tail predicated loops
This allows VMOVL in tail predicated loops so long as the the vector size the VMOVL is extending into is less than or equal to the size of the VCTP in the tail predicated loop. These cases represent a sign-extend-inreg (or zero-extend-inreg), which needn't block tail predication as in https://godbolt.org/z/hdTsEbx8Y. For this a vecsize has been added to the TSFlag bits of MVE instructions, which stores the size of the elements that the MVE instruction operates on. In the case of multiple size (such as a MVE_VMOVLs8bh that extends from i8 to i16, the largest size was be chosen). The sizes are encoded as 00 = i8, 01 = i16, 10 = i32 and 11 = i64, which often (but not always) comes from the instruction encoding directly. A unit test was added, and although only a subset of the vecsizes are currently used, the rest should be useful for other cases. Differential Revision: https://reviews.llvm.org/D109706
1 parent a5e1c74 commit 02cd8a6

File tree

6 files changed

+1234
-332
lines changed

6 files changed

+1234
-332
lines changed

llvm/lib/Target/ARM/ARMInstrFormats.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ class InstTemplate<AddrMode am, int sz, IndexMode im,
408408
// in an IT block).
409409
bit thumbArithFlagSetting = 0;
410410

411+
bits<2> VecSize = 0;
411412
bit validForTailPredication = 0;
412413
bit retainsPreviousHalfElement = 0;
413414
bit horizontalReduction = 0;
@@ -428,6 +429,7 @@ class InstTemplate<AddrMode am, int sz, IndexMode im,
428429
let TSFlags{21} = retainsPreviousHalfElement;
429430
let TSFlags{22} = horizontalReduction;
430431
let TSFlags{23} = doubleWidthResult;
432+
let TSFlags{25-24} = VecSize;
431433

432434
let Constraints = cstr;
433435
let Itinerary = itin;

0 commit comments

Comments
 (0)