[llvm] r364610 - [LangRef] Clarify codegen expectations for intrinsics with fp/integer-only overloads.

Amara Emerson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 16:33:06 PDT 2019


Author: aemerson
Date: Thu Jun 27 16:33:05 2019
New Revision: 364610

URL: http://llvm.org/viewvc/llvm-project?rev=364610&view=rev
Log:
[LangRef] Clarify codegen expectations for intrinsics with fp/integer-only overloads.

This change is a result of discussions on list: "GlobalISel: Ambiguous intrinsic semantics problem"

Differential Revision: https://reviews.llvm.org/D59657

Modified:
    llvm/trunk/docs/LangRef.rst

Modified: llvm/trunk/docs/LangRef.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=364610&r1=364609&r2=364610&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.rst (original)
+++ llvm/trunk/docs/LangRef.rst Thu Jun 27 16:33:05 2019
@@ -10480,6 +10480,16 @@ overloaded, and only one type suffix is
 type is matched against the return type, it does not require its own
 name suffix.
 
+For target developers who are defining intrinsics for back-end code
+generation, any intrinsic overloads based solely the distinction between
+integer or floating point types should not be relied upon for correct
+code generation. In such cases, the recommended approach for target
+maintainers when defining intrinsics is to create separate integer and
+FP intrinsics rather than rely on overloading. For example, if different
+codegen is required for ``llvm.target.foo(<4 x i32>)`` and
+``llvm.target.foo(<4 x float>)`` then these should be split into
+different intrinsics.
+
 To learn how to add an intrinsic function, please see the `Extending
 LLVM Guide <ExtendingLLVM.html>`_.
 




More information about the llvm-commits mailing list