For some project, I need to remove some addressing modes of operands in IMUL and ADD instructions. More specifically, I do not want LLVM to generate instruction like:
imull (%r9,%r11), %r15d
Instead I will like LLVM to generate code which first loads address into a register and then multiply it, i.e., something like:
movl (%r9, %r11), %r10d
imull %r10d, %r15d
I have remove all IMUL64rm and IMUL64rmi instructions in Target/X86/X86InstrArithmetic.td, but still imull instruction with memory operand is generated. Can anyone please point me to the write place?
I will prefer a solution related to llvm6.0, however, solution for any llvm version is welcome.