- Oct 25, 2021
-
-
Jeremy Morse authored
There are a few STL containers hanging around that can become DenseMaps, SmallVectors and similar. This recovers a modest amount of compile time performance. While I'm here, adjust the bit layout of ValueIDNum: this was always supposed to act like a value type, however it seems that clang doesn't compile the comparison functions to act that way. Add a uint64_t to a union that explicitly aliases the bitfields, so that we can compare the whole value as a single integer. Differential Revision: https://reviews.llvm.org/D112333
-
Wouter van Oortmerssen authored
Differential Revision: https://reviews.llvm.org/D112266
-
Jeremy Morse authored
This patch is like D111627 -- instead of calculating IDF for every location on the stack, only do it for the smallest units of interference, and copy the PHIs for those units to any aliases. The test added runs placeMLocPHIs directly, and tests that: * A def of the lower 8 bits of a stack slot causes all aliasing regs to have PHIs placed, * It doesn't cause the equivalent location to x86's $ah, which isn't aliased, to have a PHI placed. Differential Revision: https://reviews.llvm.org/D112324
-
Philip Reames authored
The recently added logic to canonicalize exit conditions to unsigned relies on facts which hold about the use (i.e. exit test). Applying this blindly to the icmp is not legal, as there may be another use which never reaches the exit. Restrict ourselves to case where we have a single use.
-
Craig Topper authored
All but 2 of the vector builtins are only used by clang_builtin_alias. When using clang_builtin_alias, the type string of the builtin is never checked. Only the types in the function definition used for the alias are checked. This patch takes advantage of this to share a single builtin for many different types. We already used type overloads on the IR intrinsic so the codegen for the builtins that are being merge were already the same. This extends the type overloading to the builtins. I had to make a few tweaks to make this work. -Floating point vector-vector vmerge now uses the vmerge intrinsic instead of the vfmerge intrinsic. New isel patterns and tests are added to support this. -The SemaChecking for the immediate of vset_v/vget_v has been removed. Determining the valid range is harder now. I've added masking to ManualCodegen to ensure valid IR for invalid input. This reduces the number of builtins from ~25000 to ~1100. Reviewed By: HsiangKai Differential Revision: https://reviews.llvm.org/D112102
-
Craig Topper authored
Reviewed By: frasercrmck, kito-cheng Differential Revision: https://reviews.llvm.org/D112342
-
Danila Malyutin authored
Differential Revision: https://reviews.llvm.org/D107582
-
Jeremy Morse authored
During register allocation, some instructions can have stack spills fused into them. It means that when vregs are allocated on the stack we can convert: SETCCr %0 DBG_VALUE %0 to SETCCm %stack.0 DBG_VALUE %stack.0 Unfortunately instruction referencing finds this harder: a store to the stack doesn't have a specific operand number, therefore we don't substitute the old operand for a new operand, and the location is dropped. This patch implements a solution: just recognise the memory operand attached to an instruction with a Special Number (TM), and record a substitution between the old value and the new one. This patch adds substitution code to InlineSpiller to record such fused spills, and tracking in InstrRefBasedLDV to recognise such values, and produce the value numbers for them. Everything to do with the movement of stack-defined values is already handled in InstrRefBasedLDV. Differential Revision: https://reviews.llvm.org/D111317
-
Danila Malyutin authored
Before the code would crash with "unhandled opcode in isAArch64FrameOffsetLegal" when there was a spill from extractelement. Fixes pr52249 Differential Revision: https://reviews.llvm.org/D112311
-
Nikita Popov authored
D109746 made BasicAA use range information to determine the minimum/maximum GEP offset. However, it was limited to the case of a single variable index. This patch extends support to multiple indices by adding all the ranges together. Differential Revision: https://reviews.llvm.org/D112378
-
Alexey Bataev authored
Need to change the order of the reduction/binops args pair vectorization attempts. Need to try to find the reduction at first and postpone vectorization of binops args. This may help to find more reduction patterns and vectorize them. Part of D111574. Differential Revision: https://reviews.llvm.org/D112224
-
Jeremy Morse authored
This patch swaps two lines -- the CurSucc reference can be invalidated by the call to DFS.push_back, therefore that should happen last. The usual hat-tip to asan for catching this. This patch also swaps an ealier call to ToAdd.insert and DFS.push_back, where a stable iterator (from successors()) is being used. This isn't strictly necessary, but is good for consistency and avoiding readers asking themselves why the two code portions have a different order.
-
Sanjay Patel authored
(i8 X ^ 128) & (i8 X s>> 7) --> usubsat X, 128 As suggested in D112085, we can substitute 'xor' with 'add' in this pattern, and it is logically equivalent: https://alive2.llvm.org/ce/z/eJtWWC We canonicalize to 'xor' in IR, but SDAG does not do that (and it probably should not - https://llvm.org/PR52267 ), so it is possible to see either pattern in codegen. Note that 'sub' is a another potential pattern, but that is canonicalized to 'add' in DAGCombiner, so we don't need to worry about that variation. Differential Revision: https://reviews.llvm.org/D112377
-
Tim Northover authored
Unfortunately ToT has changed enough from the revision where this actually caused problems that the test no longer triggers an assertion failure.
-
Kerry McLaughlin authored
This patch enables the use of reciprocal estimates for SVE when both the -Ofast and -mrecip flags are used. Reviewed By: david-arm, paulwalker-arm Differential Revision: https://reviews.llvm.org/D111657
-
Max Kazantsev authored
We observe a hang within iterativelySimplifyCFG due to infinite loop execution. Currently, there is no limit to this loop, so in case of bug it just works forever. This patch adds an assert that will break it after 1000 iterations if it didn't converge.
-
Nikita Popov authored
Currently strip.invariant/launder.invariant are handled by constructing constant expressions with the intrinsics skipped. This takes an alternative approach of accumulating the offset using stripAndAccumulateConstantOffsets(), with a flag to look through invariant.group intrinsics. Differential Revision: https://reviews.llvm.org/D112382
-
Florian Hahn authored
At the moment a dummy entry block is created at the beginning of VPlan construction. This dummy block is later removed again. This means it is not easy to identify the VPlan header block in a general fashion, because during recipe creation it is the single successor of the entry block, while later it is the entry block. To make getting the header easier, just skip creating the dummy block. Reviewed By: Ayal Differential Revision: https://reviews.llvm.org/D111299
-
Jingu Kang authored
%3:gpr32 = ORRWrs $wzr, %2, 0 %4:gpr64 = SUBREG_TO_REG 0, %3, %subreg.sub_32 If AArch64's 32-bit form of instruction defines the source operand of ORRWrs, we can remove the ORRWrs because the upper 32 bits of the source operand are set to zero. Differential Revision: https://reviews.llvm.org/D110841
-
Nikita Popov authored
Use dyn_cast_or_null and convert one of the checks into an assertion. SCEV is a per-function analysis.
-
Kazu Hirata authored
This patch fixes: llvm/lib/Analysis/ScalarEvolution.cpp:12770:37: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
-
Max Kazantsev authored
Mass forgetMemoizedResults can be done more efficiently than bunch of individual invocations of helper because we can traverse maps being updated just once, rather than doing this for each invidivual SCEV. Should be NFC and supposedly improves compile time. Differential Revision: https://reviews.llvm.org/D112294 Reviewed By: reames
-
Max Kazantsev authored
When forgetting multiple SCEVs, rather than doing this one by one, we can instead use mass updates. We plan to make them more efficient than they are now, potentially improving compile time. Differential Revision: https://reviews.llvm.org/D111602 Reviewed By: reames
-
Max Kazantsev authored
This patch changes signature of forgetMemoizedResults to be able to work with multiple SCEVs. Usage will come in follow-ups. We also plan to optimize it in the future to work faster than individual invalidation updates. Should not change behavior in any sense. Split-off from D111602. Differential Revision: https://reviews.llvm.org/D112293 Reviewed By: reames
-
Max Kazantsev authored
Follow-up from D112295, suggested by Nikita: we can avoid tracking users of SCEVConstants because dropping their cached info is unlikely to give any new prospects for fact inference, and it should not introduce any correctness problems.
-
Max Kazantsev authored
This patch introduces API that keeps track of SCEVs users of another SCEVs, required to handle invalidations of users along with operands that comes in follow-up patches. Differential Revision: https://reviews.llvm.org/D112295 Reviewed By: reames
-
Chen Zheng authored
Add a new preparation pattern in PPCLoopInstFormPrep pass to reduce register pressure. Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D108750
-
Kazu Hirata authored
-
Kazu Hirata authored
-
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
-
- Oct 24, 2021
-
-
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.
-
Fangrui Song authored
-
Kazu Hirata authored
We can erase an item in a set or map without checking its membership first.
-
- Oct 23, 2021
-
-
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.
-
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
-