Commit Graph

560645 Commits

Author SHA1 Message Date
Joel E. Denny
8380a48aa0 [PGO] Add REQUIRES to test (#169531)
The test was added by b8ef25aa64. It
failed on at least the following bots, but the failure did not reproduce
on my test machines or in pre-commit CI:

- https://lab.llvm.org/buildbot/#/builders/190/builds/31643
- https://lab.llvm.org/buildbot/#/builders/65/builds/25949
- https://lab.llvm.org/buildbot/#/builders/154/builds/24417

d69e701496 did not fix the failure.
Hopefully this will.
2025-11-25 12:33:04 -05:00
Erich Keane
53e5cfdf8b [OpenACC][CIR] link clause lowering for global declare (#169524)
The 'link' clause is like the rest of the global clauses (copyin,
    create, device_resident), except it only has an entry op(thus no
dtor).

This patch also removes a bunch of now stales TODOs from the tests.
2025-11-25 17:23:50 +00:00
Manuel Carrasco
a860c8378f Revert "[clang][Driver] Support for the SPIR-V backend when compiling HIP (#167543)" (#169528)
This reverts commit 1a036732d2.

Reverted due to a failure in hip-spirv-backend-opt.c for
fuchsia-x86_64-linux.
2025-11-25 17:23:30 +00:00
Matt Arsenault
5017370a1c AMDGPU: Add baseline test for gws handling with AGPR inputs (#169372) 2025-11-25 12:04:09 -05:00
Matt Arsenault
1c5b1501ca CodeGen: Move libcall lowering configuration to subtarget (#168621)
Previously libcall lowering decisions were made directly
in the TargetLowering constructor. Pull these into the subtarget
to facilitate turning LibcallLoweringInfo into a separate analysis
in the future.
2025-11-25 11:59:56 -05:00
Hristo Hristov
5999cc8cee [libc++][stack] Applied [[nodiscard]] (#169468)
`[[nodiscard]]` should be applied to functions where discarding the
return value is most likely a correctness issue.

-
https://libcxx.llvm.org/CodingGuidelines.html#apply-nodiscard-where-relevant
2025-11-25 18:55:34 +02:00
Joel E. Denny
d69e701496 [PGO] Add missing target datalayout in test (#169520)
The test was added by b8ef25aa64. It
failed on at least the following bots, but the failure did not reproduce
on my test machines or in pre-commit CI:

- https://lab.llvm.org/buildbot/#/builders/190/builds/31638
- https://lab.llvm.org/buildbot/#/builders/190/builds/31638

This fix hopefully addresses at least the warnings there.
2025-11-25 11:42:34 -05:00
Alexey Bataev
eb1ff56e26 [SLP][NFC]Add a test for copyable operands, used multiple times, NFC 2025-11-25 08:40:00 -08:00
Samira Bakon
b93bb69dfa [clang][dataflow] Use containers with deterministic iteration order. (#169512) 2025-11-25 16:37:54 +00:00
Guy David
6a395fec1f [AArch64] Mark FMOVvXfY_ns as rematerializable, cheap (#169186) 2025-11-25 18:29:36 +02:00
Drew Kersnar
17852deda7 [NVPTX] Lower LLVM masked vector loads and stores to PTX (#159387)
This backend support will allow the LoadStoreVectorizer, in certain
cases, to fill in gaps when creating load/store vectors and generate
LLVM masked load/stores
(https://llvm.org/docs/LangRef.html#llvm-masked-store-intrinsics). To
accomplish this, changes are separated into two parts. This first part
has the backend lowering and TTI changes, and a follow up PR will have
the LSV generate these intrinsics:
https://github.com/llvm/llvm-project/pull/159388.

In this backend change, Masked Loads get lowered to PTX with `#pragma
"used_bytes_mask" [mask];`
(https://docs.nvidia.com/cuda/parallel-thread-execution/#pragma-strings-used-bytes-mask).
And Masked Stores get lowered to PTX using the new sink symbol syntax
(https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-st).

# TTI Changes
TTI changes are needed because NVPTX only supports masked loads/stores
with _constant_ masks. `ScalarizeMaskedMemIntrin.cpp` is adjusted to
check that the mask is constant and pass that result into the TTI check.
Behavior shouldn't change for non-NVPTX targets, which do not care
whether the mask is variable or constant when determining legality, but
all TTI files that implement these API need to be updated.

# Masked store lowering implementation details
If the masked stores make it to the NVPTX backend without being
scalarized, they are handled by the following:
* `NVPTXISelLowering.cpp` - Sets up a custom operation action and
handles it in lowerMSTORE. Similar handling to normal store vectors,
except we read the mask and place a sentinel register `$noreg` in each
position where the mask reads as false.

For example, 
```
t10: v8i1 = BUILD_VECTOR Constant:i1<-1>, Constant:i1<0>, Constant:i1<0>, Constant:i1<-1>, Constant:i1<-1>, Constant:i1<0>, Constant:i1<0>, Constant:i1<-1>
t11: ch = masked_store<(store unknown-size into %ir.lsr.iv28, align 32, addrspace 1)> t5:1, t5, t7, undef:i64, t10

->

STV_i32_v8 killed %13:int32regs, $noreg, $noreg, killed %16:int32regs, killed %17:int32regs, $noreg, $noreg, killed %20:int32regs, 0, 0, 1, 8, 0, 32, %4:int64regs, 0, debug-location !18 :: (store unknown-size into %ir.lsr.iv28, align 32, addrspace 1);

```

* `NVPTXInstInfo.td` - changes the definition of store vectors to allow
for a mix of sink symbols and registers.
* `NVPXInstPrinter.h/.cpp` - Handles the `$noreg` case by printing "_".

# Masked load lowering implementation details
Masked loads are routed to normal PTX loads, with one difference: a
`#pragma "used_bytes_mask"` is emitted before the load instruction
(https://docs.nvidia.com/cuda/parallel-thread-execution/#pragma-strings-used-bytes-mask).
To accomplish this, a new operand is added to every NVPTXISD Load type
representing this mask.
* `NVPTXISelLowering.h/.cpp` - Masked loads are converted into normal
NVPTXISD loads with a mask operand in two ways. 1) In type legalization
through replaceLoadVector, which is the normal path, and 2) through
LowerMLOAD, to handle the legal vector types
(v2f16/v2bf16/v2i16/v4i8/v2f32) that will not be type legalized. Both
share the same convertMLOADToLoadWithUsedBytesMask helper. Both default
this operand to UINT32_MAX, representing all bytes on. For the latter,
we need a new `NVPTXISD::MLoadV1` type to represent that edge case
because we cannot put the used bytes mask operand on a generic
LoadSDNode.
* `NVPTXISelDAGToDAG.cpp` - Extract used bytes mask from loads, add them
to created machine instructions.
* `NVPTXInstPrinter.h/.cpp` - Print the pragma when the used bytes mask
isn't all ones.
* `NVPTXForwardParams.cpp`, `NVPTXReplaceImageHandles.cpp` - Update
manual indexing of load operands to account for new operand.
* `NVPTXInsrtInfo.td`, `NVPTXIntrinsics.td` - Add the used bytes mask to
the MI definitions.
* `NVPTXTagInvariantLoads.cpp` - Ensure that masked loads also get
tagged as invariant.

Some generic changes that are needed:
* `LegalizeVectorTypes.cpp` - Ensure flags are preserved when splitting
masked loads.
* `SelectionDAGBuilder.cpp` - Preserve `MD_invariant_load` on masked
load SDNode creation
2025-11-25 10:26:15 -06:00
Manuel Carrasco
1a036732d2 [clang][Driver] Support for the SPIR-V backend when compiling HIP (#167543)
For HIP, the SPIR-V backend can be optionally activated with the -use-spirv-backend flag. This option uses the SPIR-V BE instead of the SPIR-V translator. These changes also ensure that -use-spirv-backend does not require external dependencies, such as spirv-as and spirv-link
2025-11-25 16:25:40 +00:00
Marco Elver
e04cca8561 [Clang][MemProf] Add end-to-end test for PGHO rewriting (#169243)
Add an end-to-end (non-LTO) test verifying that the optimization
pipeline is set up correctly for Profile Guided Heap Optimization (PGHO)
transforms. Ensure that both PGHO and AllocToken can stack, and the
AllocToken pass does not interfere with PGHO and vice versa.
2025-11-25 17:21:57 +01:00
Ebuka Ezike
7b5163d300 [lldb][NFC] use llvm::StringRef in ExtractContextAndIdentifer function (#169506)
this avoids allocation when checking if a method contains a path.
2025-11-25 16:20:26 +00:00
Erich Keane
6d21ce8797 [OpenACC][CIR] device_resident lowering for NS/global/struct declare (#169507)
This is the same as create/copyin, except it uses
declare_device_resident for the entry op.
2025-11-25 16:16:39 +00:00
Andrzej Warzyński
c582688b69 [MLIR][tensor] Simplify ExtractSliceOp::inferResultType (nfc) (#169313)
The `offsets` and `strides` arguments are neither used nor required -
removed them and simplify this hook.
2025-11-25 16:14:51 +00:00
Joel E. Denny
b8ef25aa64 [PGO] Fix zeroed estimated trip count (#167792)
Before PR #152775, `llvm::getLoopEstimatedTripCount` never returned 0.
If `llvm::setLoopEstimatedTripCount` were called with 0, it would zero
branch weights, causing `llvm::getLoopEstimatedTripCount` to return
`std::nullopt`.

PR #152775 changed that behavior: if `llvm::setLoopEstimatedTripCount`
is called with 0, it sets `llvm.loop.estimated_trip_count` to 0, causing
`llvm::getLoopEstimatedTripCount` to return 0. However, it kept
documentation saying `llvm::getLoopEstimatedTripCount` returns a
positive count.

Some passes continue to assume `llvm::getLoopEstimatedTripCount` never
returns 0 and crash if it does, as reported in issue #164254. To restore
the behavior they expect, this patch changes
`llvm::getLoopEstimatedTripCount` to return `std::nullopt` when
`llvm.loop.estimated_trip_count` is 0.
2025-11-25 11:05:13 -05:00
Marco Elver
02c9e8987a [InstCombine][MemProf] Preserve all metadata (#169242)
When rewriting operator new calls to their hot/cold variants for PGHO,
`!alloc_token` metadata was being dropped. This metadata is required by
the AllocToken pass to correctly instrument the optimized allocation.

Fix it by preserving all metadata.
2025-11-25 16:56:06 +01:00
Jay Foad
1c3b10f2e2 [AMDGPU] Remove isKernelLDS, add isKernel(const Function &). NFC. (#167300)
Since #142598 isKernelLDS has been a pointless wrapper around isKernel.
2025-11-25 15:43:18 +00:00
Sayan Saha
177e38286c [mlir][tosa] Get quantized element type with sign info. (#169387)
As mentioned in
a27bb38ee6/mlir/include/mlir/Dialect/Quant/IR/QuantTypes.h (L109)
`QuantType::getStorageType` doesn't capture the sign information. This
lead to the following IR to fail during verification:
```
func.func @clamp(%arg0:tensor<?x112x112x32x!quant.uniform<u8:f32, 0.023529412224888802:-128>>) -> (tensor<?x112x112x32x!quant.uniform<u8:f32, 0.023529412224888802:-128>>) {
    %0 = tosa.clamp %arg0 {max_val = 255 : ui8, min_val = 0 : ui8} : (tensor<?x112x112x32x!quant.uniform<u8:f32, 0.023529412224888802:-128>>) -> tensor<?x112x112x32x!quant.uniform<u8:f32, 0.023529412224888802:-128>>
    return %0 : tensor<?x112x112x32x!quant.uniform<u8:f32, 0.023529412224888802:-128>>
}
```
with `'tosa.clamp' op min/max attributes types are incompatible with
input/output element types` error
since `getStorageType` was returning signed integer but the clamp
attributes were unsigned.

This PR updates the usage of `getStorageType` in tosa codebase to
correctly use the signed info for the quantized type.
2025-11-25 10:32:23 -05:00
Craig Topper
ccbd0d1a69 [RISCV] Add assertions to VSETVLIInfo accessors. NFC (#169462) 2025-11-25 07:19:26 -08:00
Nick Sarnie
031d99836d [SPIRV] Error in backend for vararg functions (#169111)
SPIR-V doesn't support variadic functions, though we make an exception
for `printf`.

If we don't error, we generate invalid SPIR-V because the backend has no
idea how to codegen vararg functions as it is not described in the spec.
We get asm like this:

```
%27 = OpFunction %6 None %7
%28 = OpFunctionParameter %4
                                        ; -- End function
```

The above asm is totally invalid, there's no `OpFunctionEnd` and it
causes crashes in downstream tools like `spirv-as` and `spirv-link`.

We already have many `printf` tests locking down that this doesn't break
`printf`, it was already handled elsewhere at the time the error check
runs.

Note the SPIR-V Translator does the same thing, see
[here](https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/2703).

---------

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
2025-11-25 15:17:04 +00:00
Nick Sarnie
b3b83ac1e8 [offload][lit] Fix compilation of two offload tests (#169399)
These are C tests, not C++, so no function parameters means unspecified
number of parameters, not `void`.

These compile fine on the current tested offload targets because an
error is only
[thrown](https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaDecl.cpp#L10695)
if the calling convention doesn't support variadic arguments, which they
happen to.

When compiling this test for other targets that do not support variadic
arguments, we get an error, which does not seem intentional.

Just add `void` to the parameter list.

---------

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
2025-11-25 15:16:15 +00:00
Craig Topper
3564870a9f [RISCV] Initialize AltFmt and TWiden in the VSETVLIInfo default constructor. (#169457) 2025-11-25 07:05:51 -08:00
Craig Topper
4f5fb36ddb [RISCV] Use an enum class for AVL state ins RISCVInsertVSETVLI. NFC (#169455) 2025-11-25 07:05:03 -08:00
Craig Topper
9007b36b42 [RISCV] Add a InstRW to COPY in RISCVSchedSpacemitX60.td. (#169423)
This prevents the scheduler from thinking copy instructions are free. In
#167008, we saw cases where the scheduler moved ABI copies past other
instructions creating high register pressure that caused the register
allocator to run out of registers. They can't be spilled because the
physical register lifetime was increased, not the virtual register.

Ideally, we would detect what register class the COPY is for, but for now
I've just treated it as a scalar integer copy.
2025-11-25 07:04:11 -08:00
Erich Keane
be2dfce647 [OpenACC][CIR] Global declare 'copyin' clause lowering (#169498)
JUST like the 'create' clause, except the entry op is copyin instead of
create. Most of this is the test.
2025-11-25 15:01:14 +00:00
Matt Arsenault
eb5297e0ad RuntimeLibcalls: Add mustprogress to common function attributes (#167080) 2025-11-25 09:48:36 -05:00
Florian Hahn
a51e2ef0fe [VPlan] Treat VPVector(End)PointerRecipe as single-scalar, if ops are. (#169249)
VPVector(End)PointerRecipes are single-scalar if all their operands are.
This should be effectively NFC currently, but it should re-enable cost
checking for some more VPWidenMemoryRecipe after
https://github.com/llvm/llvm-project/pull/157387 as discovered by
John Brawn.
2025-11-25 14:46:30 +00:00
Ming Yan
25c95ebfa8 [flang][fir] Convert fir.do_loop with the unordered attribute to scf.parallel. (#168510)
Refines the existing conversion to allow `fir.do_loop` annotated with
`unordered` to be lowered to `scf.parallel`, while other loops retain
their original lowering.
2025-11-25 14:43:41 +00:00
Matt Arsenault
d8ae4d503a RuntimeLibcalls: Add __memcpy_chk, __memmove_chk, __memset_chk (#167053)
These were in TargetLibraryInfo, but missing from RuntimeLibcalls.
This only adds the cases that already have the non-chk variants
already. Copies the enabled-by-default logic from TargetLibraryInfo,
which is probably overly permissive. Only isPS opts-out.
2025-11-25 09:39:40 -05:00
GrumpyPigSkin
7f8c43a249 [X86][GISel] Fix crash on bitcasting i16 <-> half with gisel enabled. (#168456)
Added missing checks for casting half to/from i16 with global-isel
enabled.


Fixes #166557
2025-11-25 14:31:27 +00:00
Matt Arsenault
5818435c43 RuntimeLibcalls: Add a few libm entries from TargetLibraryInfo (#167049)
These are floating-point functions recorded in TargetLibraryInfo,
but missing from RuntimeLibcalls.
2025-11-25 14:30:59 +00:00
jeanPerier
077a280cf5 [flang][acc] remap symbol appearing in reduction clause (#168876)
This patch is a follow-up of #162306 for the reduction clause.

Inside the compute region that carries the reduction clause, a new
hlfir.declare is generated for symbol appearing in the reduction clause.
The input of this hlfir.declare is the acc.reduction result. The related
semantics::Symbol is remapped to the hlfir.declare result so that any
reference to the symbol inside the compute region will use this SSA
value as the starting point instead of the SSA value for the host
address.
2025-11-25 15:25:15 +01:00
Hristo Hristov
b37b307715 [libc++] Applied [[nodiscard]] to some general utilities (#169322)
`[[nodiscard]]` should be applied to functions where discarding the
return value is most likely a correctness issue.
- https://libcxx.llvm.org/CodingGuidelines.html#apply-nodiscard-where-relevant

The following functions/classes have been annotated in this patch:
- [x] `bind_back`, `bind_front`, `bind`
- [x] `function`, `mem_fn`
- [x] `reference_wrapper`
2025-11-25 16:24:38 +02:00
Paul Osmialowski
a7e715a141 [llvm][docs] Correct the list of the available -fveclib= options to match with the reality (#168205)
The command line reality is this:

$ clang -c prog.c -fveclib=accelerate
error: invalid value 'accelerate' in '-fveclib=accelerate'

$ clang -c prog.c -fveclib=Accelerate
prog.c:1:2: warning: This is only a test [-W#warnings]
    1 | #warning This is only a test
      |  ^
1 warning generated.

$ clang -c prog.c -fveclib=libmvec
prog.c:1:2: warning: This is only a test [-W#warnings]
    1 | #warning This is only a test
      |  ^
1 warning generated.

$ clang -c prog.c -fveclib=LIBMVEC
error: invalid value 'LIBMVEC' in '-fveclib=LIBMVEC'

$ clang -c prog.c -fveclib=massv
error: invalid value 'massv' in '-fveclib=massv'

$ clang -c prog.c -fveclib=MASSV
prog.c:1:2: warning: This is only a test [-W#warnings]
    1 | #warning This is only a test
      |  ^
1 warning generated.

$ clang -c prog.c -fveclib=sleef
error: invalid value 'sleef' in '-fveclib=sleef'

$ clang -c prog.c -fveclib=sleefgnuabi
error: invalid value 'sleefgnuabi' in '-fveclib=sleefgnuabi'

$ clang -c prog.c -fveclib=SLEEF
prog.c:1:2: warning: This is only a test [-W#warnings]
    1 | #warning This is only a test
      |  ^
1 warning generated.

$ clang -c prog.c -fveclib=darwin_libsystem_m
error: invalid value 'darwin' in '-fveclib=darwin_libsystem_m'

$ clang -c prog.c -fveclib=Darwin_libsystem_m
prog.c:1:2: warning: This is only a test [-W#warnings]
    1 | #warning This is only a test
      |  ^
1 warning generated.

$ clang -c prog.c -fveclib=armpl
error: invalid value 'armpl' in '-fveclib=armpl'

$ clang -c prog.c -fveclib=ARMPL
error: invalid value 'ARMPL' in '-fveclib=ARMPL'

$ clang -c prog.c -fveclib=ArmPL
prog.c:1:2: warning: This is only a test [-W#warnings]
    1 | #warning This is only a test
      |  ^
1 warning generated.

$ clang -c prog.c -fveclib=amdlibm
error: invalid value 'amdlibm' in '-fveclib=amdlibm'

$ clang -c prog.c -fveclib=AMDLIBM
clang: error: unsupported option 'AMDLIBM' for target 'aarch64'
2025-11-25 14:24:24 +00:00
Mikhail R. Gadelha
d615c14c22 [RISCV] Update SpacemiT-X60 vector floating-point instructions latencies (#150618)
This PR adds hardware-measured latencies for all instructions defined in
Section 13 of the RVV specification: "Vector Floating-Point
Instructions" to the SpacemiT-X60 scheduling model.
2025-11-25 11:21:34 -03:00
Jay Foad
d54168013a [LLVM] Use "syncscope" instead of "synchscope" in comments. NFC. (#134615)
This matches the spelling of the keyword in LLVM IR.
2025-11-25 14:11:49 +00:00
Erich Keane
4e9b76e23b [OpenACC][CIR] 'declare' lowering for globals/ns/struct-scopes (+create) (#169409)
This patch does the lowering for a 'declare' construct that is not a
function-local-scope. It also does the lowering for 'create', which has
an entry-op of create and exit-op of delete.

Global/NS/Struct scope 'declare's emit a single 'acc_ctor' and
'acc_dtor' (except in the case of 'link') per variable referenced. The
ctor is the entry op followed by a declare_enter. The dtor is a
get_device_ptr, followed by a declare_exit, followed by a delete(exit
op). This DOES include any necessary bounds.

This patch implements all of the above. We use a separate 'visitor' for
the clauses here since it is particularly different from the other uses,
AND there are only 4 valid clauses. Additionally, we had to split the
modifier conversion into its own 'helpers' file, which will hopefully
get some additional use in the future.
2025-11-25 05:56:34 -08:00
Colin Kinloch
1919cd6322 [analyzer] Fix non decimal macro values in tryExpandAsInteger (#168632)
Values were parsed into an unsigned APInt with just enough of a bit
width to hold the number then interpreted as signed values. This
resulted in hex, octal and binary literals from being interpreted as
negative when the most significant bit is 1.

For example the `-0b11` would have a bit width of 2, would be
interpreted as -1, then negated to become 1.
2025-11-25 13:41:33 +00:00
Walter Lee
f0e0a22158 [bazel] Delete redundant visibility (#169493)
default_visibility is already public.
2025-11-25 13:21:56 +00:00
Paul Walker
6bf3249fe9 [Clang][Sema] Emit diagnostic for __builtin_vectorelements(<SVEType>) when SVE is not available. (#168097)
As is done for other targets, I've moved the target type checking code
into SemaARM and migrated existing uses.

Fixes https://github.com/llvm/llvm-project/issues/155736
2025-11-25 13:14:10 +00:00
Durgadoss R
9e53ef3d8c [MLIR][NVVM] Update mbarrier.arrive.* Op (#168758)
This patch updates the mbarrier.arrive.* family of Ops to include 
all features added up-to Blackwell.
* Update the `mbarrier.arrive` Op to include shared_cluster
  memory space, cta/cluster scope and an option to lower using
  relaxed semantics.
* An `arrive_drop` variant is added for both the `arrive` and
  `arrive.nocomplete` operations.
* Updates for expect_tx and complete_tx operations.
* Verifier checks are added wherever appropriate.
* lit tests are added to verify the lowering to the intrinsics.

TODO:
* Updates for the remaining mbarrier family will be done in
  subsequent PRs. (mainly, arrive.expect-tx, test_wait and try_waits)

Signed-off-by: Durgadoss R <durgadossr@nvidia.com>
2025-11-25 18:32:13 +05:30
Jan Patrick Lehr
4bc654d649 Revert "[Flang] Move builtin .mod generation into runtimes" (#169489)
Reverts llvm/llvm-project#137828

Buildbot error in
https://lab.llvm.org/staging/#/builders/105/builds/37275
2025-11-25 13:54:27 +01:00
LLVM GN Syncbot
262716b35b [gn build] Port 07ad928d92 2025-11-25 12:47:00 +00:00
Nikolas Klauser
07ad928d92 [libc++] Introduce __specialized_algorithms (#167295) 2025-11-25 13:46:19 +01:00
Ramkumar Ramachandra
e06c148af7 [IVDesc] Use SCEVPatternMatch to improve code (NFC) (#168397) 2025-11-25 12:29:56 +00:00
Simon Pilgrim
af3af8ea5a [X86] setcc-wide-types.ll - cleanup check prefixes NFC (#169488)
Match typical prefixes used in x86 SSE/AVX tests
2025-11-25 12:19:59 +00:00
Jay Foad
4e37526fdb [AMDGPU] Fix test after #169378 2025-11-25 12:17:17 +00:00
Balázs Benics
17b19c5034 [analyzer] Unroll loops of compile-time upper-bounded loops (#169400)
Previously, only literal upper-bounded loops were recognized. This patch
relaxes this matching to accept any compile-time deducible constant
expression.

It would be better to rely on the SVals (values from the symbolic
domain), as those could potentially have more accurate answers, but this
one is much simpler.
Note that at the time we calculate this value, we have not evaluated the
sub-exprs of the condition, consequently, we can't just query the
Environment for the folded SVal.
Because of this, the next best tool in our toolbox is comp-time
evaluating the Expr.

rdar://165363923
2025-11-25 12:16:56 +00:00