[CIR] Convert global_visibility from attribute to property (#190488)
Replace CIR_VisibilityAttr with
DefaultValuedProp<EnumProp<CIR_VisibilityKind>>
for global_visibility on GlobalOp and FuncOp. This removes the need for
custom
parse/print functions and simplifies callers to use direct enum values
instead
of wrapping/unwrapping VisibilityAttr.
[mlir][reducer] Add opt-pass-file option to opt-reduction pass (#189353)
Currently, the opt-reduction-pass only supports inputting the
optimization pipeline via the command line, which becomes cumbersome
when the pipeline is long. To address this, this PR introduces the
opt-pass-file option. This allows users to save the pipeline in a file
and provide the filename to parse the pipeline.
[clang][AST][NFC] Add default value to `Expr::isConstantInitializer()` parameter (#190313)
Almost every caller passes `false` for `ForRef`, or rather, doesn't care
what the value is. Use a default value instead.
[clang] implement CWG2064: ignore value dependence for decltype
The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.
Readds a few test cases from da98651
Fixes #61818
[clang] implement CWG2064: ignore value dependence for decltype
The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.
Readds a few test cases from da98651
Fixes #61818
[Clang] Fix concept cache for normalized fold expressions (#190312)
When both outer and inner pack substitution indexes are present, we
should cache both. Otherwise we will have wrong cached result.
This is a regression fix so no release note.
Fixes https://github.com/llvm/llvm-project/issues/190169
[clang] implement CWG2064: ignore value dependence for decltype
The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.
Readds a few test cases from da98651
Fixes #61818
[clang] diagnose block pointer types as invalid for constant template parameters (#190464)
Fixes a crash by making it ill-formed to have a constant template
parameter with a block pointer type.
Fixes #189247
[clang] ignore value dependence for decltype
The 'decltype' for a value-dependent (but non-type-dependent) should be known,
so this patch makes them non-opaque instead.
Fixes #61818
[clang] NFC: Add test case for #178324 and mark it as fixed (#190490)
Issue #178324 was actually fixed by #187755
We lost the "declaration does not declare anything" warning since the
regression was introduced, but that was because:
1) Since #78436 we treat __builtin_FUNCSIG in a dependent context
effectivelly as if it contained a template parameter.
2) Our decltype implementation treats eexpressions containing template
parameters as if they were completely opaque (but alas this goes against
the spec, which says in [temp.type]p4 this should be looking only at
type dependence).
3) Since the decltype is opaque, we don't know what lookup will find, so
we can't issue the warning because we don't know if we are going to end
up with a type or an expression.
Fixes #178324
[lldb] Inherit Host::GetEnvironment() when launching a wasm runtime (#190476)
Some WebAssembly runtimes might use environment variables such as `HOME`
or `XDG_CONFIG_HOME` to store configuration files, additionally some VMs
might allow wasm modules to read environment variables from the host.
Currently, if a runtime is launched using the WebAssembly platform it
doesn't inherit the environment. As a result wasm runtimes and modules
are unable to read from environment variables and might even fail to
launch (if the config file is required). This PR aims to resolve this
issue, I have tested this with the WARDuino runtime and my WIP gdbstub.
[clang] NFC: Add test case for #178324 and mark it as fixed
Issue #178324 was actually fixed by #187755
We lost the "declaration does not declare anything" warning since
the regression was introduced, but that was because:
1) Since #78436 we treat __builtin_FUNCSIG in a dependent context effectivelly as
if it contained a template parameter.
2) Our decltype implementation treats eexpressions containing template
parameters as if they were completely opaque (but alas this goes against
the spec, which says in [temp.type]p4 this should be looking only
at type dependence).
3) Since the decltype is opaque, we don't know what lookup will find,
so we can't issue the warning because we don't know if we are going
to end up with a type or an expression.
Fixes #178324
[CIR] Convert global_visibility from attribute to property
Replace CIR_VisibilityAttr with DefaultValuedProp<EnumProp<CIR_VisibilityKind>>
for global_visibility on GlobalOp and FuncOp. This removes the need for custom
parse/print functions and simplifies callers to use direct enum values instead
of wrapping/unwrapping VisibilityAttr.
[ConstantFolding] Non-constrained functions in strictfp
Non-constrained function calls, allowed in strictfp functions by
PR188297, are equivalent to their constrained counterparts with dynamic
rounding and strict exception handling. When constant folding the calls
of these functions, some cases cannot be folded due to unknown rounding
mode or floting-point exceptions that can be lost. This change adapts
constant folding for these case.
[ConstantFolding] Non-constrained functions in strictfp
Non-constrained function calls, allowed in strictfp functions by
PR188297, are equivalent to their constrained counterparts with dynamic
rounding and strict exception handling. When constant folding the calls
of these functions, some cases cannot be folded due to unknown rounding
mode or floting-point exceptions that can be lost. This change adapts
constant folding for these case.
[IR] Use iteration limit in stripPointerCastsAndOffsets (#190472)
Using a SmallPtrSet is not quite free for such a frequently called
operation. However, calls on ill-formed IR are not particularly rare, so
some iteration limit is needed. Therefore, use a simple counter.
Termination statistics on a Clang Release build for N>5:
2448 N=6
1295 N=7
480 N=8
294 N=9
160 N=10
14350 (endless loop)
Therefore, bound the number of iterations by 12, which should cover most
practically relevant cases.
It is worth noting that _all_ of the endless loop cases have the
[5 lines not shown]
[DA] Add overflow check in BanerjeeMIVtest
Add an overflow check in BanerjeeMIVtest.
Fix the related test case.
Signed-off-by: Ruoyu Qiu <cabbaken at outlook.com>
[mlir][LLVM] Fix incorrect verification of atomicrmw f{min,max}imumnum (#190474)
Fix llvm.atomicrmw fminimumnum and fmaximumnum to correctly take the
float operation verification path.