[PATCH] D149743: [RISCV][CodeGen] Support Zdinx on RV32 codegen

Liao Chunyu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 5 20:31:38 PDT 2023


liaolucy added a comment.

In D149743#4323739 <https://reviews.llvm.org/D149743#4323739>, @craig.topper wrote:

> In D149743#4323730 <https://reviews.llvm.org/D149743#4323730>, @craig.topper wrote:
>
>> In D149743#4323729 <https://reviews.llvm.org/D149743#4323729>, @liaolucy wrote:
>>
>>> Maybe we shouldn't expand the Pseudo in RISCVExpandPseudoInsts.cpp.
>>> It seems that one more MI would get the following error.
>>>
>>>   llc: /home/liaochunyu/llvm-project/llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp:83: virtual bool (anonymous namespace)::RISCVExpandPseudo::runOnMachineFunction(llvm::MachineFunction &): Assertion `OldSize >= NewSize' failed.
>>
>> That error means you're missing a `let Size = 8` on the pseudo in tablegen.
>
> Maybe I don’t know you meant by one more MI



In D149743#4323739 <https://reviews.llvm.org/D149743#4323739>, @craig.topper wrote:

> In D149743#4323730 <https://reviews.llvm.org/D149743#4323730>, @craig.topper wrote:
>
>> In D149743#4323729 <https://reviews.llvm.org/D149743#4323729>, @liaolucy wrote:
>>
>>> Maybe we shouldn't expand the Pseudo in RISCVExpandPseudoInsts.cpp.
>>> It seems that one more MI would get the following error.
>>>
>>>   llc: /home/liaochunyu/llvm-project/llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp:83: virtual bool (anonymous namespace)::RISCVExpandPseudo::runOnMachineFunction(llvm::MachineFunction &): Assertion `OldSize >= NewSize' failed.
>>
>> That error means you're missing a `let Size = 8` on the pseudo in tablegen.
>
> Maybe I don’t know you meant by one more MI

One more ADDI than before.

  else {
      Register TmpReg = MBBI->getOperand(1).getReg();
     BuildMI(MBB, MBBI, DL, TII->get(RISCV::ADDI), TmpReg)
          .add(MBBI->getOperand(1))
          .addImm(4);
     BuildMI(MBB, MBBI, DL, TII->get(RISCV::SW))
         .addReg(Hi, getKillRegState(MBBI->getOperand(0).isKill()))
         .add(MBBI->getOperand(1))
         .add(MBBI->getOperand(2));
   }

but the test fail:

  define void @foo(ptr nocapture %p, double %d) {                                                                                          
  entry:                                                                           
    %a = fadd double %d, %d                                                        
    %add.ptr = getelementptr inbounds i8, ptr %p, i64 2044                         
    store double %a, ptr %add.ptr, align 8                                         
    ret void                                                                       
  }

Guess it's because of  add  `one more MI`.

It suddenly occurred to me that might not be a problem with size. Maybe my global didn't handle it well, then has this error,thanks, thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149743/new/

https://reviews.llvm.org/D149743



More information about the llvm-commits mailing list