History log of /llvm-project/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp (Results 1 – 25 of 125)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4
# f71cb9db 14-Nov-2024 Kazu Hirata <kazu@google.com>

[PowerPC] Remove unused includes (NFC) (#116163)

Identified with misc-include-cleaner.


# 4048c643 12-Nov-2024 Kazu Hirata <kazu@google.com>

[llvm] Remove redundant control flow statements (NFC) (#115831)

Identified with readability-redundant-control-flow.


# 674574d2 31-Oct-2024 zhijian lin <zhijian@ca.ibm.com>

Promote 32bit pseudo instr that infer extsw removal to 64bit in PPCMIPeephole (#85451)

Fixes: https://github.com/llvm/llvm-project/issues/71030

Bug only happens in 64bit involving spills. Since

Promote 32bit pseudo instr that infer extsw removal to 64bit in PPCMIPeephole (#85451)

Fixes: https://github.com/llvm/llvm-project/issues/71030

Bug only happens in 64bit involving spills. Since we don't know when the
spill will happen, all instructions in the chain used to deduce sign
extension for eliminating 'extsw' will need to be promoted to 64-bit
pseudo instructions.

The following instruction will promoted in PPCMIPeepholes: EXTSH, LHA,
ISEL to EXTSH8, LHA8, ISEL8

show more ...


Revision tags: llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 266a784c 16-Jul-2024 Lei Huang <lei@ca.ibm.com>

[PowerPC] Ensure MI peephole knows about instr modified by combineRLWINM() (#97134)

Ensure registers used in instructions modified by `combineRLWINM()` are
added to list of `RegsToUpdate`.


# 09989996 12-Jul-2024 paperchalice <liujunchang97@outlook.com>

[CodeGen][NewPM] Port `machine-block-freq` to new pass manager (#98317)

- Add `MachineBlockFrequencyAnalysis`.
- Add `MachineBlockFrequencyPrinterPass`.
- Use `MachineBlockFrequencyInfoWrapperPass

[CodeGen][NewPM] Port `machine-block-freq` to new pass manager (#98317)

- Add `MachineBlockFrequencyAnalysis`.
- Add `MachineBlockFrequencyPrinterPass`.
- Use `MachineBlockFrequencyInfoWrapperPass` in legacy pass manager.
- `LazyMachineBlockFrequencyInfo::print` is empty, drop it due to new
pass manager migration.

show more ...


# ac0b2814 09-Jul-2024 paperchalice <liujunchang97@outlook.com>

[CodeGen][NewPM] Port `LiveVariables` to new pass manager (#97880)

- Port `LiveVariables` to new pass manager.
- Convert to `LiveVariablesWrapperPass` in legacy pass manager.


# 480a788e 20-Jun-2024 Kai Luo <lkail@cn.ibm.com>

[PowerPC] Make verifier happy after peephole on MMA COPYs (#94321)


Revision tags: llvmorg-18.1.8
# 4b24c2df 12-Jun-2024 paperchalice <liujunchang97@outlook.com>

[CodeGen][NewPM] Split `MachinePostDominators` into a concrete analysis result (#95113)

`MachinePostDominators` version of #94571.


# 837dc542 11-Jun-2024 paperchalice <liujunchang97@outlook.com>

[CodeGen][NewPM] Split `MachineDominatorTree` into a concrete analysis result (#94571)

Prepare for new pass manager version of `MachineDominatorTreeAnalysis`.
We may need a machine dominator tree v

[CodeGen][NewPM] Split `MachineDominatorTree` into a concrete analysis result (#94571)

Prepare for new pass manager version of `MachineDominatorTreeAnalysis`.
We may need a machine dominator tree version of `DomTreeUpdater` to
handle `SplitCriticalEdge` in some CodeGen passes.

show more ...


Revision tags: llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5
# 0a0f1f9f 28-Apr-2024 Chen Zheng <czhengsz@cn.ibm.com>

[PPC]add DEBUG_COUNTER for PPCMIPeephole pass


Revision tags: llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3
# 529ad40e 06-Oct-2023 Lei <44480291+lei137@users.noreply.github.com>

[PowerPC] Fix missing kill flag update for XVCVDPSP transformations (#67997)

Add transformed register to kill flag work list for XVCVDPSP tranformations.

Ref: reviews.llvm.org/D133103


# 5181156b 05-Oct-2023 Matthias Braun <matze@braunis.de>

Use BlockFrequency type in more places (NFC) (#68266)

The `BlockFrequency` class abstracts `uint64_t` frequency values. Use it
more consistently in various APIs and disable implicit conversion to

Use BlockFrequency type in more places (NFC) (#68266)

The `BlockFrequency` class abstracts `uint64_t` frequency values. Use it
more consistently in various APIs and disable implicit conversion to
make usage more consistent and explicit.

- Use `BlockFrequency Freq` parameter for `setBlockFreq`,
`getProfileCountFromFreq` and `setBlockFreqAndScale` functions.
- Return `BlockFrequency` in `getEntryFreq()` functions.
- While on it change some `const BlockFrequency& Freq` parameters to
plain `BlockFreqency Freq`.
- Mark `BlockFrequency(uint64_t)` constructor as explicit.
- Add missing `BlockFrequency::operator!=`.
- Remove `uint64_t BlockFreqency::getMaxFrequency()`.
- Add `BlockFrequency BlockFrequency::max()` function.

show more ...


Revision tags: llvmorg-17.0.2
# f2f61a99 26-Sep-2023 esmeyi <esme.yi@ibm.com>

[PowerPC] A fix for D159073. Do not optimize when register classes are different in src and dst.

For example:
```
%298:g8rc = RLDICL %297:g8rc, 0, 48
%299:gprc = COPY killed %298.sub_32:g8rc
d

[PowerPC] A fix for D159073. Do not optimize when register classes are different in src and dst.

For example:
```
%298:g8rc = RLDICL %297:g8rc, 0, 48
%299:gprc = COPY killed %298.sub_32:g8rc
dead %498:gprc = ANDI_rec killed %299:gprc, 1, implicit-def dead $cr0, implicit-def $cr0gt
```

show more ...


# d7195c57 26-Sep-2023 esmeyi <esme.yi@ibm.com>

Reland https://reviews.llvm.org/D159073.

The patch failed in test-suite due to a liveness error after rebasing on https://reviews.llvm.org/D133103, and now it's fixed.

```
[PowerPC][Peephole] Combi

Reland https://reviews.llvm.org/D159073.

The patch failed in test-suite due to a liveness error after rebasing on https://reviews.llvm.org/D133103, and now it's fixed.

```
[PowerPC][Peephole] Combine rldicl/rldicr and andi/andis after isel.

Summary: rldicl/rldicr can be eliminated if it's used to clear thehigh-order or low-order n bits and all bits cleared will be ANDed with 0 byandi/andis. Or they can be folded to `andi 0` if all bits to AND are alreadyzero in the input.

Reviewed By: qiucf, shchenz

Differential Revision: https://reviews.llvm.org/D159073
```

show more ...


# 77147a95 26-Sep-2023 esmeyi <esme.yi@ibm.com>

Revert "[PowerPC][Peephole] Combine rldicl/rldicr and andi/andis after isel."

This reverts commit 2de74e1bd4d540063d7495fa6254781abd41e179.

A test-suite failure occurs due to this commit, will fix

Revert "[PowerPC][Peephole] Combine rldicl/rldicr and andi/andis after isel."

This reverts commit 2de74e1bd4d540063d7495fa6254781abd41e179.

A test-suite failure occurs due to this commit, will fix soon.

show more ...


# 2de74e1b 26-Sep-2023 esmeyi <esme.yi@ibm.com>

[PowerPC][Peephole] Combine rldicl/rldicr and andi/andis after isel.

Summary: rldicl/rldicr can be eliminated if it's used to clear the high-order or low-order n bits and all bits cleared will be AN

[PowerPC][Peephole] Combine rldicl/rldicr and andi/andis after isel.

Summary: rldicl/rldicr can be eliminated if it's used to clear the high-order or low-order n bits and all bits cleared will be ANDed with 0 by andi/andis. Or they can be folded to `andi 0` if all bits to AND are already zero in the input.

Reviewed By: qiucf, shchenz

Differential Revision: https://reviews.llvm.org/D159073

show more ...


# 46d5d264 22-Sep-2023 Nemanja Ivanovic <nemanja.i.ibm@gmail.com>

[PowerPC] Improve kill flag computation and add verification after MI peephole

The MI Peephole pass has grown to include a large number of transformations over the years. Many of the transformations

[PowerPC] Improve kill flag computation and add verification after MI peephole

The MI Peephole pass has grown to include a large number of transformations over the years. Many of the transformations require re-computation of kill flags but don't do a good job of re-computing them. This causes us to have very common failures when the compiler is built with expensive checks. Over time, we added and augmented a function that is supposed to go and fix up kill flags after each transformation but we keep missing cases.
This patch does the following:
- Removes the function to re-compute kill flags
- Adds LiveVariables to compute and maintain kill flags while transforming code
- Adds re-computation of kill flags for the post-RA peepholes for each block that contains a transformed instruction

Reviewed By: stefanp

Differential Revision: https://reviews.llvm.org/D133103

show more ...


Revision tags: llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# 0bcef1d9 12-Jul-2023 Ting Wang <Ting.Wang.SH@ibm.com>

[PowerPC] remove XXSWAPD after vector splat immediate

Redundant XXSWAPD has been observed on little-endian in D138883 test
case. Remove those associated with vector splat instructions.

Reviewed By:

[PowerPC] remove XXSWAPD after vector splat immediate

Redundant XXSWAPD has been observed on little-endian in D138883 test
case. Remove those associated with vector splat instructions.

Reviewed By: shchenz

Differential Revision: https://reviews.llvm.org/D139193

show more ...


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4
# be95b4de 08-May-2023 Stefan Pintilie <stefanp@ca.ibm.com>

[PowerPC] Look through OR, AND, XOR instructions when checking a clear.

This patch adds the additional step of looking through AND, OR, XOR
instructions when we check the number of leading zeros.

R

[PowerPC] Look through OR, AND, XOR instructions when checking a clear.

This patch adds the additional step of looking through AND, OR, XOR
instructions when we check the number of leading zeros.

Reviewed By: shchenz

Differential Revision: https://reviews.llvm.org/D149223

show more ...


Revision tags: llvmorg-16.0.3
# 398d68f6 24-Apr-2023 Fangrui Song <i@maskray.me>

[PPCMIPeephole] Fix incorrect compare elimination

D38236 moves a redundant compare instruction from the loop body to the
preheader.

It has a bug: when `MBB1 == &MBB2`, there may be only one compare

[PPCMIPeephole] Fix incorrect compare elimination

D38236 moves a redundant compare instruction from the loop body to the
preheader.

It has a bug: when `MBB1 == &MBB2`, there may be only one compare instruction in the
loop. The code will lift the compare instruction to the preheader, failing to
account for the change of the compare result in a tail call, leading to a miscompile.

Suppress the compare elimination to fix https://github.com/llvm/llvm-project/issues/62294

Reviewed By: #powerpc, nemanjai

Differential Revision: https://reviews.llvm.org/D149030

show more ...


Revision tags: llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3
# 52a774fd 17-Feb-2023 Ting Wang <Ting.Wang.SH@ibm.com>

[PowerPC] remove XXSWAPD after load from CP which is a splat value

If the value from constant-pool is a splat value of vector type, do not
need swap after load from constant-pool.

Reviewed By: shch

[PowerPC] remove XXSWAPD after load from CP which is a splat value

If the value from constant-pool is a splat value of vector type, do not
need swap after load from constant-pool.

Reviewed By: shchenz

Differential Revision: https://reviews.llvm.org/D139491

show more ...


Revision tags: llvmorg-16.0.0-rc2
# 1d8f13ae 03-Feb-2023 Ting Wang <Ting.Wang.SH@ibm.com>

[PowerPC] add a peephole to remove redundant swap instructions after vector splats on P8

Vector store on P8 little endian will have swap instruction added before
the store in PPCISelLowring. If the

[PowerPC] add a peephole to remove redundant swap instructions after vector splats on P8

Vector store on P8 little endian will have swap instruction added before
the store in PPCISelLowring. If the vector is generated by splat, the
swap instruction can be eliminated.

Reviewed By: shchenz

Differential Revision: https://reviews.llvm.org/D139691

show more ...


# 19311e0a 31-Jan-2023 Nemanja Ivanovic <nemanja.i.ibm@gmail.com>

[PowerPC] Do not convert lwz to lwa if the offset is not a multiple of 4

The transform that converts this checks the alignment of the global
object being accessed. However, there was no check for th

[PowerPC] Do not convert lwz to lwa if the offset is not a multiple of 4

The transform that converts this checks the alignment of the global
object being accessed. However, there was no check for the offset
within the global object which caused the compiler to produce a
DS relocation for an unaligned address.

show more ...


# e0782018 28-Jan-2023 Kazu Hirata <kazu@google.com>

[Target] Use llvm::count{l,r}_{zero,one} (NFC)


Revision tags: llvmorg-16.0.0-rc1, llvmorg-17-init
# 79858d19 14-Jan-2023 Craig Topper <craig.topper@sifive.com>

[CodeGen][Target] Remove uses of Register::isPhysicalRegister/isVirtualRegister. NFC

Use isPhysical/isVirtual methods.


12345