|
 | llvm/test/Transforms/SimplifyCFG/speculate-store.ll (diff) |
|
 | compiler-rt/lib/dfsan/done_abilist.txt (diff) |
 | compiler-rt/lib/dfsan/dfsan_custom.cpp (diff) |
 | compiler-rt/test/dfsan/custom.cpp (diff) |
Commit
aca5aeb7523d7868a4b0706330dcdfc58c0adaed
by gusrb406[InstCombine] Add freezeAllUsesOfArgument to visitFreeze
In D106041, a freeze was added before the branch condition to solve the miscompilation problem of SimpleLoopUnswitch. However, I found that the added freeze disturbed other optimizations in the following situations. ``` arg.fr = freeze(arg) use(arg.fr) ... use(arg) ``` It is a problem that occurred when arg and arg.fr were recognized as different values. Therefore, changing to use arg.fr instead of arg throughout the function eliminates the above problem. Thus, I add a function that changes all uses of arg to freeze(arg) to visitFreeze of InstCombine.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D106233
|
 | llvm/test/Transforms/InstCombine/freeze.ll (diff) |
 | llvm/test/Transforms/PhaseOrdering/X86/vector-reductions-logical.ll (diff) |
 | llvm/lib/Transforms/InstCombine/InstCombineInternal.h (diff) |
 | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp (diff) |
|
 | llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp (diff) |
|
 | llvm/test/CodeGen/X86/add-cmov.ll (diff) |
Commit
c261a06b7a98549ab7be858337bb80c9259c2be8
by llvm-dev[DAG] Add initial SelectionDAG::isGuaranteedNotToBeUndefOrPoison framework (PR51129)
I've setup the basic framework for the isGuaranteedNotToBeUndefOrPoison call and updated DAGCombiner::visitFREEZE to use it, further Opcodes can be handled when we have test coverage.
I'm not aware of any vector test freeze coverage so the DemandedElts (and the Depth) args are not being used yet - but they are in place.
SelectionDAG::isGuaranteedNotToBePoison wrappers have also been added.
Differential Revision: https://reviews.llvm.org/D106668
|
 | llvm/include/llvm/CodeGen/TargetLowering.h (diff) |
 | llvm/include/llvm/CodeGen/SelectionDAG.h (diff) |
 | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (diff) |
 | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (diff) |
 | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp (diff) |
|
 | clang/test/Index/preamble-reparse-changed-module.m (diff) |
Commit
b7a464989955e6374b39b518e317b59b510d4dc5
by ivan.butygin[mlir] ConversionTarget legality callbacks refactoring
* Get rid of Optional<std::function> as std::function already have a null state * Add private setLegalityCallback function to set legality callback for unknown ops * Get rid of unknownOpsDynamicallyLegal flag, use unknownLegalityFn state insted. This causes behavior change when user first calls markUnknownOpDynamicallyLegal with callback and then without but I am not sure is the original behavior was really a 'feature', or just oversignt in the original implementation.
Differential Revision: https://reviews.llvm.org/D105496
|
 | mlir/lib/Transforms/Utils/DialectConversion.cpp (diff) |
 | mlir/include/mlir/Transforms/DialectConversion.h (diff) |
Commit
13ca0c87edd026813ef7cbf3fbeb0efdb9c8bd3c
by aykevanlaethem[lld][WebAssembly] Align __heap_base
__heap_base was not aligned. In practice, it will often be aligned simply because it follows the stack, but when the stack is placed at the beginning (with the --stack-first option), the __heap_base might be unaligned. It could even be byte-aligned.
At least wasi-libc appears to expect that __heap_base is aligned: https://github.com/WebAssembly/wasi-libc/blob/659ff414560721b1660a19685110e484a081c3d4/dlmalloc/src/malloc.c#L5224
While WebAssembly itself does not appear to require any alignment for memory accesses, it is sometimes required when sharing a pointer externally. For example, WASI might expect alignment up to 8: https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/docs.md#-timestamp-u64
This issue got introduced with the addition of the --stack-first flag: https://reviews.llvm.org/D46141 I suspect the lack of alignment wasn't intentional here.
Differential Revision: https://reviews.llvm.org/D106499
|
 | lld/wasm/Writer.cpp (diff) |
 | lld/test/wasm/stack-first.test (diff) |
 | lld/test/wasm/Inputs/stack-first.s |
Commit
feda08b70a9bbb55bbdd1b85a83d29f3ed41cf08
by aykevanlaethem[AVR] Do not chain stores in call frame setup
Previously, AVRTargetLowering::LowerCall attempted to keep stack stores in order with chains. Perhaps this worked in the past, but it does not work now: it appears that the SelectionDAG legalization phase removes these chains. Therefore, I've removed these chains entirely to match X86 (which, similar to AVR, also prefers to use push instructions over stack-relative stores to set up a call frame). With this change, all the stack stores are in a somewhat reasonable order.
Differential Revision: https://reviews.llvm.org/D97853
|
 | llvm/test/CodeGen/AVR/call.ll (diff) |
 | llvm/test/CodeGen/AVR/varargs.ll (diff) |
 | llvm/test/CodeGen/AVR/dynalloca.ll (diff) |
 | llvm/lib/Target/AVR/AVRISelLowering.cpp (diff) |
Commit
8544ce80f881a33a2c4c8e234709d136b52fa4d8
by aykevanlaethem[AVR] Set R31R30 as clobbered after ADJCALLSTACKDOWN
In most cases, using R31R30 is fine because the call (which always precedes ADJCALLSTACKDOWN) will clobber R31R30 anyway. However, in some rare cases the register allocator might insert an instruction between the call and the ADJCALLSTACKDOWN instruction and expect the register pair to be live afterwards. I think this happens as a result of rematerialization. Therefore, to fix this, the instruction needs to have Defs set to R31R30.
Setting the Defs field does have the effect of making the instruction look dead, which it certainly is not. This is fixed by setting hasSideEffects to true.
Differential Revision: https://reviews.llvm.org/D97745
|
 | llvm/lib/Target/AVR/AVRInstrInfo.td (diff) |
Commit
431a9414655ba4825a46e6765ef50a0b4ef7e101
by aykevanlaethem[AVR] Improve 8/16 bit atomic operations
There were some serious issues with atomic operations. This patch should fix the biggest issues.
For details on the issue take a look at this Compiler Explorer sample: https://godbolt.org/z/n3ndhn
Code:
void atomicadd(_Atomic char *val) { *val += 5; }
Output:
atomicadd: movw r26, r24 ldi r24, 5 ; 'operand' register in r0, 63 cli ld r24, X ; load value add r24, r26 ; value += X st X, r24 ; store value back out 63, r0 ret ; return the wrong value (in r24)
There are various problems with this.
- The value to add (5) is stored in r24. However, the value to add to is loaded in the same register: r24. - The `add` instruction adds half of the pointer to the loaded value, instead of (attempting to) add the operand with value 5. - The output value of the cmpxchg instruction (which is not used in this code sample) is the new value with 5 added, not the old value. The LangRef specifies that it has to be the old value, before the operation.
This patch fixes the first two and leaves the third problem to be fixed at a later date. I believe atomics were mostly broken before this patch, with this patch they should become usable as long as you ignore the output of the atomic operation. In particular it fixes the following things:
- It sets the earlyclobber flag for the input ('$operand' operand) so that the register allocator puts it in a different register than the output value. - It fixes a number of issues with the pseudo op expansion pass, for example now it adds the $operand field instead of the pointer. This fixes most machine instruction verifier issues (other flagged issues are unrelated to atomics).
Differential Revision: https://reviews.llvm.org/D97127
|
 | llvm/lib/Target/AVR/AVRInstrInfo.td (diff) |
 | llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp (diff) |
Commit
6aa9e746ebde6efd2479fa833d2d816d0a7bb353
by aykevanlaethem[AVR] Expand large shifts early in IR
This patch makes sure shift instructions such as this one:
%result = shl i32 %n, %amount
are expanded just before the IR to SelectionDAG conversion to a loop so that calls to non-existing library functions such as __ashlsi3 are avoided. The generated code is currently pretty bad but there's a lot of room for improvement: the shift itself can be done in just four instructions.
Differential Revision: https://reviews.llvm.org/D96677
|
 | llvm/test/CodeGen/AVR/shift-expand.ll |
 | llvm/lib/Target/AVR/AVR.h (diff) |
 | llvm/lib/Target/AVR/AVRTargetMachine.cpp (diff) |
 | llvm/lib/Target/AVR/AVRShiftExpand.cpp |
 | llvm/lib/Target/AVR/CMakeLists.txt (diff) |
Commit
41f905b211fc904d10f819618dcb62f90ba82c45
by aykevanlaethem[AVR] Fix rotate instructions
This patch fixes some issues with the RORB pseudo instruction.
- A minor issue in which the instructions were said to use the SREG, which is not true. - An issue with the BLD instruction, which did not have an output operand. - A major issue in which invalid instructions were generated. The fix also reduce RORB from 4 to 3 instructions, so it's also a small optimization.
These issues were flagged by the machine verifier.
Differential Revision: https://reviews.llvm.org/D96957
|
 | llvm/lib/Target/AVR/AVRInstrInfo.td (diff) |
 | llvm/test/CodeGen/AVR/rot.ll (diff) |
 | llvm/lib/Target/AVR/AVRExpandPseudoInsts.cpp (diff) |
Commit
4d7f5c0a85cde0c144a424059e53079230ec2ea2
by aykevanlaethem[AVR] Only support sp, r0 and r1 in llvm.read_register
Most other registers are allocatable and therefore cannot be used.
This issue was flagged by the machine verifier, because reading other registers is considered reading from an undefined register.
Differential Revision: https://reviews.llvm.org/D96969
|
 | llvm/lib/Target/AVR/AVRISelLowering.cpp (diff) |
 | llvm/test/CodeGen/AVR/intrinsics/named-reg-special.ll |
 | llvm/test/CodeGen/AVR/intrinsics/named-reg-alloc.ll |
 | llvm/test/CodeGen/AVR/intrinsics/read_register.ll |
|
 | llvm/utils/gn/secondary/llvm/lib/Target/AVR/BUILD.gn (diff) |
Commit
478b22d95aee2b818008a7b92b8606175767d0de
by llvm-dev[CGP] despeculateCountZeros - Don't create is-zero branch if cttz/ctlz source is known non-zero
If value tracking can confirm that the cttz/ctlz source is known non-zero then we don't need to create a branch (which DAG will struggle to recover from).
Differential Revision: https://reviews.llvm.org/D106685
|
 | llvm/test/CodeGen/X86/clz.ll (diff) |
 | llvm/lib/CodeGen/CodeGenPrepare.cpp (diff) |
Commit
e697a542cab39360a578adbf32e0d853a444804c
by paul.walker[SVE][NFC] Cleanup fixed length code gen tests to make them more resilient.
Many of the tests have used NEXT when DAG is more approprite. In some cases single DAG lines have been used. Note that these are manual tests because they're to complex for update_llc_test_checks.py and so it's worth not relying too much on the ordered output.
I've also made the CHECK lines more uniform when it comes to the ordering of things like LO/HI.
|
 | llvm/test/CodeGen/AArch64/sve-fixed-length-fp-reduce.ll (diff) |
 | llvm/test/CodeGen/AArch64/sve-fixed-length-masked-scatter.ll (diff) |
 | llvm/test/CodeGen/AArch64/sve-fixed-length-int-extends.ll (diff) |
 | llvm/test/CodeGen/AArch64/sve-fixed-length-vector-shuffle.ll (diff) |
 | llvm/test/CodeGen/AArch64/sve-fixed-length-trunc-stores.ll (diff) |
 | llvm/test/CodeGen/AArch64/sve-fixed-length-masked-gather.ll (diff) |
 | llvm/test/CodeGen/AArch64/sve-fixed-length-fp-rounding.ll (diff) |
 | llvm/test/CodeGen/AArch64/sve-fixed-length-int-to-fp.ll (diff) |
 | llvm/test/CodeGen/AArch64/sve-fixed-length-fp-extend-trunc.ll (diff) |
 | llvm/test/CodeGen/AArch64/sve-fixed-length-fp-to-int.ll (diff) |
|
 | llvm/test/CodeGen/X86/div-rem-pair-recomposition-signed.ll (diff) |
 | llvm/test/CodeGen/X86/div-rem-pair-recomposition-unsigned.ll (diff) |
Commit
c3277a88285e5e40e6d5ee9da7342fae42eaf82e
by sander.desmalen[BasicTTI] Set scalarization cost of scalable vector casts to Invalid.
When BasicTTIImpl::getCastInstrCost can't determine the cost of a vector cast operation when the types need legalization, it falls back to calculating scalarization costs. Instead of crashing on `cast<FixedVectorType>(DstVTy)` when the type is a scalable vector, return an Invalid cost.
Reviewed By: david-arm
Differential Revision: https://reviews.llvm.org/D106655
|
 | llvm/test/Analysis/CostModel/AArch64/sve-fptoi.ll (diff) |
 | llvm/include/llvm/CodeGen/BasicTTIImpl.h (diff) |
Commit
e27c700b9a925b65d19391feee59a50dc39694ea
by benny.kra[mlir] Restore markUnknownOpDynamicallyLegal to call isDynamicallyLegal by default
Looks like an oversight from b7a464989955e6374b39b518e317b59b510d4dc5
This should probably have a test case ...
|
 | mlir/include/mlir/Transforms/DialectConversion.h (diff) |