forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
WIP: Moving loop-variable-copied-and-modified into a standalone check #4
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
Open
flowerhack
wants to merge
2,340
commits into
main
Choose a base branch
from
make-as-new-checkout
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1fa4098
to
ce57f85
Compare
be77df9
to
322be1b
Compare
Remove NoSignedZerosFPMath in TargetLowering part, users should always use instruction level fast math flags.
… parameters (llvm#161099) The AutoType's deduced-as-dependent mechanism is not really used for constant template parameters, but this is currently harmless to ignore because when dealing which such types, they will have been transformed, turning them back to plain undeduced AutoTypes. This should be NFC for current main users, but llvm#141776 will depend on this.
This makes the instantation depth limit be checked whenever the code synthesis context is pushed, not only when creating a InstantiatingTemplate RAII object. Also fix the note suggesting the user increases `-ftemplate-depth` so it is printed even in a SFINAE context.
…lvm#160700) The initial implementation used a very crude check where a value was considered ephemeral if it has only one use. This is insufficient if there are multiple assumes acting on the same value, or in more complex cases like cyclic phis. Generalize this to a more typical ephemeral value check, i.e. make sure that all transitive users are in assumes, while stopping at side-effecting instructions.
Fix the crash issue when updating debuginfo via DWARF4 DWP and improve efficiency.
Mark the attributes as immarg to indicate that they require a constant integer. This was previously enforced with a manual verifier check.
…eeze(x)) to X86FixupInstTunings (llvm#161007) Avoid the shl(x,1) -> add(freeze(x),freeze(x)) if the shift-imm if legal, and leave it to X86FixupInstTunings. Helps avoid missed optimisations due to oneuse limits, avoids unnecessary freezes and allows AVX512 to fold to mi memory folding variants. Fixes llvm#161006
Change my email address in the process. I will not be able to keep up maintainership duties on this project in the future. Adding the wording on the inactive maintainers section myself like this feels self-aggrandizing but was copied from other LLVM projects.
…59363) This patch adds basic support for exception handling to SelectionDAG for ZT0, ZA, and agnostic ZA state. This works based on the following assumptions: - To throw an exception requires calling into the runtime * The which will be a private ZA call (that commits the lazy save) - Therefore, as noted in https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#exceptions we will always enter the EH block with PSTATE.ZA=0 and TPIDR2_EL0=null, so we can emit a restore of ZA/ZT0. Note: This patch does not handle all cases yet. Currently, there is no support for committing agnostic ZA state before `invoke`s, regardless of whether the callee is also agnostic (to ensure ZA state is saved on all normal returns).
…t. (llvm#160053) Update VPReplicateRecipe::computeCost to compute costs of more replicating loads/stores. There are 2 cases that require extra checks to match the legacy cost model: 1. If the pointer is based on an induction, the legacy cost model passes its SCEV to getAddressComputationCost. In those cases, still fall back to the legacy cost. SCEV computations will be added as follow-up 2. If a load is used as part of an address of another load, the legacy cost model skips the scalarization overhead. Those cases are currently handled by a usedByLoadOrStore helper. Note that getScalarizationOverhead also needs updating, because when the legacy cost model computes the scalarization overhead, scalars have not been collected yet, so we can't each for replicating recipes to skip their cost, except other loads. This again can be further improved by modeling inserts/extracts explicitly and consistently, and compute costs for those operations directly where needed. PR: llvm#160053
llvm#161311) Update generated docs for legacy attributes: * no_sanitize_(address|thread|memory) * no_address_safety_analysis Those are older forms of no_sanitize("list", "of", "sanitizers") attribute. They were previously as various spellings of the same attribute, which made the auto-generated documentation confusing. Fix this by explicitly making them three different attributes. This would also allow to simplify the delegation to the new no_sanitize form slightly, as we can instead rely on auto-generated code to check that TSan and MSan can't be disabled for globals. **HTML docs before:** <img width="1004" height="1175" alt="rendered-docs-before" src="https://github.com/user-attachments/assets/407b5fc1-799c-4882-8ff8-44a5ef3cf4f1" /> **HTML docs after:** <img width="1098" height="1118" alt="rendered-docs-after" src="https://github.com/user-attachments/assets/236ca93f-25f8-4d58-95ac-ede95ce18d01" /> --------- Co-authored-by: Erich Keane <[email protected]>
Upstream the RTTI builder with helpers and used them in the VTable Definitions Issue llvm#154992
…#138883) Introduce a low-level instruction matching DSL to capture and/or match the operands of MCInst, single instruction at a time. Unlike the existing `MCPlusBuilder::MCInstMatcher` machinery, this DSL is intended for the use cases when the precise control over the instruction order is required. For example, when validating PtrAuth hardening, all registers are usually considered unsafe after a function call, even though callee-saved registers should preserve their old values _under normal operation_. Usage example: // Bring the short names into the local scope: using namespace LowLevelInstMatcherDSL; // Declare the registers to capture: Reg Xn, Xm; // Capture the 0th and 1st operands, match the 2nd operand against the // just captured Xm register, match the 3rd operand against literal 0: if (!matchInst(MaybeAdd, AArch64::ADDXrs, Xm, Xn, Xm, Imm(0)) return AArch64::NoRegister; // Match the 0th operand against Xm: if (!matchInst(MaybeBr, AArch64::BR, Xm)) return AArch64::NoRegister; // Manually check that Xm and Xn did not match the same register: if (Xm.get() == Xn.get()) return AArch64::NoRegister; // Return the matched register: return Xm.get();
Using a fold instead of template recursion.
Fix spelling of `GetMemoryRegionInfo` function in log message and comment and reformat code.
…nt values (llvm#161084) Implemented `common::UsageWarning::ConstantIsContiguous` to warn about the following case: ``` integer, parameter :: num = 3 integer, parameter :: arr(num)=[(i, i=1,num)] logical, parameter :: result=is_contiguous(arr(num:1:-1)) end ``` Here, while array section is discontiguous, `arr` is a compile time constant, so array section created at compile time will end up being contiguous and `result` will be "true". If `arr` wasn't a constant, the result at runtime would have been "false".
On the happy path, when `clang-repl` is present, we will invoke it in order to determine if the host supports JIT features. That will return a string containing "true". However, in cases where `clang-repl` is not present or we fail to invoke it, we previously returned `False`, which would then trigger a failure with our substring check. This PR updates the function to return `""` instead, so the substring check is still valid. This is related to llvm#157359, where the original change was introduced.
flang/lib/Evaluate/constant.cpp apparently needs this #include for MSVC builds but somehow not for others.
A loop may have more than one predecessor out of the loop. In that case, just pick the first non-phi instruction in the loop header.
…ows (llvm#160493) Summary - Add ASan interceptors for wcscpy/wcsncpy on all platforms. - Enable wcscat/wcsncat on Windows (already enabled on POSIX via sanitizer_common). Motivation - Use of wchar string APIs is common on Windows; improve parity with char* string checks. Changes - Implement wcscpy/wcsncpy in asan_interceptors.cpp; check overlap and mark read/write ranges in bytes. - wcsncpy: compute write size in bytes (size * sizeof(wchar_t)) to avoid missed overflows when sizeof(wchar_t) != 1. - Use MaybeRealWcsnlen when available to bound reads. - Register Windows static thunk for wcscpy/wcsncpy/wcscat/wcsncat; rely on sanitizer_common interceptors for wcscat/wcsncat. - Tests: add wcscpy/wcsncpy/wcscat/wcsncat; flush stdout before crash; use resilient FileCheck patterns (reuse [[ADDR]], wildcard for function suffixes and paths, flexible line numbers). Testing - AArch64 Linux: new tests pass with check-asan locally. Follow-up to and based on prior work in PR llvm#90909 (author: branh, Microsoft); builds on that work and addresses review feedback. Thanks! --------- Signed-off-by: Yixuan Cao <[email protected]>
This seems to have broken some buildbots for a long time, so just suppress it for now until we determine how/why.
Move a function that seems to be running into an MSVC problem from the source file where I created it to another one (tools.cpp) that is already known to be able to access the semantics::Scope type.
…N=ON (llvm#161427) If MLIR_ENABLE_BINDINGS_PYTHON=ON then [StandalonePythonModules](https://github.com/llvm/llvm-project/blob/main/mlir/examples/standalone/pyproject.toml#L38) isn't a valid target.
This removes ~2000 lines from both AMDGPUGenDAGISel.inc and AMDGPUGenGlobalISel.inc.
This fixes macos build, where otherwise the compilation yields an error: `no viable conversion from 'bool' to 'typename iterator_traits<const QualType *>::value_type`
8a9b5f4
to
47c90ce
Compare
…mputeCost. (llvm#160053)" This reverts commit b4be7ec. See llvm#161404 for a crash exposed by the change. Revert while I investigate.
This adds support for handling global variables with non-trivial constructors. The constructor call is emitted in CIR as a 'ctor' region associated with the global definition. This form of global definition cannot be lowered to LLVM IR yet. A later change will add support in LoweringPrepare to move the ctor code into a __cxx_global_var_init() function and add that function to the list of global global ctors, but for now we must stop at the initial CIR generation.
…ng attributes (llvm#161254) Add new `ResourceBindingAttrs` struct that holds resource binding attributes `HLSLResourceBindingAttr` and `HLSLVkBindingAttr` and provides helper methods to simplify dealing with resource bindings. This code is placed in the AST library to be shared between Sema and CodeGen. This change has been done in preparation of a third binding attribute coming soon to represent `[[vk::counter_binding()]]`. This new attribute and more helper member functions will be added to `ResourceBindingAttrs` and will be used in both Sema and in CodeGen to implement resource counter initialization.
Adds a clang-tidy check that alerts when a loop variable is copied and subsequently modified. This is a bugprone pattern because the programmer in this case often assumes they are modifying the original value instead of a copy. This warning can be suppressed by either converting the loop variable to a const ref, or by performing the copy explicitly inside the body of the loop. Fix llvmGH-155922
ff1a9d6
to
fa8a010
Compare
I moved a function to Evaluate/tools.cpp in an attempt to dodge some MSVC compiler issue but didn't add an include directive for Evaluate/tools.h to Evaluate/constant.cpp.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.