[PATCH] D70680: [ARM][WIP] Fix thumb2 ADD SUB invalid writes to SP

Diogo N. Sampaio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 25 09:57:47 PST 2019


dnsampaio created this revision.
Herald added subscribers: llvm-commits, dmgreen, hiraditya, kristof.beyls.
Herald added a project: LLVM.

This is a wip. Sharing for case intrested parties can give early feedback.
This patch fixes pr23772, which causes thumb2 instrucions to write to sp
without reading from the same register, what is UNPREDICTABLE in thumb-v7m.
The proposed solution restrict the existing instructions to write to SP,
and adds instructions that require both source and destination instructions
to be SP.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70680

Files:
  llvm/lib/Target/ARM/ARMAsmPrinter.cpp
  llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
  llvm/lib/Target/ARM/ARMFrameLowering.cpp
  llvm/lib/Target/ARM/ARMInstrThumb2.td
  llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp
  llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
  llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp
  llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
  llvm/lib/Target/ARM/Thumb2SizeReduction.cpp
  llvm/test/CodeGen/ARM/GlobalISel/thumb-select-arithmetic-ops.mir
  llvm/test/CodeGen/ARM/GlobalISel/thumb-select-load-store.mir
  llvm/test/CodeGen/Thumb2/fp16-stacksplot.mir
  llvm/test/CodeGen/Thumb2/mve-stacksplot.mir
  llvm/test/CodeGen/Thumb2/peephole-addsub.mir
  llvm/test/CodeGen/Thumb2/peephole-cmp.mir
  llvm/test/MC/ARM/invalid-addsub.s
  llvm/test/MC/ARM/register-token-source-loc.s
  llvm/test/MC/ARM/thumb-diagnostics.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70680.230924.patch
Type: text/x-patch
Size: 39707 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191125/f6dc285b/attachment.bin>


More information about the llvm-commits mailing list