Skip to content

[AArch64] AArch64ISelDAGToDAG.cpp - disable inlining on MSVC release builds #115292

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

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ using namespace llvm;
#define DEBUG_TYPE "aarch64-isel"
#define PASS_NAME "AArch64 Instruction Selection"

// https://github.com/llvm/llvm-project/issues/114425
#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this test for MSVC specifically, rather than !defined(__clang__) ?

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've matched #110986 - which IIRC is doing this to avoid it firing on clang-cl

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just to make sure I understand, does the clang-cl driver define the MSVC macro for compatibility reasons such that checking for MSVC here doesn't mean it's actually the MSVC compiler?

Copy link
Collaborator Author

@RKSimon RKSimon Nov 7, 2024

Choose a reason for hiding this comment

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

Yes - clang-cl defines the _MSC_VER macro as well as __clang__ :https://clang.godbolt.org/z/fo9aMYosK

Copy link
Member

Choose a reason for hiding this comment

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

But this condition as it stands, defined(_WIN32) && !defined(__clang__) will also match for GCC.

The correct one for singling out MSVC but not clang in msvc mode, would be defined(_MSC_VER) && !defined(__clang__).

Copy link
Collaborator Author

@RKSimon RKSimon Nov 18, 2024

Choose a reason for hiding this comment

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

I assume you mean mignw builds? I'll create a patch

#pragma inline_depth(0)
#endif

//===--------------------------------------------------------------------===//
/// AArch64DAGToDAGISel - AArch64 specific code to select AArch64 machine
/// instructions for SelectionDAG operations.
Expand Down
Loading