Revert "[SSAF] Fix a stage2 test failure with ASan-instrumented clang - continued" (#218092)
Reverts llvm/llvm-project#217799 because it breaks other ASan buildbots
(e.g., https://lab.llvm.org/buildbot/#/builders/169/builds/25867):
```
[1692/5724] Building CXX object tools/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin/CMakeFiles/SSAFTestTransformationPlugin.dir/TestTransformation.cpp.o
FAILED: [code=1] tools/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin/CMakeFiles/SSAFTestTransformationPlugin.dir/TestTransformation.cpp.o
CCACHE_CPP2=yes CCACHE_HASHDIR=yes CCACHE_SLOPPINESS=pch_defines,time_macros /usr/bin/ccache /home/b/sanitizer-x86_64-linux-fast/build/llvm_build0/bin/clang++ -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin -I/home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin -I/home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/include -I/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/tools/clang/include -I/home/b/sanitizer-x86_64-linux-fast/build/llvm_build_asan_ubsan/include -I/home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include -nostdinc++ -isystem /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include -isystem /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1 -fsanitize=address,undefined -fno-sanitize-recover=all -Wl,--rpath=/home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/lib -L/home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/lib -lc++abi -fuse-ld=lld -w -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all -fsanitize-blacklist=/home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/utils/sanitizers/ubsan_ignorelist.txt -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17 -fPIC -UNDEBUG -fno-exceptions -funwind-tables -fno-rtti -fno-sanitize=all -MD -MT tools/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin/CMakeFiles/SSAFTestTransformationPlugin.dir/TestTransformation.cpp.o -MF tools/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin/CMakeFiles/SSAFTestTransformationPlugin.dir/TestTransformation.cpp.o.d -o tools/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin/CMakeFiles/SSAFTestTransformationPlugin.dir/TestTransformation.cpp.o -c /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin/TestTransformation.cpp
In file included from /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/test/Analysis/Scalable/source-edit-generation/Plugins/TestTransformationPlugin/TestTransformation.cpp:21:
In file included from /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/include/clang/AST/ASTContext.h:18:
In file included from /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/include/clang/AST/CanonicalType.h:17:
In file included from /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/include/clang/AST/Type.h:20:
In file included from /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/include/clang/AST/Decl.h:16:
In file included from /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/include/clang/AST/APNumericStorage.h:12:
In file included from /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/APFloat.h:19:
In file included from /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:12:
In file included from /home/b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/ADT/Hashing.h:58:
In file included from /home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/string:603:
/home/b/sanitizer-x86_64-linux-fast/build/libcxx_install_asan_ubsan/include/c++/v1/__debug_utils/sanitizers.h:42:4: error: "We can't disable ASAN container checks when libc++ has been built with ASAN container checks enabled"
[10 lines not shown]
[AMDGPU] Add custom lowering for E5M3 path for packed convert instructions through `convert.{to|from}.arbitrary.fp` (#218056)
Some packed convert instructions support producing FP8 floating output
in the E5M3 format by control through the CLAMP bit. Currently, we have
builtins and intrinsics that support that lowering.
This PR adds lowering through the newly added
`convert.{to|from}.arbitrary.fp` intrinsics.
[lldb] Canonicalize DW_OP_GNU_const_index to the generic type (#217262)
`DW_OP_GNU_const_index` reads a machine-address-sized constant from the
address table and pushes it as a generic value. The generic type has the
size of an address on the target, so on a 32-bit compilation unit the
pushed value should be a 32-bit scalar.
`DWARFUnit::ReadAddressFromDebugAddrSection` reads the correct number of
bytes, but the evaluator case pushed the result as `Scalar(value)`,
where
`value` is a 64-bit `lldb::addr_t`, leaving a 64-bit scalar on the stack
instead of canonicalizing to `8 * address_size` like the other
constant-pushing opcodes.
Use `to_generic`, as `DW_OP_addrx` / `DW_OP_GNU_addr_index` already do,
so the pushed value has the generic type's width.
Adds a `DW_OP_GNU_const_index_address_size` unit test asserting both the
wraparound of generic arithmetic at the 32-bit address size and the
[3 lines not shown]
[DirectX] Add support for heap resources to `DXILResourceMap` (#216454)
`DXILResourceMap` now handles a new `llvm.dx.resource.handlefromheap`
intrisics and adds the heap resources to the resource map.
A new member `HeapResourceID` has been added to `ResourceInfo` to
distinguish between heap resource instances created from different
indices. The `HeapResourceID` is unique for each heap index `Value*`, so
multiple handle creation calls using the same index `Value*` resolve to
the same resource.
Heap resources do not have register bindings, so the `Binding` member on
`ResourceInfo` is now optional.
All places that were expecting binding to exist are updated to handle
bindless heap resources. In most cases that means skipping them, such as
when generating DXIL resource metadata, creating PSV resource entries or
pretty-printing the resource table comment for the module disassembly
output.
[5 lines not shown]
[DAG] Remove trivial VP SDNodes. NFC
This removes the codegen parts of the trivial VP intrinsics. It's quite far reaching, but the general categories of code removed are:
- Removing definitions from VPIntrinsics.def
- Legalization and expansion code
- MatchContext used to match over both VP and non-VP nodes
- Some dead DAGCombines and folds in SelectionDAGBuilder
There are still more things to be cleaned up after this, e.g. removing more of the VPIntrinsic class hierarchy, removing ExpandVectorPredication/moving expansion into other places, removing MatchContext from SDPatternMatch
[DAG] Expand vp.*rem and vp.cttz.elts with non-vp nodes.
Trivial VP SDNodes will be removed in an upcoming patch. The division is still predicated so we avoid UB.
[Flang] Repair intrinsic CUBLAS USE association (#217455)
This is a fix targeted at the specific code berkeleygw. It adds a
general extension by which imports of intrinsic functions can shadow
imported user functions and adds a single exception for CUBLAS `zgemm`
USE-association collision with an equivalent user external interface.
When the intrinsic CUBLAS generic and an equivalent external interface
are USE-associated under the same name, Flang now selects the CUBLAS
generic via a default-on compatibility extension. This preserves the
CUBLAS CUDA-specific overloads instead of creating an unusable local
association.
The repair warns by default under
`-Wintrinsic-module-use-association-extension`;
`-fno-intrinsic-module-use-association` retains the prior semantic
error, and `-Wno-intrinsic-module-use-association-extension` suppresses
the warning.
[BOLT] Parse .eh_frame CFI programs on demand to reduce memory
BOLT read the entire .eh_frame up front via DwCtx->getEHFrame(), which
parses and caches the CFI instruction program of every CIE/FDE in the
binary for the whole run. On a large binary, this dominated
file-object discovery: CFIProgram::parse accounted for ~6.5 GB and the
cached DWARFDebugFrame ~6.9 GB of live memory. Yet the CFI programs
are only consumed in CFIReaderWriter::fillCFIInfoFor, and only for the
functions BOLT actually disassembles. discoverFileObjects itself needs
nothing but each FDE's address and range for function-boundary checks.
Here we parse .eh_frame for its index only, and decode each function's
CFI program on demand, lazily, only for the functions that really need
it. In a large binary, DWARFDebugFrame::parse drops from 6922.2 MB
to 587.6 MB, the residual being the lightweight FDE/CIE index (entries
without instruction programs), and readSpecialSections falls from
7078.7 MB to 738.6 MB on the tested binary for which BOLT's RSS is
about 80-120GB.
[DebugInfo] Allow .eh_frame CFI programs to be parsed lazily
BOLT read the entire .eh_frame up front via DwCtx->getEHFrame(), which
parses and caches the CFI instruction program of every CIE/FDE in the
binary for the whole run. On a large binary, this dominated
file-object discovery: CFIProgram::parse accounted for ~6.5 GB and the
cached DWARFDebugFrame ~6.9 GB of live memory (from 5 to 10% of total
anon peak RSS).
This new interface allows DebugInfo's users to optionally parse CFIs
on demand, only when necessary. On BOLT, this is an important lever
to manage memory utilization when processing large binaries.
[semantics][acc] start handling clauses that use sections and components (#211606)
## Motivation
The current implementation of checking OpenACC data sharing clauses and
references is rather adhoc because the machinery could was only designed
to keep track of a single identifier. Sections currently track the base
object to which the refer while component reference throw away their
declared object. Duplicate / contradictory clause checking also has
similar issues. For example:
```fortran
subroutine outside_copied_section()
implicit none
real :: a(3)
!$acc parallel default(none) copy(a(1:2))
a(2) = -1.0
a(3) = 1.0
a(1) = a(2) + a(3)
!$acc end parallel
[62 lines not shown]
[WPD] Dereference `GlobalAlias` targets (#215880)
When Whole Program Devirtualization evaluates virtual call targets, if
we do not unwrap GlobalAliases to their underlying aliasee,
interprocedural optimizations (IPSCCP for instance) fail to propagate
attributes (e.g., `noundef`) or fold return values.
[clang][driver][darwin] Use DefaultDeploymentTarget when inferring deployment target from SDK (#217983)
Use "DefaultDeploymentTarget" from SDKSettings.json instead of "Version"
for the inferred deployment target version. This only affects the
deployment target; other uses of "Version" (e.g., -target-sdk-version=)
are unchanged.
rdar://184842209
[SLP] Cost using TCK_CodeSize under -Os and -Oz (#217398)
Refactor to centralize the cost kind decision in the SLP.
In practice there appears to be little change in the codegen as a result
of this change due to current backend costing.
Fixes #153376.
[WIP][VPlan] Optimize blend masks during creation
Sort the incoming edges according to RPOT order so that we could use
simpler source block mask instead of the edge mask.