Error in generating Object Code for implemented assembly vector instructions

i want to emit binary code for the following implemented vector assembly
instructions.
P_256B_LOAD_DWORD R_0_R2048b_0, pword ptr [rip + b]
P_256B_LOAD_DWORD R_0_R2048b_1, pword ptr [rip + c]
P_256B_VADD R_0_R2048b_0, R_0_R2048b_1, R_0_R2048b_0
P_256B_STORE_DWORD pword ptr [rip + a], R_0_R2048b_0

I added the following lines in X86MCInstLower.cpp;
unsigned NewOpc;
      switch (OutMI.getOpcode()) {
      default: llvm_unreachable("Invalid opcode");
      case X86::P_256B_LOAD_DWORD: NewOpc = X86::P_256B_LOAD_DWORD;
break;
      case X86::P_256B_STORE_DWORD: NewOpc = X86::P_256B_STORE_DWORD;
break;
      case X86::P_256B_VADD: NewOpc = X86::P_256B_VADD; break;
      }
      OutMI.setOpcode(NewOpc);
    break;

when i used the command:

llc -x86-asm-syntax=intel -debug -p-enabled=true -filetype=obj
sum-vec03.ll>objpon 2>&1
i am getting the following error:

********** COMPUTING STACKMAP LIVENESS: foo **********
Unknown immediate size
UNREACHABLE executed at lib/Target/X86/MCTargetDesc/X86BaseInfo.h:574!
#0 0x00000000019d9fec llvm::sys::PrintStackTrace(llvm::raw_ostream&)
lib/Support/Unix/Signals.inc:402:11
#1 0x00000000019da4d9 PrintStackTraceSignalHandler(void*)
lib/Support/Unix/Signals.inc:466:1
#2 0x00000000019d8853 llvm::sys::RunSignalHandlers()
lib/Support/Signals.cpp:0:5
#3 0x00000000019da834 SignalHandler(int) lib/Support/Unix/Signals.inc:256:1
#4 0x00007f2f2be14d10 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10d10)
#5 0x00007f2f2adc2267 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35267)
#6 0x00007f2f2adc3eca abort (/lib/x86_64-linux-gnu/libc.so.6+0x36eca)
#7 0x000000000195f6c0 LLVMInstallFatalErrorHandler
lib/Support/ErrorHandling.cpp:133:0
#8 0x0000000000c08966 llvm::X86II::getSizeOfImm(unsigned long)
lib/Target/X86/MCTargetDesc/X86BaseInfo.h:577:29
#9 0x0000000000c04c2a (anonymous
namespace)::X86MCCodeEmitter::encodeInstruction(llvm::MCInst const&,
llvm::raw_ostream&, llvm::SmallVectorImpl<llvm::MCFixup>&,
llvm::MCSubtargetInfo const&) const
lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp:1512:67
#10 0x00000000015884b3 llvm::MCELFStreamer::EmitInstToData(llvm::MCInst
const&, llvm::MCSubtargetInfo const&) lib/MC/MCELFStreamer.cpp:478:26
#11 0x00000000015aadc0 llvm::MCObjectStreamer::EmitInstruction(llvm::MCInst
const&, llvm::MCSubtargetInfo const&) lib/MC/MCObjectStreamer.cpp:245:5
#12 0x00000000007a036b
llvm::X86AsmPrinter::EmitAndCountInstruction(llvm::MCInst&)
lib/Target/X86/X86MCInstLower.cpp:106:3
#13 0x00000000007a32dc
llvm::X86AsmPrinter::EmitInstruction(llvm::MachineInstr const*)
lib/Target/X86/X86MCInstLower.cpp:1849:1
#14 0x0000000000dde226 llvm::AsmPrinter::EmitFunctionBody()
lib/CodeGen/AsmPrinter/AsmPrinter.cpp:943:11
#15 0x0000000000796e81
llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&)
lib/Target/X86/X86AsmPrinter.cpp:73:3
#16 0x000000000104d441
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
lib/CodeGen/MachineFunctionPass.cpp:62:8
#17 0x00000000014766bf llvm::FPPassManager::runOnFunction(llvm::Function&)
lib/IR/LegacyPassManager.cpp:1513:27
#18 0x00000000014769d5 llvm::FPPassManager::runOnModule(llvm::Module&)
lib/IR/LegacyPassManager.cpp:1534:16
#19 0x000000000147716a (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
lib/IR/LegacyPassManager.cpp:1590:27
#20 0x0000000001476c96 llvm::legacy::PassManagerImpl::run(llvm::Module&)
lib/IR/LegacyPassManager.cpp:1693:16
#21 0x0000000001477681 llvm::legacy::PassManager::run(llvm::Module&)
lib/IR/LegacyPassManager.cpp:1724:3
#22 0x000000000076bbde compileModule(char**, llvm::LLVMContext&)
tools/llc/llc.cpp:530:42
#23 0x000000000076a0c9 main tools/llc/llc.cpp:285:13
#24 0x00007f2f2adada40 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x20a40)
#25 0x0000000000769b99 _start (/bin/llc+0x769b99)
Stack dump:
0. Program arguments: /bin/llc -x86-asm-syntax=intel -debug
-pim-enabled=true -filetype=obj sum-vec03.ll
1. Running pass 'Function Pass Manager' on module 'sum-vec03.ll'.
2. Running pass 'X86 Assembly Printer' on function '@foo'

what to do now? I am stuck here. Please help.

Please help. How to resolve above mentioned issues.

Hi Ahmed,

Please help. How to resolve above mentioned issues.

Pinging a question after 10 hours is not good practice in LLVM. The
developer policy (LLVM Developer Policy — LLVM 18.0.0git documentation)
suggests roughly weekly for patches, and I see no reason questions on
llvm-dev should be any different.

In general, if I can be blunt, I don't get the impression you try to
solve your issues independently before asking here. From what I can
see your first reaction on seeing an error is to ask on this list what
code needs to be modified to fix your problem.

We understand that you're probably new to this code, but virtually
everyone responding here is doing it either in their own time or at
best with an employer's "engage with OSS" blessing. You're going to
get a lot more positive responses if you appear to have investigated
obvious possibilities and actually debugged code before asking for a
quick fix. You should describe what you've done to work out where the
source of the error is, and give specific details on why you're stuck
here.

We really want to help, but we're inevitably going to prioritise
questions that suggest someone is going to become a useful part of the
LLVM community. Independent thinking is a big part of that (at least
for me).

Cheers.

Tim.

ok. you have got a wrong impression. i am trying to solve it myself as well. its just this that i find difficulty in reaching the start point of binary code generation as there are no .td files involved in this which means i have to make changes in .cpp directly. now i am looking where the specific encoding for x86 is implemented in these files. once i get that, then i won’t trouble people more i guess. Also, before asking question i used to check the llvm group to see whether someone has asked it before because there is no good help on google or other forums. no such tutorial either.

Thank you.