- Oct 25, 2021
-
-
Matthias Braun authored
This extends `optimizeCompareInstr` to continue the backwards search when it reached the beginning of a basic block. If there is a single predecessor block then we can just continue the search in that block and mark the EFLAGS register as live-in. Differential Revision: https://reviews.llvm.org/D110862
-
Matthias Braun authored
This changes the first part of `optimizeCompareInstr` being split into a loop with a forward scan for cases that re-use zero flags from a producer in case of compare with zero and a backward scan for finding an instruction equivalent to a compare. The code now uses a single backward scan searching for the next instructions that reads or writes EFLAGS. Also: - Add comments giving examples for the 3 cases handled. - Check `MI` which contains the result of the zero-compare cases, instead of re-checking `IsCmpZero`. - Tweak coding style in some loops. - Add new MIR based tests that test the optimization in isolation. This also removes a check for flag readers in situations like this: ``` = SUB32rr %0, %1, implicit-def $eflags ... we no longer stop when there are $eflag users here CMP32rr %0, %1 ; will be removed ... ``` Differential Revision: https://reviews.llvm.org/D110857
-
Philip Reames authored
The LangRef clearly states that branching on a undef or poison value is immediate undefined behavior, but historically, we have not been consistent about implementing that interpretation in the optimizer. Historically, we used (in some cases) a more relaxed model which essentially looked for provable UB along both paths which was control dependent on the condition. However, we've never been 100% consistent here. For instance SCEV uses the strong model for increments which form AddRecs (and only addrecs). At the moment, the last big blocker for finally making this switch is enabling the fix landed in D106041. Loop unswitching (in it's classic form) is incorrect as it creates many "branch on poisons" when unswitching conditions originally unreachable within the loop. This change adds a flag to value tracking which allows to easily test the optimization potential of treating branch on poison as immediate UB. It's intended to help ease work on getting us finally through this transition and avoid multiple independent rediscovers of the same issues. Differential Revision: https://reviews.llvm.org/D112026
-
Philip Reames authored
Fixes a crash observed by oss-fuzz in 39934. Issue at hand is that code expects a pattern match on m_Mul to imply the operand is a mul instruction, however mul constexprs are also valid here.
-
Vitaly Buka authored
And share storage with size. Depends on D111615. Differential Revision: https://reviews.llvm.org/D111616
-
Vitaly Buka authored
This is msan/dfsan data which does not need waste cache of other sanitizers. Depends on D111614. Differential Revision: https://reviews.llvm.org/D111615
-
Fangrui Song authored
-
Kazu Hirata authored
We can erase an item in a set or map without checking its membership first.
-
Kazu Hirata authored
-
- Oct 24, 2021
-
-
Groverkss authored
This patch fixes a bug in implementation `mergeSymbolIds` where symbol identifiers were not unique after merging them. Asserts for checking uniqueness before and after the merge are also added. The asserts checking uniqueness after the merge fail without the fix on existing test cases. Reviewed By: arjunp Differential Revision: https://reviews.llvm.org/D111958
-
Nikita Popov authored
-
Sanjay Patel authored
-
Sanjay Patel authored
-
Kazu Hirata authored
-
Kazu Hirata authored
-
Sylvestre Ledru authored
It is going to be a LTS release
-
Simon Pilgrim authored
Fix the copy + paste, renaming shift amt from Idx to Amt
-
Nikita Popov authored
Directly fetch the size instead of going through the index type first.
-
Balazs Benics authored
This reverts commit cac8808f. #5 0x00007f28ec629859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x25859) #6 0x00007f28ec629729 (/lib/x86_64-linux-gnu/libc.so.6+0x25729) #7 0x00007f28ec63af36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36) #8 0x00007f28ecc2cc46 llvm::APInt::compareSigned(llvm::APInt const&) const (libLLVMSupport.so.14git+0xeac46) #9 0x00007f28e7bbf957 (anonymous namespace)::SymbolicRangeInferrer::VisitBinaryOperator(clang::ento::RangeSet, clang::BinaryOperatorKind, clang::ento::RangeSet, clang::QualType) (libclangStaticAnalyzerCore.so.14git+0x1df957) #10 0x00007f28e7bbf2db (anonymous namespace)::SymbolicRangeInferrer::infer(clang::ento::SymExpr const*) (libclangStaticAnalyzerCore.so.14git+0x1df2db) #11 0x00007f28e7bb2b5e (anonymous namespace)::RangeConstraintManager::assumeSymNE(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*, llvm::APSInt const&, llvm::APSInt const&) (libclangStaticAnalyzerCore.so.14git+0x1d2b5e) #12 0x00007f28e7bc67af clang::ento::RangedConstraintManager::assumeSymUnsupported(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::SymExpr const*, bool) (libclangStaticAnalyzerCore.so.14git+0x1e67af) #13 0x00007f28e7be3578 clang::ento::SimpleConstraintManager::assumeAux(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::NonLoc, bool) (libclangStaticAnalyzerCore.so.14git+0x203578) #14 0x00007f28e7be33d8 clang::ento::SimpleConstraintManager::assume(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::NonLoc, bool) (libclangStaticAnalyzerCore.so.14git+0x2033d8) #15 0x00007f28e7be32fb clang::ento::SimpleConstraintManager::assume(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::DefinedSVal, bool) (libclangStaticAnalyzerCore.so.14git+0x2032fb) #16 0x00007f28e7b15dbc clang::ento::ConstraintManager::assumeDual(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::ento::DefinedSVal) (libclangStaticAnalyzerCore.so.14git+0x135dbc) #17 0x00007f28e7b4780f clang::ento::ExprEngine::evalEagerlyAssumeBinOpBifurcation(clang::ento::ExplodedNodeSet&, clang::ento::ExplodedNodeSet&, clang::Expr const*) (libclangStaticAnalyzerCore.so.14git+0x16780f) This is known to be triggered on curl, tinyxml2, tmux, twin and on xerces. But @bjope also reported similar crashes. So, I'm reverting it to make our internal bots happy again. Differential Revision: https://reviews.llvm.org/D106102
-
- Oct 23, 2021
-
-
Nikita Popov authored
As this API is now internally offset-based, we can accept a starting offset and remove the need to create a temporary bitcast+gep sequence to perform an offset load. The API now mirrors the ConstantFoldLoadFromConst() API.
-
Kazu Hirata authored
-
Kazu Hirata authored
-
Stefan Gränitz authored
The test was removed temporarily in a539a847 to aid switching the RPC API in use in the LLJITWithRemoteDebugging example. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D110649
-
Nikita Popov authored
The last user of this API went away in 4f5e9a2b.
-
Nicolas Vasilache authored
This reverts commit 4703a07e. Didnt' mean to push this yet, sorry about the noise.
-
Nikita Popov authored
The functionality of this method is already covered by computeExitCountExhaustively() in a more general fashion. It was added at a time when exhaustive exit count calculation did not support constant folding loads yet. I double checked that dropping this code causes no binary changes in test-suite. Differential Revision: https://reviews.llvm.org/D112343
-
Nicolas Vasilache authored
This removes duplication and makes nesting more clear. It also reduces the amount of changes necessary for exposing future options. Differential revision: https://reviews.llvm.org/D112344
-
Emilio Cota authored
This patch adds a polynomial approximation that matches the approximation in Eigen. Note that the approximation only applies to vectorized inputs; the scalar rsqrt is left unmodified. The approximation is protected with a flag since it emits an AVX2 intrinsic (generated via the X86Vector). This is the only reasonably clean way that I could find to generate the exact approximation that I wanted (i.e. an identical one to Eigen's). I considered two alternatives: 1. Introduce a Rsqrt intrinsic in LLVM, which doesn't exist yet. I believe this is because there is no definition of Rsqrt that all backends could agree on, since hardware instructions that implement it have widely varying degrees of precision. This is something that the standard could mandate, but Rsqrt is not part of IEEE754, so I don't think this option is feasible. 2. Emit fdiv(1.0, sqrt) with fast math flags to allow reciprocal transformations. Although portable, this doesn't allow us to generate exactly the code we want; it is the LLVM backend, and not MLIR, who controls what code is generated based on the target CPU. Reviewed By: ezhulenev Differential Revision: https://reviews.llvm.org/D112192
-
Frederik Seiffert authored
The `clang` target used in the line below is only generated with `LLVM_ENABLE_PROJECTS=clang`. Without this change, running `ninja clang` will fail with: ``` ninja: error: unknown target 'clang', did you mean 'clean'? ``` Reviewed By: xgupta Differential Revision: https://reviews.llvm.org/D112257
-
Martin Storsjö authored
-
Michał Górny authored
-
Salman Javed authored
Differential Revision: https://reviews.llvm.org/D112356
-
Shivam Gupta authored
-
Jessica Clarke authored
Commit 8fa3e8fa added an implicit REP prefix to all VIA PadLock instructions, but GNU as doesn't add one to xstore, only all the others. This resulted in a kernel panic regression in FreeBSD upon updating to LLVM 11 (https://bugs.freebsd.org/259218) which includes the commit in question. This partially reverts that commit. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D112355
-
Jessica Clarke authored
We currently only test the encoding of xstore but none of the other instructions, which should all have their implicit REP prefix be verified as working. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D112354
-
peter klausler authored
The clang-aarch64-full-2stage buildbot is complaining about a warning with three instances in f18 code (none modified recently). The warning is for using the | bitwise OR operator on bool operands. In one instance, the bitwise operator was being used instead of the logical || operator in order to avoid short-circuting. The fix requires using some temporary variables. In the other two instances, the bitwise operator seemed more idiomatic in context, but can be replaced without harm with the logical operator. Pushing without review as confidence is high and nobody wants a buildbot to stay sad for long.
-
Kazu Hirata authored
-
LLVM GN Syncbot authored
-
Duncan P. N. Exon Smith authored
Change buffer_unique_ostream's constructor to call raw_ostream::SetUnbuffered() on its owned stream. Otherwise, buffer_unique_ostream's destructor could cause the owned stream to temporarily allocate a buffer only to be immediately flushed. Also add some tests for buffer_ostream and buffer_unique_ostream. Use the same naming scheme as other raw_ostream-related tests (e.g., `raw_ostreamTest` for the fixture, `raw_ostream_test.cpp` for the filename). (I considered changing buffer_ostream in the same way (calling SetUnbuffered on the referenced stream), but that seemed like overreach since the client may have more things to write.) (I considered merging buffer_ostream and buffer_unique_ostream into a single class (with a `raw_ostream&` and a `std::unique_ptr` that is only sometimes used), but that makes the class bigger and the small amount of code deduplication seems uncompelling.) Differential Revision: https://reviews.llvm.org/D110369
-
peter klausler authored
The 'A' edit descriptor once served as a form of raw I/O of bytes to/from variables that weren't of type CHARACTER (which itself didn't exist until F'77). This usage was especially common for output of numeric variables that had been initialized with Hollerith. Differential Revision: https://reviews.llvm.org/D112346
-