[PATCH] D57823: [ARM] Make fullfp16 instructions not conditionalisable.

Simon Tatham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 6 08:47:18 PST 2019


simon_tatham created this revision.
simon_tatham added reviewers: SjoerdMeijer, t.p.northover, efriedma.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls, javed.absar.
Herald added a project: LLVM.

More or less all the instructions defined in the v8.2a full-fp16
extension are defined as UNPREDICTABLE if you put them in an IT block
(Thumb) or use with any condition other than AL (ARM). LLVM didn't
know that, and was happy to conditionalise them.

In order to force these instructions to count as not predicable, I had
to make a small Tablegen change. The code generation back end mostly
decides if an instruction was predicable by looking for something it
can identify as a predicate operand; there's an isPredicable bit flag
that overrides that check in the positive direction, but nothing that
overrides it in the negative direction.

(I considered the alternative approach of actually removing the
predicate operand from those instructions, but thought that it would
be more painful overall for instructions differing only in data type
to have different shapes of operand list. This way, the only code that
has to notice the difference is the if-converter.)

So I've added an isUnpredicable bit alongside isPredicable, and set
that bit on the right subset of FP16 instructions, and also on the
VSEL, VMAXNM/VMINNM and VRINT[ANPM] families which should be
unpredicable for all data types.

I've included a couple of representative regression tests, both of
which previously caused an fp16 instruction to be conditionalised in
ARM state and (with -arm-no-restrict-it) to be put in an IT block in
Thumb.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D57823

Files:
  llvm/include/llvm/Target/Target.td
  llvm/lib/Target/ARM/ARMInstrFormats.td
  llvm/lib/Target/ARM/ARMInstrVFP.td
  llvm/test/CodeGen/ARM/fp16-no-condition.ll
  llvm/utils/TableGen/CodeGenInstruction.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57823.185567.patch
Type: text/x-patch
Size: 10212 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190206/5bcf4d69/attachment.bin>


More information about the llvm-commits mailing list