[PATCH] Delay slot filler: Replace the microMIPS BEQ/BNE with the BEQZC/BNEZC

Jozef Kolek jozef.kolek at rt-rk.com
Fri Nov 21 12:28:44 PST 2014


Rebased patch:

In the function MipsLongBranch::replaceBranch() the condition:
  ((unsigned) Br->getOpcode()) != Mips::BEQZC_MM && ((unsigned) Br->getOpcode()) != Mips::BNEZC_MM
is replaced with:
  Br->hasDelaySlot()

The file 'test/CodeGen/Mips/micromips-long-branch.ll' has been removed since by commit 207656. MicroMIPS long branch is now tested in the file 'test/CodeGen/Mips/longbranch.ll'. Back then the change of value of ADDIU instruction was due to its role in calculation of long branches. The immediate part of ADDIU was something like %lo(($lab1)-($lab2)), and because BEQZ was between $lab1 and $lab2 after it was replaced by BEQZC (no NOP anymore) the immediate value of ADDIU was changed.

http://reviews.llvm.org/D3566

Files:
  lib/Target/Mips/MipsDelaySlotFiller.cpp
  lib/Target/Mips/MipsLongBranch.cpp
  lib/Target/Mips/MipsSEInstrInfo.cpp
  test/CodeGen/Mips/micromips-atomic.ll
  test/CodeGen/Mips/micromips-compact-branches.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3566.16505.patch
Type: text/x-patch
Size: 5519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141121/d097f247/attachment.bin>


More information about the llvm-commits mailing list