[llvm] 029120c - [LangRef] Update list of supported constant expressions (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 20 05:33:50 PDT 2023
Author: Nikita Popov
Date: 2023-04-20T14:33:37+02:00
New Revision: 029120c46a750c897f33c1d3a5240df5504a80ae
URL: https://github.com/llvm/llvm-project/commit/029120c46a750c897f33c1d3a5240df5504a80ae
DIFF: https://github.com/llvm/llvm-project/commit/029120c46a750c897f33c1d3a5240df5504a80ae.diff
LOG: [LangRef] Update list of supported constant expressions (NFC)
For binary ops explicitly list all supported ops, as it's no
longer all of them.
Added:
Modified:
llvm/docs/LangRef.rst
Removed:
################################################################################
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst
index 9116cc1d21f2d..dc571093e2cb8 100644
--- a/llvm/docs/LangRef.rst
+++ b/llvm/docs/LangRef.rst
@@ -4571,8 +4571,6 @@ The following is the syntax for constant expressions:
required to make sense for the type of "pointer to TY". These indexes
may be implicitly sign-extended or truncated to match the index size
of CSTPTR's address space.
-``select (COND, VAL1, VAL2)``
- Perform the :ref:`select operation <i_select>` on constants.
``icmp COND (VAL1, VAL2)``
Perform the :ref:`icmp operation <i_icmp>` on constants.
``fcmp COND (VAL1, VAL2)``
@@ -4586,22 +4584,24 @@ The following is the syntax for constant expressions:
``shufflevector (VEC1, VEC2, IDXMASK)``
Perform the :ref:`shufflevector operation <i_shufflevector>` on
constants.
-``extractvalue (VAL, IDX0, IDX1, ...)``
- Perform the :ref:`extractvalue operation <i_extractvalue>` on
- constants. The index list is interpreted in a similar manner as
- indices in a ':ref:`getelementptr <i_getelementptr>`' operation. At
- least one index value must be specified.
-``insertvalue (VAL, ELT, IDX0, IDX1, ...)``
- Perform the :ref:`insertvalue operation <i_insertvalue>` on constants.
- The index list is interpreted in a similar manner as indices in a
- ':ref:`getelementptr <i_getelementptr>`' operation. At least one index
- value must be specified.
-``OPCODE (LHS, RHS)``
- Perform the specified operation of the LHS and RHS constants. OPCODE
- may be any of the :ref:`binary <binaryops>` or :ref:`bitwise
- binary <bitwiseops>` operations. The constraints on operands are
- the same as those for the corresponding instruction (e.g. no bitwise
- operations on floating-point values are allowed).
+``add (LHS, RHS)``
+ Perform an addition on constants.
+``sub (LHS, RHS)``
+ Perform a subtraction on constants.
+``mul (LHS, RHS)``
+ Perform a multiplication on constants.
+``shl (LHS, RHS)``
+ Perform a left shift on constants.
+``lshr (LHS, RHS)``
+ Perform a logical right shift on constants.
+``ashr (LHS, RHS)``
+ Perform an arithmetic right shift on constants.
+``and (LHS, RHS)``
+ Perform a bitwise and on constants.
+``or (LHS, RHS)``
+ Perform a bitwise or on constants.
+``xor (LHS, RHS)``
+ Perform a bitwise xor on constants.
Other Values
============
More information about the llvm-commits
mailing list