platform/upstream/llvm.git
21 months agoRevert "Remove the dependency between lib/DebugInfoDWARF and MC."
Shubham Sandeep Rastogi [Thu, 15 Dec 2022 02:31:11 +0000 (18:31 -0800)]
Revert "Remove the dependency between lib/DebugInfoDWARF and MC."

This reverts commit 7dde94251e1c9e4634f5d51d41f2d4a191258fb3.

Because of test failures:

  lldb-shell :: SymbolFile/DWARF/x86/DW_AT_loclists_base.s
  lldb-shell :: SymbolFile/DWARF/x86/debug_loc.s
  lldb-shell :: SymbolFile/DWARF/x86/debug_loc_and_loclists.s
  lldb-shell :: SymbolFile/DWARF/x86/debug_loclists-dwo.s
  lldb-shell :: SymbolFile/DWARF/x86/debug_loclists-dwp.s
  lldb-shell :: SymbolFile/DWARF/x86/dwp.s
  lldb-shell :: SymbolFile/DWARF/x86/unused-inlined-params.test
  lldb-shell :: SymbolFile/NativePDB/inline_sites.test
  lldb-shell :: SymbolFile/NativePDB/local-variables-registers.s
  lldb-shell :: SymbolFile/NativePDB/nested-blocks-same-address.s

21 months ago[mlir] Use llvm::transformOptional (NFC)
Kazu Hirata [Thu, 15 Dec 2022 02:32:09 +0000 (18:32 -0800)]
[mlir] Use llvm::transformOptional (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[clang-tidy] Use llvm::transformOptional (NFC)
Kazu Hirata [Thu, 15 Dec 2022 02:27:39 +0000 (18:27 -0800)]
[clang-tidy] Use llvm::transformOptional (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months ago[clang] Use llvm::transformOptional (NFC)
Kazu Hirata [Thu, 15 Dec 2022 02:19:25 +0000 (18:19 -0800)]
[clang] Use llvm::transformOptional (NFC)

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

21 months agoRemove the dependency between lib/DebugInfoDWARF and MC.
Shubham Sandeep Rastogi [Thu, 6 Oct 2022 19:15:07 +0000 (12:15 -0700)]
Remove the dependency between lib/DebugInfoDWARF and MC.

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

21 months ago[NFC] Cleanup: Remove unnecessary use of Function::getBasicBlockList()
Vasileios Porpodas [Tue, 13 Dec 2022 23:13:22 +0000 (15:13 -0800)]
[NFC] Cleanup: Remove unnecessary use of Function::getBasicBlockList()

21 months ago[gn build] Port 3ec6c997c67d
LLVM GN Syncbot [Thu, 15 Dec 2022 01:19:28 +0000 (01:19 +0000)]
[gn build] Port 3ec6c997c67d

21 months ago[libc++] Implement P1169R4 (static operator())
Nikolas Klauser [Sat, 1 Oct 2022 19:25:13 +0000 (21:25 +0200)]
[libc++] Implement P1169R4 (static operator())

Reviewed By: ldionne, huixie90, #libc

Spies: EricWF, libcxx-commits, royjacobson

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

21 months agoEmit unwind information in the .debug_frame section when the .cfi_sections .debug_fra...
Shubham Sandeep Rastogi [Thu, 15 Dec 2022 00:44:21 +0000 (16:44 -0800)]
Emit unwind information in the .debug_frame section when the .cfi_sections .debug_frame directive is used.

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

21 months agoRevert "Emit unwind information in the .debug_frame section when the .cfi_sections...
Shubham Sandeep Rastogi [Thu, 15 Dec 2022 00:41:00 +0000 (16:41 -0800)]
Revert "Emit unwind information in the .debug_frame section when the .cfi_sections .debug_frame directive is used."

This reverts commit 28edf3349bd1d595270c17ec73e49999175f1212.

This is because:

The Buildbot has detected a failed build on builder llvm-clang-x86_64-sie-ubuntu-fast while building llvm.

Full details are available at:
   https://lab.llvm.org/buildbot#builders/139/builds/32856

Worker for this Build: sie-linux-worker
Blamelist:
   Shubham Sandeep Rastogi <srastogi22@apple.com>

BUILD FAILED: 40459 expected passes 83 expected failures 26251 unsupported tests 1 unexpected failures (failure)

Step 6 (test-build-unified-tree-check-all) failure: 40459 expected passes 83 expected failures 26251 unsupported tests 1 unexpected failures (failure)
******************** TEST 'LLVM :: DebugInfo/debugframeinfo.s' FAILED ********************
Script:
--
: 'RUN: at line 1';   /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/llvm-mc -filetype=obj -triple=arm64-apple-darwin22.1.0 /home/buildbot/buildbot-root/llvm-project/llvm/test/DebugInfo/debugframeinfo.s -o /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/test/DebugInfo/Output/debugframeinfo.s.tmp.o
: 'RUN: at line 2';   /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/llvm-dwarfdump -debug-frame /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/test/DebugInfo/Output/debugframeinfo.s.tmp.o | /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/FileCheck /home/buildbot/buildbot-root/llvm-project/llvm/test/DebugInfo/debugframeinfo.s
--
Exit Code: 1

Command Output (stderr):
--
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/bin/llvm-mc: error: unable to get target for 'arm64-apple-darwin22.1.0', see --version and --triple.

21 months agoEmit unwind information in the .debug_frame section when the .cfi_sections .debug_fra...
Shubham Sandeep Rastogi [Thu, 8 Dec 2022 18:55:52 +0000 (10:55 -0800)]
Emit unwind information in the .debug_frame section when the .cfi_sections .debug_frame directive is used.

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

21 months ago[mlir][arith][spirv] Account for possible type conversion failures
Jakub Kuderski [Thu, 15 Dec 2022 00:32:40 +0000 (19:32 -0500)]
[mlir][arith][spirv] Account for possible type conversion failures

Check results of all type conversions in `--convert-arith-to-spirv`.

Fixes: https://github.com/llvm/llvm-project/issues/59496

Reviewed By: antiagainst

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

21 months ago[IR] Adds Function::erase() for erasing a range of basic blocks
Vasileios Porpodas [Wed, 14 Dec 2022 01:04:01 +0000 (17:04 -0800)]
[IR] Adds Function::erase() for erasing a range of basic blocks

This is part of a series of patches that aim at making Function::getBasicBlockList() private.

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

21 months ago[HWASAN] Added dtls_ member variable which is needed by __lsan::GetThreadRangesLocked.
Kirill Stoimenov [Wed, 14 Dec 2022 23:47:25 +0000 (23:47 +0000)]
[HWASAN] Added dtls_ member variable which is needed by __lsan::GetThreadRangesLocked.

Reviewed By: vitalybuka

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

21 months ago[RISCV] Remove Group<m_riscv_Features_Group> from mcmodel_EQ_medlow/mcmodel_EQ_medany...
Craig Topper [Wed, 14 Dec 2022 23:58:02 +0000 (15:58 -0800)]
[RISCV] Remove Group<m_riscv_Features_Group> from mcmodel_EQ_medlow/mcmodel_EQ_medany. NFCI

As far as I can tell m_riscv_Features_Group is for options that
can be passed to cc1's -target-feature. These mcmodel aliases aren't
that.

I think they get treated as aliases and disappear before we get
to processing m_riscv_Features_Group so it didn't cause any problems.

I've left them in m_Group to match mcmodel_EQ.

21 months ago[NFC] Cleanup: Replace Function::getBasicBlockList().splice() with Function::splice()
Vasileios Porpodas [Tue, 13 Dec 2022 23:49:48 +0000 (15:49 -0800)]
[NFC] Cleanup: Replace Function::getBasicBlockList().splice() with Function::splice()

This is part of a series of patches that aim at making Function::getBasicBlockList() private.

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

21 months ago[flang] Lower exponentiation without using pgmath.
Slava Zakharin [Wed, 14 Dec 2022 18:22:00 +0000 (10:22 -0800)]
[flang] Lower exponentiation without using pgmath.

Exponentiation is lowered to either math::FPowI or Fortran runtime
call (in case of --math-runtime=precise).

MathToFuncs convertor will convert math::FPowI operations with
exponent width >32 to calls of outlined implementations and otherwise
will leave the operation to MathToLLVM convertor.

Reviewed By: jeanPerier

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

21 months ago[RISCV][CodeGen][SelectionDAG] Recursively check hasAllNBitUsers for logical machine...
Nitin John Raj [Wed, 14 Dec 2022 22:03:43 +0000 (14:03 -0800)]
[RISCV][CodeGen][SelectionDAG] Recursively check hasAllNBitUsers for logical machine opcodes

We don’t have W versions of AND/OR/XOR/ANDN/ORN/XNOR so we should recursively check their users. We should limit the recursion to SelectionDAG::MaxRecursionDepth levels.

We need to add a Depth argument, all existing callers should pass 0 to the Depth. The new recursive calls should increment it by 1. At the top of the function we should give up and return false if Depth >= SelectionDAG::MaxRecursionDepth.

Reviewed By: craig.topper

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

21 months ago[mlir][sparse] Make the remaining integration tests run with vectorization.
bixia1 [Wed, 14 Dec 2022 22:13:13 +0000 (14:13 -0800)]
[mlir][sparse] Make the remaining integration tests run with vectorization.

Reviewed By: aartbik

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

21 months ago[mlir][sparse] Add another call to ConvertVectorToLLVMPass, to lower the vector opera...
bixia1 [Tue, 13 Dec 2022 18:41:12 +0000 (10:41 -0800)]
[mlir][sparse] Add another call to ConvertVectorToLLVMPass, to lower the vector operations added by ConvertMathToLLVMPass.

Run sparse_tanh with vectorization.

Reviewed By: aartbik

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

21 months ago[NFC] Fixes ModuleMaker example build failure caused by c143b77b30fc23f70aac94be66e41...
Vasileios Porpodas [Wed, 14 Dec 2022 21:29:10 +0000 (13:29 -0800)]
[NFC] Fixes ModuleMaker example build failure caused by c143b77b30fc23f70aac94be66e412651771c0fc

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

21 months ago[Support] Add llvm::transformOptional
Kazu Hirata [Wed, 14 Dec 2022 22:51:05 +0000 (14:51 -0800)]
[Support] Add llvm::transformOptional

llvm::Optional<T> has transform, which is equivalent to
std::optional<T>::transform.  The problem is that
std::optional<T>::transform won't be available until C++23, implying
that we probably cannot use it in our codebase untli 2028 or so.  We
certainly don't want to keep llvm::Optional just for transform.

This patch adds llvm::transformOptional to STLForwardCompat.h so that
we can use transform during the migration to std::optional and beyond.

I've shamelessly borrowed the implementation and test from
llvm/include/llvm/ADT/Optional.h and
llvm/unittests/ADT/OptionalTest.cpp respectively.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716

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

21 months ago[mlir][tensor] Move tiling tensor.pad op tests from Linalg/ to Tensor/
Hanhan Wang [Tue, 13 Dec 2022 23:35:18 +0000 (15:35 -0800)]
[mlir][tensor] Move tiling tensor.pad op tests from Linalg/ to Tensor/

Reviewed By: nicolasvasilache, springerm

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

21 months ago[LV] Add extra test for D139927.
Florian Hahn [Wed, 14 Dec 2022 22:47:05 +0000 (22:47 +0000)]
[LV] Add extra test for D139927.

21 months ago[SPARC][clang] Add SPARC target feature flags
Koakuma [Wed, 14 Dec 2022 22:35:04 +0000 (17:35 -0500)]
[SPARC][clang] Add SPARC target feature flags

This adds some SPARC feature flags to clang, for those that we have in common with GCC:

-m[no-]fpu
-m[no-]fsmuld
-m[no-]popc
-m[no-]vis
-m[no-]vis2
-m[no-]vis3
-m[hard/soft]-quad-float

All have the same meanings as GCC's options (https://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html).

This fixes, among other things, the -mno-fpu part of bug #40792

Reviewed By: nickdesaulniers

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

21 months ago[llvm][DebugInfo] Backport DW_AT_default_value for template args
Michael Buch [Tue, 13 Dec 2022 17:46:04 +0000 (17:46 +0000)]
[llvm][DebugInfo] Backport DW_AT_default_value for template args

**Summary**

Starting with DWARFv5, DW_AT_default_value can be used to indicate
that a template argument has a default value. With this patch LLVM
will emit the this attribute earlier versions of DWARF, unless
compiling with -gstrict-dwarf.

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

21 months ago[clang][DebugInfo] Attach DW_AT_default_value to template arg metadata regardless...
Michael Buch [Tue, 13 Dec 2022 17:40:02 +0000 (17:40 +0000)]
[clang][DebugInfo] Attach DW_AT_default_value to template arg metadata regardless of DwarfVersion

**Summary**

Starting with DWARFv5, DW_AT_default_value can be used to indicate
that a template argument has a default value. With this patch Clang
will attach the attribute to the debug metadata regardless of version.

In a follow-up patch we will change llvm to emit this attribute in
earlier versions of DWARF, unless compiling with -gstrict-dwarf.

**Details**

* Previously the DwarfVersion check in CGDebugInfo was inconsistent:
  For non-type template arguments we attached the attribute to the debug
  metadata in DWARFv5 only. Whereas for type template arguments we didn't
  have such a version restriction. With this patch we attach the attribute
  regardless of DWARF version (and instead offload the check to the AsmPrinter
  in a future patch).

21 months ago[mlir][sparse] Moving/renaming genBuffer to allocaBuffer
wren romano [Wed, 14 Dec 2022 20:58:50 +0000 (12:58 -0800)]
[mlir][sparse] Moving/renaming genBuffer to allocaBuffer

This allows allocaBuffer to be used outside of SparseTensorConversion.cpp, which will be helpful for a some future commits.

Reviewed By: aartbik, Peiming

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

21 months ago[mlir][sparse] introduce sparse_tensor::StorageSpecifierType and related operations...
Peiming Liu [Tue, 13 Dec 2022 19:49:43 +0000 (19:49 +0000)]
[mlir][sparse] introduce sparse_tensor::StorageSpecifierType and related operations on it

Reviewed By: aartbik

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

21 months ago[NFC] Fixes BrainF example build failure caused by c143b77b30fc23f70aac94be66e4126517...
Vasileios Porpodas [Wed, 14 Dec 2022 22:03:47 +0000 (14:03 -0800)]
[NFC] Fixes BrainF example build failure caused by c143b77b30fc23f70aac94be66e412651771c0fc

21 months ago[docs] Updates ProgrammersManual to reflect the change that BasicBlock::getInstList...
Vasileios Porpodas [Wed, 14 Dec 2022 21:45:26 +0000 (13:45 -0800)]
[docs] Updates ProgrammersManual to reflect the change that BasicBlock::getInstList() is private.

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

21 months agoRevert "[profile] Add binary ids into indexed profiles"
Gulfem Savrun Yeniceri [Wed, 14 Dec 2022 21:45:50 +0000 (21:45 +0000)]
Revert "[profile] Add binary ids into indexed profiles"

This reverts commit 7734053fd98e7d5ddc749808ce38134686425fb7
because it broke powerpc64 bot:
https://lab.llvm.org/buildbot#builders/231/builds/6229

21 months agoAMDGPU: Update test
Matt Arsenault [Wed, 14 Dec 2022 21:47:16 +0000 (16:47 -0500)]
AMDGPU: Update test

21 months ago[EarlyIfConversion] Add target hook to allow for multiple ifcvt iterations.
Hendrik Greving [Wed, 14 Dec 2022 00:53:05 +0000 (16:53 -0800)]
[EarlyIfConversion] Add target hook to allow for multiple ifcvt iterations.

Adds a target hook canPredicatePredicatedInstr(const MachineInstr&) that
assumes an instruction is already predicated and returns true if it can
be predicated again, used by the early if-conversion pass in order to
iterate multiple times on architectures supporting predicate logic.

No test added since there is no upstream target that can take advantage.

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

21 months ago[NFC][libc++][format] Uses qualified calls.
Mark de Wever [Wed, 14 Dec 2022 19:10:23 +0000 (20:10 +0100)]
[NFC][libc++][format] Uses qualified calls.

Changes all unqualified calls to __throw_format_error to use a qualified
call.

Reviewed By: #libc, philnik

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

21 months ago[mlir][sparse][simd] only accept proper unit stride subscripts
Aart Bik [Wed, 14 Dec 2022 01:17:45 +0000 (17:17 -0800)]
[mlir][sparse][simd] only accept proper unit stride subscripts

Reviewed By: bixia

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

21 months ago[HLSL] Add trunc library function
Joshua Batista [Tue, 13 Dec 2022 00:09:22 +0000 (16:09 -0800)]
[HLSL] Add trunc library function

Reviewed By: python3kgae

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

21 months ago[RISCV] Add missing signext attribute to test. NFC
Craig Topper [Wed, 14 Dec 2022 20:38:41 +0000 (12:38 -0800)]
[RISCV] Add missing signext attribute to test. NFC

The other operands in this function had it and every other test
in the file has it. So I assume this was a mistake.

21 months ago[profile] Add binary ids into indexed profiles
Gulfem Savrun Yeniceri [Thu, 13 Oct 2022 00:50:10 +0000 (00:50 +0000)]
[profile] Add binary ids into indexed profiles

This patch adds support for including binary ids in an indexed profile.
It adds a new field into the header that points to the offset of the
binary id section. The binary id section consists of a size of the
section, and a list of binary ids (if they are present) that consist
of two parts: length and data.

This patch guarantees that indexed profile is backwards compatible
after adding binary ids.

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

21 months agoInstCombine: Add baseline tests for folds of is.fpclass with fneg/fabs
Matt Arsenault [Sun, 11 Dec 2022 20:23:26 +0000 (15:23 -0500)]
InstCombine: Add baseline tests for folds of is.fpclass with fneg/fabs

21 months ago[NFC] Fix warnings in EXPENSIVE_CHECKS build
Vasileios Porpodas [Wed, 14 Dec 2022 19:50:06 +0000 (11:50 -0800)]
[NFC] Fix warnings in EXPENSIVE_CHECKS build

21 months agollvm-reduce: Fix invalid reductions with llvm.used
Matt Arsenault [Fri, 9 Dec 2022 17:12:39 +0000 (12:12 -0500)]
llvm-reduce: Fix invalid reductions with llvm.used

Fixes issue 59413.

21 months ago[RISCV] Add IsSignExtendingOpW to the Zknh SHA256 instructions.
Craig Topper [Wed, 14 Dec 2022 19:42:59 +0000 (11:42 -0800)]
[RISCV] Add IsSignExtendingOpW to the Zknh SHA256 instructions.

On RV64 these instructions produce a 32-bit value and sign extend
to 64-bits.

Reviewed By: reames

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

21 months ago[GVN] GVNPass::ValueTable::lookupOrAdd - merge isa<> and cast<> into single dyn_cast...
Simon Pilgrim [Wed, 14 Dec 2022 19:47:52 +0000 (19:47 +0000)]
[GVN] GVNPass::ValueTable::lookupOrAdd - merge isa<> and cast<> into single dyn_cast<>. NFCI.

Avoid calling separate isa<> and cast<> if we can - dyn_cast<> can more efficiently check for a safe cast and give the casted pointer.

21 months ago[clang][dataflow] Remove old diagnoser API
Dani Ferreira Franco Moura [Wed, 14 Dec 2022 19:27:03 +0000 (20:27 +0100)]
[clang][dataflow] Remove old diagnoser API

This is a clean up following the revision D139868 (https://reviews.llvm.org/D139868).

Reviewed By: gribozavr2, ymandel

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

21 months ago[GVN] hasUsersIn - merge isa<> and cast<> into single dyn_cast<> and convert for...
Simon Pilgrim [Wed, 14 Dec 2022 19:42:37 +0000 (19:42 +0000)]
[GVN] hasUsersIn - merge isa<> and cast<> into single dyn_cast<> and convert for-range loop to any_of() test. NFCI.

Avoid running isa<> and cast<> if we can - dyn_cast<> can more efficiently check for a safe cast and give the casted pointer.

21 months agoTSAN: (Re)Mark shadow memory nondumpable after a reset
Wiktor Garbacz [Wed, 14 Dec 2022 17:56:13 +0000 (09:56 -0800)]
TSAN: (Re)Mark shadow memory nondumpable after a reset

Shadow memory was not marked as non-dumpable after a reset resulting in process taking a very long time to generate a coredump.

Reviewed By: vitalybuka

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

21 months agoFixes EXPENSIVE_CHECKS build failure caused by 7b684119abc7d94bad47ec0b97b35598fac412d3
Vasileios Porpodas [Wed, 14 Dec 2022 19:13:12 +0000 (11:13 -0800)]
Fixes EXPENSIVE_CHECKS build failure caused by 7b684119abc7d94bad47ec0b97b35598fac412d3

21 months agoSupport: Try to fix msan error in sys::Wait
Matt Arsenault [Wed, 14 Dec 2022 19:09:09 +0000 (14:09 -0500)]
Support: Try to fix msan error in sys::Wait

21 months ago[mlir][SparseTensor] Add a few tests for sparse vectorization
Quentin Colombet [Thu, 8 Dec 2022 11:45:19 +0000 (11:45 +0000)]
[mlir][SparseTensor] Add a few tests for sparse vectorization

These tests covers mulf, ori, and subi.

NFC

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

21 months ago[RISCV] Avoid generate large LMUL vmv.s.x or fvmv.s.f
Philip Reames [Wed, 14 Dec 2022 15:27:53 +0000 (07:27 -0800)]
[RISCV] Avoid generate large LMUL vmv.s.x or fvmv.s.f

This is a follow up to patch discussion on D139656. As noted there, M2/M4/M8 versions of these instructions don't actually exist, and using them results in overly constrained register allocation.

In that review, we'd talked about moving towards a variant of the instructions which ignored LMUL. I decided to see what happened if we just stopped generating the high LMUL variants, and the results are surprisingly neutral. I only see one minor thing which looks like a real regression among all the churn. I think this is worth doing now to loosen register allocation constraints, and avoid digging our hole around these instructions deeper while thinking about the right model change.

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

21 months ago[IR] Adds Function::splice() member functions
Vasileios Porpodas [Tue, 13 Dec 2022 21:22:04 +0000 (13:22 -0800)]
[IR] Adds Function::splice() member functions

This is part of a series of patches that aim at making Function::getBasicBlockList() private.

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

21 months ago[FileCheck] llvm::Optional => std::optional
Fangrui Song [Wed, 14 Dec 2022 18:44:30 +0000 (18:44 +0000)]
[FileCheck] llvm::Optional => std::optional

Don't touch FileCheck.cpp:698 StringSwitch<Optional<binop_eval_t>>(FuncName).
MSVC and older GCC may report errors:

error C2664: 'llvm::StringSwitch<std::optional<llvm::binop_eval_t>,T> &llvm::StringSwitch<T,T>::Case(llvm::StringLiteral,T)': cannot convert argument 2 from 'overloaded-function' to 'T'
        with
        [
            T=std::optional<llvm::binop_eval_t>
        ]

llvm/lib/FileCheck/FileCheck.cpp:699:44: error: no matching function for call to ‘llvm::StringSwitch<std::optional<llvm::Expected<llvm::ExpressionValue> (*)(const llvm::ExpressionValue&, const llvm::ExpressionValue&)> >::Case(const char [4], <unresolved overloaded function type>)’
                      .Case("add", operator+)
                                            ^

21 months ago[CodeComplete] Provide designated-init completions in (const) reference context
Sam McCall [Wed, 14 Dec 2022 16:26:14 +0000 (17:26 +0100)]
[CodeComplete] Provide designated-init completions in (const) reference context

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

21 months ago[RISCV] Add a bit to TSFlags to mark SignExtendingOpW instructions for SExtWRemoval.
Craig Topper [Wed, 14 Dec 2022 18:30:59 +0000 (10:30 -0800)]
[RISCV] Add a bit to TSFlags to mark SignExtendingOpW instructions for SExtWRemoval.

Instead of switching on the opcode in SExtWRemoval, we can use a
bit in TSFlags. This reduces the amount of code that needs to be
generated to implement the switch. The opcodes are scattered throughout
the opcode enum, so the switch isn't very densely packed.

Reviewed By: asb

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

21 months ago[ADT] Remove Optional<T>::create
Kazu Hirata [Wed, 14 Dec 2022 18:34:34 +0000 (10:34 -0800)]
[ADT] Remove Optional<T>::create

The last use of Optional<T>::create was removed on December 10, 2022
in commit 1cb7fba3e57d6c31f05c7a2bda1634da49dd1d18.

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

21 months ago[scudo] Reland: Fix and enable more warnings for standalone build
Dominic Chen [Sat, 10 Dec 2022 01:15:47 +0000 (17:15 -0800)]
[scudo] Reland: Fix and enable more warnings for standalone build

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

21 months ago[clang-format][NFC] Don't run any passes if Environment::make fails
Owen Pan [Wed, 14 Dec 2022 07:37:58 +0000 (23:37 -0800)]
[clang-format][NFC] Don't run any passes if Environment::make fails

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

21 months ago[Hexagon] Handle rounding beyond low 32 bits
Krzysztof Parzyszek [Wed, 14 Dec 2022 17:32:34 +0000 (09:32 -0800)]
[Hexagon] Handle rounding beyond low 32 bits

21 months ago[NFC] Cleanup: BasicBlock::getInstList() and BasicBlock::getSublistAccess() are now...
Vasileios Porpodas [Mon, 28 Nov 2022 22:59:35 +0000 (14:59 -0800)]
[NFC] Cleanup: BasicBlock::getInstList() and BasicBlock::getSublistAccess() are now private

We now have an adequate set of API functions, including BasicBlock::splice(),
BasicBlock::erase(), Instruction::insertAt() etc. that we shouldn't need access
to the underlying instruction list.

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

21 months ago[mlir][math] Added math::FPowI conversion to LLVM dialect.
Slava Zakharin [Wed, 14 Dec 2022 05:45:07 +0000 (21:45 -0800)]
[mlir][math] Added math::FPowI conversion to LLVM dialect.

The operations are converted into LLVM::PowIOp.

Reviewed By: Mogball

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

21 months ago[Attributor][FIX] Allow negative offsets for ranges
Johannes Doerfert [Wed, 14 Dec 2022 18:10:01 +0000 (10:10 -0800)]
[Attributor][FIX] Allow negative offsets for ranges

In https://reviews.llvm.org/D136745 we introduced the "pre-condition"
that offsets should not be -1 or -2. This can easily break. The new
special values are INT32_MAX and INT32_MIN, which we might want to
replace with std::optional or flags instead.

21 months agoAttributes: Add function getter to parse integer string attributes
Matt Arsenault [Thu, 8 Dec 2022 15:53:17 +0000 (10:53 -0500)]
Attributes: Add function getter to parse integer string attributes

The most common case for string attributes parses them as integers. We
don't have a convenient way to do this, and as a result we have
inconsistent missing attribute and invalid attribute handling
scattered around. We also have inconsistent radix usage to
getAsInteger; some places use the default 0 and others use base 10.

Update a few of the uses, but there are quite a lot of these.

21 months agoRevert "[FileCheck] llvm::Optional => std::optional"
Douglas Yung [Wed, 14 Dec 2022 18:05:01 +0000 (10:05 -0800)]
Revert "[FileCheck] llvm::Optional => std::optional"

This reverts commit 13fd37c931c26ec07613dcad67b5ab2a593cd416.

This change is causing bot failures on some Windows and older GCC bots:
- https://lab.llvm.org/buildbot/#/builders/123/builds/14678
- https://lab.llvm.org/buildbot/#/builders/216/builds/14436
- https://lab.llvm.org/staging/#/builders/235/builds/993

21 months ago[VPlan] Sink non-uniform recieps for scalar plans.
Florian Hahn [Wed, 14 Dec 2022 17:55:30 +0000 (17:55 +0000)]
[VPlan] Sink non-uniform recieps for scalar plans.

In scalar plans, replicate recipes will only generate a single value per
UF, independent of whether they are uniform or not. So don't consider
uniformity for plans with scalar VFs only.

This allows us to handle a few additional cases in VPlan sinking instead
of non-VPlan sinkScalarOperands.

Depends on D133762.

Reviewed By: Ayal

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

21 months ago[MLIR] Generalize affine fusion to work on `Block` instead of `FuncOp`
Uday Bondhugula [Wed, 14 Dec 2022 17:25:20 +0000 (22:55 +0530)]
[MLIR] Generalize affine fusion to work on `Block` instead of `FuncOp`

The affine fusion pass can actually work on the top-level of a `Block`
and doesn't require to be called on a `FuncOp`. Remove this restriction
and generalize the pass to work on any `Block`. This allows fusion to be
performed, for example, on multiple blocks of a FuncOp or any
region-holding op like an scf.while, scf.if or even at an inner depth of
an affine.for or affine.if op. This generalization has no effect on
existing functionality. No changes to the fusion logic or its
transformational power were needed.

Update fusion pass to be a generic operation pass (instead of FuncOp
pass) and remove references and assumptions on the parent being a
FuncOp.

Reviewed By: dcaballe

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

21 months ago[MLIR] Fix/check for aliases for escaping memrefs in affine fusion
Uday Bondhugula [Tue, 13 Dec 2022 09:13:41 +0000 (14:43 +0530)]
[MLIR] Fix/check for aliases for escaping memrefs in affine fusion

Check for aliases for escaping memrefs check in affine fusion pass.  Fix
`isEscapingMemRef` to handle unknown defining ops for the memref.

Reviewed By: dcaballe

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

21 months ago[OpenMP] Add non-blocking support for target nowait regions
Guilherme Valarini [Wed, 14 Dec 2022 16:46:23 +0000 (13:46 -0300)]
[OpenMP] Add non-blocking support for target nowait regions

This patch better integrates the target nowait functions with the tasking runtime. It splits the nowait execution into two stages: a dispatch stage, which triggers all the necessary asynchronous device operations and stores a set of post-processing procedures that must be executed after said ops; and a synchronization stage, responsible for synchronizing the previous operations in a non-blocking manner and running the appropriate post-processing functions. Suppose during the synchronization stage the operations are not completed. In that case, the attached hidden helper task is re-enqueued to any hidden helper thread to be later synchronized, allowing other target nowait regions to be concurrently dispatched.

Reviewed By: jdoerfert, tianshilei1992

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

21 months ago[BOLT][DWARF] Fix for Handle zero size DW_TAG_inlined_subroutine
Alexander Yermolovich [Wed, 14 Dec 2022 17:00:33 +0000 (09:00 -0800)]
[BOLT][DWARF] Fix for Handle zero size DW_TAG_inlined_subroutine

Managed to introduce an error when changing code to fix other tests and the unit
test was no adequate due to --nostdlib being passed in in llvm testing
enviroment.
Original diff: https://reviews.llvm.org/D132059

Updated a test to make sure that original address and the new address are
different.

Reviewed By: maksfb, #bolt

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

21 months agobolt: Update more sys::Wait calls
Matt Arsenault [Wed, 14 Dec 2022 17:00:02 +0000 (12:00 -0500)]
bolt: Update more sys::Wait calls

21 months ago[Attributor][NFCI] Update tests according to last commit
Johannes Doerfert [Wed, 14 Dec 2022 16:59:20 +0000 (08:59 -0800)]
[Attributor][NFCI] Update tests according to last commit

Will look into the difference now, this is to apease the bots.

21 months agobolt: Try to fix build after sys::Program API change
Matt Arsenault [Wed, 14 Dec 2022 16:56:13 +0000 (11:56 -0500)]
bolt: Try to fix build after sys::Program API change

Hopefully fixes build after 15a6e3c636977dc962a415c067182e6d57242116

21 months ago[Attributor][FIX] Try to prevent a potential memory leak
Johannes Doerfert [Wed, 14 Dec 2022 16:40:17 +0000 (08:40 -0800)]
[Attributor][FIX] Try to prevent a potential memory leak

We might not have registered an AA allocated via the bump allocator
and consequently not deallocated it properly.

21 months ago[Flang] Convert a test to check 'target=...'
Paul Robinson [Tue, 13 Dec 2022 16:52:31 +0000 (08:52 -0800)]
[Flang] Convert a test to check 'target=...'

Part of the project to eliminate special handling for triples in lit
expressions.

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

21 months ago[gn build] Port e356f681f6c4
LLVM GN Syncbot [Wed, 14 Dec 2022 16:17:52 +0000 (16:17 +0000)]
[gn build] Port e356f681f6c4

21 months ago[XCOFF] Decode the relocation entries of loader section of xcoff for llvm-readobj
zhijian [Wed, 14 Dec 2022 16:16:20 +0000 (11:16 -0500)]
[XCOFF] Decode the relocation entries of loader section of xcoff for llvm-readobj

Summary:

support decoding the relocation entries of loader section of xcoff for llvm-readobj

https://www.ibm.com/docs/en/aix/7.2?topic=formats-xcoff-object-file-format#XCOFF__vra3i31ejbau

Reviewers: James Henderson, Esme Yi
Differential Revision: https://reviews.llvm.org/D136787

21 months ago[mlir] Fix bazel build for https://reviews.llvm.org/D139187.
Oleg Shyshkov [Wed, 14 Dec 2022 16:03:09 +0000 (17:03 +0100)]
[mlir] Fix bazel build for https://reviews.llvm.org/D139187.

21 months ago[Clang] Convert test to opaque pointers (NFC)
Nikita Popov [Wed, 14 Dec 2022 15:50:30 +0000 (16:50 +0100)]
[Clang] Convert test to opaque pointers (NFC)

Required a lot of manual, but uninteresting, fixup.

21 months ago[AMDGPU] Clean up SReg classes
Jay Foad [Wed, 14 Dec 2022 12:04:28 +0000 (12:04 +0000)]
[AMDGPU] Clean up SReg classes

Remove unused LO16 classes SReg_LO16_XM0_XEXEC, SReg_LO16_XEXEC_HI and
SReg_LO16_XM0.

Simplify the definition of SReg_32.

Add SReg_32_XEXEC and use it to improve SReg_1_XEXEC which previously
excluded M0 for no good reason.

Improve SReg_1 which previously excluded EXEC_HI for no good reason.

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

21 months ago[libc++] Refactor .compile.fail.cpp tests for std::function
Louis Dionne [Fri, 25 Nov 2022 19:20:04 +0000 (14:20 -0500)]
[libc++] Refactor .compile.fail.cpp tests for std::function

Some of those .compile.fail.cpp tests had become incorrect and they
were not testing anything. In general, .compile.fail.cpp tests are
bad because they make it way too easy to write garbage tests. Indeed,
the test could fail to compile due to any reason whatsoever (even a
typo) and it would appear to work correctly.

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

21 months ago[clang][C++20] P0960R3 and P1975R0: Allow initializing aggregates from a parenthesize...
Alan Zhao [Mon, 3 Oct 2022 17:46:46 +0000 (10:46 -0700)]
[clang][C++20] P0960R3 and P1975R0: Allow initializing aggregates from a parenthesized list of values

This patch implements P0960R3, which allows initialization of aggregates
via parentheses.

As an example:

```
struct S { int i, j; };
S s1(1, 1);

int arr1[2](1, 2);
```

This patch also implements P1975R0, which fixes the wording of P0960R3
for single-argument parenthesized lists so that statements like the
following are allowed:

```
S s2(1);
S s3 = static_cast<S>(1);
S s4 = (S)1;

int (&&arr2)[] = static_cast<int[]>(1);
int (&&arr3)[2] = static_cast<int[2]>(1);
```

This patch was originally authored by @0x59616e and completed by
@ayzhao.

Fixes #54040, Fixes #54041

Co-authored-by: Sheng <ox59616e@gmail.com>
Full write up : https://discourse.llvm.org/t/c-20-rfc-suggestion-desired-regarding-the-implementation-of-p0960r3/63744

Reviewed By: ilya-biryukov

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

21 months ago[TargetLowering] Teach DemandedBits about VSCALE
Benjamin Maxwell [Mon, 12 Dec 2022 16:26:20 +0000 (16:26 +0000)]
[TargetLowering] Teach DemandedBits about VSCALE

This allows DemandedBits to see the result of VSCALE will be at most
VScaleMax * some compile-time constant. This relies on the vscale_range()
attribute being present on the function, with a max set. (This is done by
default when clang is targeting AArch64+SVE).

Using this various redundant operations (zexts, sexts, ands, ors, etc)
can be eliminated.

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

21 months ago[NFC][OpenMP] Add missing LLVM headers on utility file
Guilherme Valarini [Mon, 7 Nov 2022 16:07:27 +0000 (13:07 -0300)]
[NFC][OpenMP] Add missing LLVM headers on utility file

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

21 months ago[compiler-rt] Convert profile tests to opaque pointers (NFC)
Nikita Popov [Wed, 14 Dec 2022 15:45:05 +0000 (16:45 +0100)]
[compiler-rt] Convert profile tests to opaque pointers (NFC)

21 months ago[libc++] Implement `std::expected` P0323R12
Hui Xie [Fri, 4 Nov 2022 11:42:42 +0000 (11:42 +0000)]
[libc++] Implement `std::expected` P0323R12

Implement `std::expected` https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p0323r12.html

Added tests

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

address comment

21 months ago[FuncSpec] Global ranking of specialisations
Momchil Velikov [Wed, 14 Dec 2022 14:55:59 +0000 (14:55 +0000)]
[FuncSpec] Global ranking of specialisations

The `FunctionSpecialization` pass chooses specializations among the
opportunities presented by a single function and its calls,
progressively penalizing subsequent specialization attempts by
artificially increasing the cost of a specialization, depending on how
many specialization were applied before. Thus the chosen
specializations are sensitive to the order the functions appear in the
module and may be worse than others, had those others been considered
earlier.

This patch makes the `FunctionSpecialization` pass rank the
specializations globally, i.e.  choose the "best" specializations
among the all possible specializations in the module, for all
functions.

Since this involved quite a bit of redesign of the pass data
structures, this patch also carries:

  * removal of duplicate specializations

  * optimization of call sites update, by collecting per
    specialization the list of call sites that can be directly
    rewritten, without prior expensive check if the call constants and
    their positions match those of the specialized function.

A bit of a write-up up about the FuncSpec data structures and
operation:

Each potential function specialisation is kept in a single vector
(`AllSpecs` in `FunctionSpecializer::run`).  This vector is populated
by `FunctionSpecializer::findSpecializations`.

The `findSpecializations` member function has a local `DenseMap` to
eliminate duplicates - with each call to the current function,
`findSpecializations` builds a specialisation signature (`SpecSig`)
and looks it in the duplicates map. If the signature is present, the
function records the call to rewrite into the existing specialisation
instance.  If the signature is absent, it means we have a new
specialisation instance - the function calculates the gain and creates
a new entry in `AllSpecs`. Negative gain specialisation are ignored at
this point, unless forced.

The potential specialisations for a function form a contiguous range
in the `AllSpecs` [1]. This range is recorded in `SpecMap SM`, so we
can quickly find all specialisations for a function.

Once we have all the potential specialisations with their gains we
need to choose the best ones, which fit in the module specialisation
budget. This is done by using a max-heap (`std::make_heap`,
`std::push_heap`, etc) to find the best `NSpec` specialisations with a
single traversal of the `AllSpecs` vector. The heap itself is
contained with a small vector (`BestSpecs`) of indices into
`AllSpecs`, since elements of `AllSpecs` are a bit too heavy to
shuffle around.

Next the chosen specialisation are performed, that is, functions
cloned, `SCCPSolver` primed, and known call sites updated.

Then we run the `SCCPSolver` to propagate constants in the cloned
functions, after which we walk the calls of the original functions to
update them to call the specialised functions.

---

[1] This range may contain specialisation that were discarded and is
not ordered in any way. One alternative design is to keep a vector
indices of all specialisations for this function (which would
initially be, `i`, `i+1`, `i+2`, etc) and later sort them by gain,
pushing non-applied ones to the back. This has the potential to speed
`updateCallSites` up.

Reviewed By: ChuanqiXu, labrinea

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

Change-Id: I708851eb38f07c42066637085b833ca91b195998

21 months agoAllow inline of all pure ops from the LLVM dialect.
Ingo Müller [Wed, 14 Dec 2022 15:16:06 +0000 (15:16 +0000)]
Allow inline of all pure ops from the LLVM dialect.

This allows to inline regions containing pure LLVM ops into their call
sites. (Note that this is not related to inlining of llvm.func but to
any the inlining of any Callable.) For now, we only allow the inlining
of Pure ops to be conservative but other ops may be considered inlinable
in the future.

Testing for purity of ops requires the C++ equivalent of the Pure trait
from SideEffectInterfaces.td, which this patch also provide. Its
implementation calls the C++ equivalents of the two traits that the Pure
trait is based on and, thus, has to be kept with the tablegen trait.

Reviewed By: ftynse

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

21 months agoSupport: Make Wait's SecondsToWait be std::optional [NFC]
Matt Arsenault [Tue, 29 Nov 2022 18:24:58 +0000 (13:24 -0500)]
Support: Make Wait's SecondsToWait be std::optional [NFC]

I found the interaction between SecondsToWait and
WaitUntilChildTerminates confusing. Rather than have a boolean to
ignore the value of SecondsToWait, combine these into one Optional
parameter.

21 months agoInstCombine: Add baseline tests for is.fpclass with fcmp
Matt Arsenault [Mon, 12 Dec 2022 02:48:41 +0000 (21:48 -0500)]
InstCombine: Add baseline tests for is.fpclass with fcmp

21 months ago[NFC] Fixup checkline confusion
Roman Lebedev [Wed, 14 Dec 2022 14:52:35 +0000 (17:52 +0300)]
[NFC] Fixup checkline confusion

21 months ago[OpenMP] Add API for pinned memory
Carlo Bertolli [Wed, 14 Dec 2022 14:50:10 +0000 (08:50 -0600)]
[OpenMP] Add API for pinned memory

This patch adds API support for the atk_pinned trait for omp_alloc.
It does not implement kmp_target_lock_mem and kmp_target_unlock_mem in libomptarget,
but prepares libomp for it. Patches to libomptarget to implement
lock/unlock coming after this one.

Reviewed by: jlpeyton, jdoerfert

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

21 months ago[NFC][IndVar] Autogenerate checklines in one test
Roman Lebedev [Wed, 14 Dec 2022 14:38:58 +0000 (17:38 +0300)]
[NFC][IndVar] Autogenerate checklines in one test

21 months ago[IndVarSimplify] Convert more tests to opaque pointers (NFC)
Nikita Popov [Wed, 14 Dec 2022 14:31:34 +0000 (15:31 +0100)]
[IndVarSimplify] Convert more tests to opaque pointers (NFC)

21 months ago[IndVarSimplify] Regenerate test checks (NFC)
Nikita Popov [Wed, 14 Dec 2022 14:35:42 +0000 (15:35 +0100)]
[IndVarSimplify] Regenerate test checks (NFC)

21 months ago[RISC-V][HWASAN] Enable HWASAN for RISC-V architecture
Alexey Baturo [Tue, 5 Jul 2022 16:07:50 +0000 (19:07 +0300)]
[RISC-V][HWASAN] Enable HWASAN for RISC-V architecture

Reviewed by: vitalybuka, kito-cheng

These changes will allow to use HWASAN with RISCV64 architecture.

The majority of existing tests are passing with a few exceptions(see below).
The tests were running on QEMU, since currently there're no hardware with support
for J-extension.

For this feature to work the system must support PR_{SET,GET}_TAGGED_ADDR_CTRL
syscall. For now this is only available for a patched Linux kernel and QEMU with
enabled experimental J-extension.

Results of running HWASAN lit tests for RISC-V:
```
  Unsupported      :  6
  Passed           : 79
  Expectedly Failed:  2
```

Tests are marked as expected to fail or unsupported either because of:
- android platform not being supported
- no support for legacy hwasan v1 mode
- test config explicitly uses aarch64 option
```
UNSUPPORTED: HWAddressSanitizer-riscv64 :: TestCases/abort-message-android.cpp
UNSUPPORTED: HWAddressSanitizer-riscv64 :: TestCases/cfi.cpp
UNSUPPORTED: HWAddressSanitizer-riscv64 :: TestCases/lto.c
UNSUPPORTED: HWAddressSanitizer-riscv64 :: TestCases/print-memory-usage-android.c
UNSUPPORTED: HWAddressSanitizer-riscv64 :: TestCases/register-dump-read.c
UNSUPPORTED: HWAddressSanitizer-riscv64 :: TestCases/try-catch.cpp
XFAIL: HWAddressSanitizer-riscv64 :: TestCases/stack-oob.c
XFAIL: HWAddressSanitizer-riscv64 :: TestCases/exported-tagged-global.c
```

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

21 months ago[LoopVectorize] Convert some tests to opaque pointers (NFC)
Nikita Popov [Wed, 14 Dec 2022 14:22:49 +0000 (15:22 +0100)]
[LoopVectorize] Convert some tests to opaque pointers (NFC)

For these tests update_test_checks.py had to be rerun.

21 months ago[mlir][Linalg] Better builders for transform ops
Nicolas Vasilache [Wed, 14 Dec 2022 11:25:28 +0000 (03:25 -0800)]
[mlir][Linalg] Better builders for transform ops

Also adopt DenseI64ArrayAttr in those transform ops.

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

21 months ago[LoopVectorize] Convert some tests to opaque pointers (NFC)
Nikita Popov [Wed, 14 Dec 2022 14:15:18 +0000 (15:15 +0100)]
[LoopVectorize] Convert some tests to opaque pointers (NFC)

21 months ago[SimplifyCFG] Convert tests to opaque pointers (NFC)
Nikita Popov [Wed, 14 Dec 2022 13:40:50 +0000 (14:40 +0100)]
[SimplifyCFG] Convert tests to opaque pointers (NFC)

21 months agoLTO: always parse modules in opaque pointer mode.
Tim Northover [Tue, 13 Dec 2022 09:10:56 +0000 (09:10 +0000)]
LTO: always parse modules in opaque pointer mode.

Once an LLVMContext has been told it needs to track pointer types, it can no
longer be used to parse opaque modules. However, we are likely  (at least for a
while) to have old LTO .o files in the SDK that need to interoperate with
just-generated ones, so deciding opaqueness based on the first module read
causes linker failures.

This makes the llvm-c LTO interface parse any object it sees in opaque mode,
even if type data is present, which guarantees compatibility.