[PATCH] D32282: [ARM] ACLE Chapter 9 support

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 06:44:49 PDT 2017


samparker added a comment.

Hi Sjoerd,

The __saturation_occurred intrinsics are awkward, so I'm not implementing them at the moment. I had originally planned to add a function attribute to any function in which the intrinsic was used. This attribute could then be queried in the backend to predicate pattern matching of other instructions that touch the Q flag. This doesn't work because the intrinsic is called from within a function defined in the arm_acle.h file, so the attribute is attached to that library function, which gets inlined into the user code and the attribute lost to the ether! Target intrinsics appear to be handled just as strings so it doesn't look like it would be possible, or excepted upstream, to introduce an official attribute for this feature.

The other approach would be to create a backend pass which searches for the intrinsic call and then labels the parent function with the attribute, before any instruction selection happens. The intrinsics that touch the Q flag have been setup to have a chain and attaching a function attribute for backend predicates does work, so it can be done if desired.

Some of this chapter has already been implemented as well, such as 9.2 and 9.7, so I have focused on the integer arithmetic.

Cheers!


https://reviews.llvm.org/D32282





More information about the llvm-commits mailing list