[PATCH] D101342: [SelectionDAG][Mips][PowerPC][RISCV][WebAssembly] Teach computeKnownBits/ComputeNumSignBits about atomics

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 26 21:33:56 PDT 2021


jrtc27 created this revision.
jrtc27 added reviewers: craig.topper, bogner, RKSimon, atanasyan, nemanjai, sunfish.
Herald added subscribers: vkmr, frasercrmck, ecnelises, evandro, luismarques, apazos, sameer.abuasal, steven.zhang, s.egerton, shchenz, Jim, benna, psnobl, jocewei, PkmX, jfb, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, jgravelle-google, arichardson, sbc100, sdardis, dschuff.
jrtc27 requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay, aheejin.
Herald added a project: LLVM.

Unlike normal loads these don't have an extension field, but we know
from TargetLowering whether these are sign-extending or zero-extending,
and so can optimise away unnecessary extensions.

This was noticed on RISC-V, where sign extensions in the calling
convention would result in unnecessary explicit extension instructions,
but this also fixes some Mips inefficiencies. PowerPC sees churn in the
tests as all the zero extensions are only for promoting 32-bit to
64-bit, but these zero extensions are still not optimised away as they
should be, likely due to i32 being a legal type.

This also simplifies the WebAssembly code somewhat, which currently
works around the lack of target-independent combines with some ugly
patterns that break once they're optimised away.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101342

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td
  llvm/test/CodeGen/Mips/atomic.ll
  llvm/test/CodeGen/PowerPC/atomics-i16-ldst.ll
  llvm/test/CodeGen/PowerPC/atomics-i32-ldst.ll
  llvm/test/CodeGen/PowerPC/atomics-i64-ldst.ll
  llvm/test/CodeGen/PowerPC/atomics-i8-ldst.ll
  llvm/test/CodeGen/RISCV/atomic-signext.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101342.340722.patch
Type: text/x-patch
Size: 183686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210427/3e8aa641/attachment-0001.bin>


More information about the llvm-commits mailing list