[PATCH] D104440: [X86] Fix bug when X86 stackify pass handle one ArgFPRW.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 19 21:55:05 PDT 2021


craig.topper added a comment.

In D104440#2829188 <https://reviews.llvm.org/D104440#2829188>, @LuoYuanke wrote:

>> Did you run llvm-extract to isolate the broken function first? bugpoint is not good at that.
>
> Thanks Craig for the suggestion. After run "llvm-extract --recursive" and get the small file, I can't reproduce this issue. However I use -print-after-all to dump the IR of each pass. The undefine value is created in "processimpdefs" pass.
>
> From
>
>   bb.11 (%ir-block.61):
>   ; predecessors: %bb.10
>     successors: %bb.26
>   
>     %164:gr64 = MOV64ri @.str.3.16422
>     %165:gr32 = MOV32r0 implicit-def $eflags
>     %166:gr64 = SUBREG_TO_REG 0, %165:gr32, %subreg.sub_32bit
>     %167:gr64 = LEA64r %stack.6, 1, $noreg, 0, $noreg
>     ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp
>     $rdi = COPY %164:gr64
>     $rsi = COPY %166:gr64
>     $rdx = COPY %167:gr64
>     CALL64pcrel32 @_ZN5boost4math8policies20raise_overflow_errorIeNS1_6policyINS1_13promote_floatILb0EEENS1_14promote_doubleILb0EEENS1_14default_policyES8_S8_S8_S8_S8_S8_S8_S8_S8_S8_EEEET_PKcSC_RKT0_, <regmask $bh $bl $bp $bph $bpl $bx $ebp $ebx $hbp $hbx $rbp $rbx $r12 $r13 $r14 $r15 $r12b $r13b $r14b $r15b $r12bh $r13bh $r14bh $r15bh $r12d $r13d $r14d $r15d $r12w $r13w $r14w $r15w $r12wh and 3 more...>, implicit $rsp, implicit $ssp, implicit $rdi, implicit $rsi, implicit $rdx, implicit-def $fp0
>     ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp
>     %168:rfp80 = COPY $fp0
>     %162:rfp80 = IMPLICIT_DEF
>     %163:rfp80 = CHS_Fp80 %162:rfp80, implicit-def $fpsw
>     JMP_1 %bb.26
>
> To
>
>   bb.11 (%ir-block.61):
>   ; predecessors: %bb.10
>     successors: %bb.26
>   
>     %164:gr64 = MOV64ri @.str.3.16422
>     %165:gr32 = MOV32r0 implicit-def $eflags
>     %166:gr64 = SUBREG_TO_REG 0, %165:gr32, %subreg.sub_32bit
>     %167:gr64 = LEA64r %stack.6, 1, $noreg, 0, $noreg
>     ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp
>     $rdi = COPY %164:gr64
>     $rsi = COPY %166:gr64
>     $rdx = COPY %167:gr64
>     CALL64pcrel32 @_ZN5boost4math8policies20raise_overflow_errorIeNS1_6policyINS1_13promote_floatILb0EEENS1_14promote_doubleILb0EEENS1_14default_policyES8_S8_S8_S8_S8_S8_S8_S8_S8_S8_EEEET_PKcSC_RKT0_, <regmask $bh $bl $bp $bph $bpl $bx $ebp $ebx $hbp $hbx $rbp $rbx $r12 $r13 $r14 $r15 $r12b $r13b $r14b $r15b $r12bh $r13bh $r14bh $r15bh $r12d $r13d $r14d $r15d $r12w $r13w $r14w $r15w $r12wh and 3 more...>, implicit $rsp, implicit $ssp, implicit $rdi, implicit $rsi, implicit $rdx, implicit-def $fp0
>     ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp
>     %168:rfp80 = COPY $fp0
>     %163:rfp80 = CHS_Fp80 undef %162:rfp80, implicit-def $fpsw
>     JMP_1 %bb.26
>
> Is this transform reasonable? "%162:rfp80 = IMPLICIT_DEF" is generated in ISel. I will look into why "%162:rfp80 = IMPLICIT_DEF" is generated.

I don’t know what llvm-extract —recursive does. I’ve only used -func to extract a single function I knew caused a compiler crash.

Converting IMPLICIT_DEF to undef flag is correct.

IMPLICIT_DEF can get created from ISD::UNDEF but as far I could see ISD::UNDEF for fp80 is supposed to Expand to ConstantFP 0


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104440



More information about the llvm-commits mailing list