1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test
Luo, Yuanke b033502dd5 [X86] Selecting fld0 for undefined value in fast ISEL.
When set opt-bisect-limit to some value that is less than ISel pass
in command line and CurBisectNum expired, "DAG to DAG" pass lower
its opt level to O0. However "processimpdefs" and "X86 FP Stackifier"
is not stopped due to the CurBisectNum expiration. So undefined fp0
is generated. This cause crash in the "X86 FP Stackifier" pass,
because Stackifier doesn't expect any undefined fp value.

Here is the scenario that cause compiler crash.

  successors: %bb.26
  liveins: $r14
    ST_FPrr $st0, implicit-def $fpsw, implicit $fpcw
    renamable $rdi = MOV64ri @.str.3.16422
    renamable $rdx = LEA64r %stack.6, 1, $noreg, 0, $noreg
    ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def dead
    $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp
    dead $esi = MOV32r0 implicit-def dead $eflags, implicit-def $rsi
    CALL64pcrel32 @foo, implicit $rsp, implicit $ssp, implicit $rdi,
    implicit $rsi, implicit $rdx, implicit-def dead $fp0
    renamable $xmm0 = MOVSDrm_alt %stack.10, 1, $noreg, 0, $noreg :: (load 8
    from %stack.10)
    ADJCALLSTACKUP64 0, 0, implicit-def $rsp, implicit-def dead $eflags,
    implicit-def $ssp, implicit $rsp, implicit $ssp
    renamable $fp2 = CHS_Fp80 killed undef renamable $fp0, implicit-def
    $fpsw
    JMP_1 %bb.26
The CALL64pcrel32 mark fp0 dead, so llvm free the stack slot for fp0
and the stack become empty. In the late instruction CHS_Fp80, it use
undefined register fp0, the original code assume there must be a stack
slot for the src register (fp0) without respecting it is undefined,
so llvm report error.

We have some discussion in https://reviews.llvm.org/D104440 and we
decide to fix it in fast ISel. The fix is to lower undefined fp value to
zero value, so that it release the burden of "X86 FP Stackifier" pass.
Thank Craig for the suggestion and the initial patch to fix it.

Differential Revision: https://reviews.llvm.org/D104678
2021-06-26 08:43:09 +08:00
..
Analysis [SCEV] Support single-cond range check idiom in applyLoopGuards. 2021-06-25 10:24:40 +01:00
Assembler OpaquePtr: Reject 'ptr*' again when parsing textual IR 2021-06-25 15:18:44 -07:00
Bindings
Bitcode [BitcodeReader] Validate Strtab before accessing. 2021-06-22 14:52:16 +01:00
BugPoint
CodeGen [X86] Selecting fld0 for undefined value in fast ISEL. 2021-06-26 08:43:09 +08:00
DebugInfo [DebugInfo] Enable variadic debug value salvaging 2021-06-24 13:16:29 +01:00
Demangle [Demangle][Rust] Parse dot suffix 2021-06-18 09:29:45 +02:00
Examples
ExecutionEngine [JITLink][MachO] Add missing testcase. 2021-06-13 20:43:49 +10:00
Feature
FileCheck
Instrumentation [DFSan] Change shadow and origin memory layouts to match MSan. 2021-06-25 17:00:38 -07:00
Integer
JitListener
Linker [IR] convert warn-stack-size from module flag to fn attr 2021-06-21 15:09:25 -07:00
LTO LTO: Export functions referenced by non-canonical CFI jump tables 2021-06-08 14:57:43 -07:00
MachineVerifier
MC [SystemZ] Add support for .reloc assembler directive 2021-06-25 21:51:10 +02:00
Object [AMDGPU] Add gfx1035 target 2021-06-24 14:32:41 -04:00
ObjectYAML [WebAssembly] Rename event to tag 2021-06-17 20:34:19 -07:00
Other [OpaquePtr] Enumerate GlobalAlias value type 2021-06-25 21:21:10 +02:00
SafepointIRVerifier
Support
SymbolRewriter
TableGen [TableGen] Fix printing second PC-relative operand 2021-06-23 13:27:37 +07:00
ThinLTO/X86 [LTO] Support new PM in ThinLTOCodeGenerator. 2021-06-09 10:05:14 +01:00
tools [ms] [llvm-ml] Add support for ALIGN, EVEN, and ORG directives 2021-06-25 17:19:45 -04:00
Transforms Revert "[InstCombine] Make indexed compare fold opaque ptr compatible" 2021-06-26 00:32:59 +02:00
Unit
Verifier [OpaquePtr] Mangle intrinsics with opaque pointers arguments 2021-06-23 10:52:13 -07:00
YAMLParser
.clang-format
CMakeLists.txt [IRSim] Adding basic implementation of llvm-sim. 2021-06-23 14:38:58 -05:00
lit.cfg.py [IRSim] Adding basic implementation of llvm-sim. 2021-06-23 14:38:58 -05:00
lit.site.cfg.py.in Make lit configs relocatable again after c747b7d1d9a 2021-06-22 15:27:32 -04:00
TestRunner.sh