[PATCH] D74086: [SystemZ] Add a subtarget cache like some other targets already have.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 14:34:45 PST 2020


jonpa updated this revision to Diff 243287.
jonpa marked 5 inline comments as done.
jonpa added a comment.

Patch updated.

It seems that the general precedence (when invoking llc) is that first (in reverse order) is "target-features", and then -mattr. So for example a function with the attribute "target-features"="-vector" compiled with llc -mattr=+vector, gets a (SystemZTargetMachine::getSubtargetImpl) FS -vector,+vector, meaning that +vector wins.

It's interesting that the function attribute "target-cpu" seems to override the llc option -mcpu, while llc option -mattr= seems to override function attributes, like +-vector.

To get the behaviour you expected for soft-float (like also other targets seem to have), it seems easiest then to do like the other targets and check for the "use-soft-float"="true" attribute, and in that case add a final and decisive +soft-float to FS (this is not the way e.g. [+-]vector works per above, but maybe there is a reason for this?).

A function with "use-soft-float"="true" now always gets soft-float, while "use-soft-float"="false" will take no effect, so that -mattr=soft-float actually will give soft-float.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74086/new/

https://reviews.llvm.org/D74086

Files:
  llvm/lib/Target/SystemZ/SystemZTDC.cpp
  llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
  llvm/lib/Target/SystemZ/SystemZTargetMachine.h
  llvm/test/CodeGen/SystemZ/function-attributes-01.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74086.243287.patch
Type: text/x-patch
Size: 9189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200207/3b5e9ee7/attachment.bin>


More information about the llvm-commits mailing list