[PATCH] D108731: [TwoAddressInstructionPass] Improve the SrcRegMap and DstRegMap computation

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 27 19:32:11 PDT 2021


Carrot added inline comments.


================
Comment at: llvm/test/CodeGen/X86/avx512-regcall-NoMask.ll:1080
+; LINUXOSX64-NEXT:    addl %edi, %eax
 ; LINUXOSX64-NEXT:    popq %rbx
 ; LINUXOSX64-NEXT:    popq %rbp
----------------
craig.topper wrote:
> Is this test using a lot more leas now?
In this case there are many commutable instructions, with my code in findOnlyInterestingUse, more virtual registers can be mapped to %eax now, so more instructions can satisfy the last condition in isProfitableToConv3Addr

    return (ToRegA && !regsAreCompatible(FromRegB, ToRegA, TRI));

The difficult part in this test case is there are so many commutable instructions, and 11 physical registers are copied from, each commutable instruction generates two map from possibilities, the total number of possible map from relations is a huge number. Also almost every virtual register can map to the result %eax. But in our implementation of SrcRegMap and DstRegMap, for each virtual register there is only one mapped from/to register. Also there is no sophisticated algorithm to choose a good mapping, we simply process each instruction one by one and update the mapping. So it is difficult to find the best mapping to guide instruction commute and 3-address instruction conversion.


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

https://reviews.llvm.org/D108731



More information about the llvm-commits mailing list