Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update aie-public to llvmorg-19-init~1 #80

Merged
merged 2,511 commits into from
Jun 21, 2024

Conversation

konstantinschwarz
Copy link
Collaborator

This merges upstream commit 9324872 into aie-public, resolves merge conflicts in the merge commit, and adds fixup commits on top to fix build and test errors.

shiltian and others added 30 commits January 22, 2024 16:40
Integrate in-memory debug-info dumps into the `--orc-lazy-debug`
command-line option instead of exposing built-in functions to be called
from JITed code. This reduces overall amount of code (removing
`ExecutionUtils.cpp`) and seems cleaner anyway.

All existing items of `OrcDumpKind` work on IR level and run in the
IR-transform step of the JIT. The newly added `DumpDebugDescriptor` and
`DumpDebugObjects` must run after debug-registration and thus are
deferred to the Object-transform step of the JIT. This separation is the
major side-effect of the patch.

The original commit 263efb0 was reverted in #79055, because
the gcc 7.5 bot had found a missing std::move().
Test coverage for an upcoming transform.
The life of `MCDCRecordProcessor`'s instance is short. It may accept
`const` objects to process.

On the other hand, the life of `MCDCBranches` is shorter than `Record`.
It may be rewritten with reference, rather than copying.
…re visiting children (#78814)

This is a fix for MC/DC issue llvm/llvm-project#78453 in which a ConditionalOperator that evaluates a complex condition was incorrectly updating its global bitmap after visiting its LHS and RHS children. This
was wrong because if the LHS or RHS also evaluate a complex condition, the MCDC temporary bitmap value will get corrupted. The fix is to ensure that the bitmap is updated prior to visiting the LHS and RHS.
…tions (#69133)

This reverts commit 6c47419.

Default to CLANG_BOLT=OFF

Test Plan:
Build a regular Clang build.
Usage of uninitialized memory is a top memory safety issue in C++ codebases.
Help mitigate this somewhat by default initialize stack allocations to a
pattern (0xAA repeating).

Clang has received optimizations to sink these into control flow paths that
access such values to minimize the overhead of these added initializations.

If there's a measurable slowdown, we can add
-ftrivial-auto-var-init-max-size=<N> for some value N bytes if we have any
large stack allocations, or add attribute uninitialized to any variable
declarations.

Unsupported until GCC 12.1 / Clang 8.

Increases file size of libc.a from a full build by +8.79Ki (+0.2%).
In 0784b1e some code for re-execution was moved to
`ReExecIfNeeded()`, but also extended with a few Linux-only features.
This leads to compile errors on FreeBSD, or other non-Linux platforms:

compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp:247:25: error: use of
undeclared identifier 'personality'
      247 |   int old_personality = personality(0xffffffff);
          |                         ^
compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp:249:54: error: use of
undeclared identifier 'ADDR_NO_RANDOMIZE'
249 | (old_personality != -1) && ((old_personality & ADDR_NO_RANDOMIZE)
== 0);
          |                                                      ^
compiler-rt/lib/tsan/rtl/tsan_platform_linux.cpp:281:46: error: use of
undeclared identifier 'ADDR_NO_RANDOMIZE'
281 | CHECK_NE(personality(old_personality | ADDR_NO_RANDOMIZE), -1);
          |                                              ^

Surround the affected part with a `#if SANITIZER_LINUX` block for now.
With the soon-to-land new-debug-info storage model, it's going to be
important to use iterators for instruction insertion rather than
instruction pointers. This (single line in instcombine) is the last place
that trips up our internal testing for debug-info, where we insert a PHI
and it should be using an iterator.
Intended to warn users of the 18.x release not to do this.

A better solution should be found for the 19.x release. See discussion
in llvm/llvm-project#78152.

Unfortunately there is no warning on Windows currently. I am rushing to
get this landed before 18.x branches.
User-defined literals do not accept u?intXX(_t)? variables. So the check
should not emit a warning.

Fixes #54546 #25214
… (#78196)

This is allowed by gfortran and ifort with `![GCC|DEC]$ ATTRIBUTES
NO_ARG_CHECK`
This flag (--try-experimental-debuginfo-iterators) only exists for testing
purposes, to get some RUNlines running in new-debug-info mode before it's
properly supported. The flag isn't something that's going to be useful to
people using llvm 18, so hide it from the options list.
…(#77496)

Add naive implementation of memcpy, memset, memmove, memchr for SME
targets.
Co-authored-by: David Sherwood <[email protected]>
Some operations behave like selects. For example `or(zext(c), y)` is the
same as select(c, y|1, y)` and instcombine can canonicalize the select
to the or form. These operations can still be worthwhile converting to
branch as opposed to keeping as a select or or instruction.

This patch attempts to add some basic handling for them, creating a
SelectLike abstraction in the select optimization pass. The backend can
opt into handling `or(zext(c),x)` as a select if it could be profitable,
and the select optimization pass attempts to handle them in much the
same way as a `select(c, x|1, x)`. The Or(x, 1) may need to be added as
a new instruction, generated as the or is converted to branches.

This helps fix a regression from selects being converted to or's
recently.
Since we shouldn't be doing any LTO logic from the legacy pass manager.
…ent new operator to HermeticTestUtils.cpp. (#78906)

`-nostdlib++` is a clang-only flag. Replacing it with `-nostdlib` when
building with gcc.
Although there are predicated versions of minnum/maxnum, the ones for
minimum/maximum are currently missing. This patch introduces these
intrinsics and implements their lowering to RISC-V.
…8915)

The forwarding header used by `hipstdpar` on AMDGPU targets is now
pacakged with `rocThrust`. This change augments the ROCm Driver
component so that it can automatically pick up the packaged header iff
the user hasn't overridden it via the dedicated flag.
…feature (#78943)

With enough codegen complete, we can now correctly report the size of
vector registers for LSX/LASX, allowing auto vectorization (The
`auto-vec` feature needs to be enabled simultaneously).

As described, the `auto-vec` feature is an experimental one. To ensure
that automatic vectorization is not enabled by default, because the
information provided by the current `TTI` cannot yield additional
benefits for automatic vectorization.
llvm-project/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp:1125:17:
 error: unused variable 'ASTC' [-Werror,-Wunused-variable]
 1125 |     ASTContext &ASTC = C.getASTContext();
      |                 ^~~~
1 error generated.
Might want to set this to True (and add a few source files to
builtins) at some point, but for now heal the bots.
So that we don't duplicate tests in later patch.

Reviewers: topperc, dtcxzyw, asb

Reviewed By: asb

Pull Request: llvm/llvm-project#79111
@konstantinschwarz konstantinschwarz force-pushed the kschwarz.update.aie.public branch from 1fa7ab7 to 6baac8e Compare June 19, 2024 23:06
# The legalizer currently asserts when trying to lower a non-power of 2 memory sized zero extending load,
# as its artifact combiner does not handle the G_ASSERT_ZEXT instruction introduced in the process.
# This case isn't super interesting, but crashing isn't nice either.
# TODO: properly implement lowering of non-power of 2 memory sized zero extending loads
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

@@ -17,13 +17,13 @@
define void @test(i8 %a, i32 %b) {
entry:
%cmp0 = icmp eq i32 %b, 0
%sel0 = select i1 %cmp0, i8 1, i8 0
%sel0 = select i1 %cmp0, i8 0, i8 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GlobalISel has a new combiner for G_SELECT, which eliminates selects based on 0/1. Using different values doesn't trigger these combines

@@ -50,6 +50,7 @@ def : Pat<(sra (i32 GPR32:$rs1), (i32 GPR32:$rs2)),
// CHECK-NEXT: GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/0, // DstI[dst]
// CHECK-NEXT: GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/1, // rs1
// CHECK-NEXT: GIR_AddSimpleTempRegister, /*InsnID*/0, /*TempRegID*/0,
// CHECK-NEXT: GIR_ConstrainSelectedInstOperands, /*InsnID*/0,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that new action can't hurt? I'm still struggling to remember how to read these files.

@@ -1,4 +1,4 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --return-type --skip-function-body
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are --return-type --skip-function-body not needed anymore? Or did you manually update the test? If so, please remove the header like altogether.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to update these tests manually, --return-type --skip-function-body doesn't exist in aie-public.
I'll drop these headers for now

gbossu
gbossu previously approved these changes Jun 20, 2024
Copy link
Collaborator

@gbossu gbossu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixups look good to me. I think we should prioritize merging this before it gets out of hand.

@stephenneuendorffer stephenneuendorffer merged commit b8bc804 into aie-public Jun 21, 2024
14 of 15 checks passed
@konstantinschwarz konstantinschwarz deleted the kschwarz.update.aie.public branch June 28, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.