llvm-6502/test
Keno Fischer cc80af1b4f [FastIsel][X86] Fix invalid register replacement for bool args
Summary:
Consider the following IR:

  %3 = load i8* undef
  %4 = trunc i8 %3 to i1
  %5 = call %jl_value_t.0* @foo(..., i1 %4, ...)
  ret %jl_value_t.0* %5

Bools (that are the result of direct truncs) are lowered as whatever
the argument to the trunc was and a "and 1", causing the part of the
MBB responsible for this argument to look something like this:

  %vreg8<def,tied1> = AND8ri %vreg7<kill,tied0>, 1, %EFLAGS<imp-def>; GR8:%vreg8,%vreg7

Later, when the load is lowered, it will insert

  %vreg15<def> = MOV8rm %vreg14, 1, %noreg, 0, %noreg; mem:LD1[undef] GR8:%vreg15 GR64:%vreg14

but remember to (at the end of isel) replace vreg7 by vreg15. Now for
the bug. In fast isel lowering, we mistakenly mark vreg8 as the result
of the load instead of the trunc. This adds a fixup to have
vreg8 replaced by whatever the result of the load is as well, so
we end up with

  %vreg15<def,tied1> = AND8ri %vreg15<kill,tied0>, 1, %EFLAGS<imp-def>; GR8:%vreg15

which is an SSA violation and causes problems later down the road.

This fixes PR21557.

Test Plan: Test test case from PR21557 is added to the test suite.

Reviewers: ributzka

Reviewed By: ributzka

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6245

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224884 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-27 13:10:15 +00:00
..
Analysis IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
Assembler DebugInfo: Update testcase to actually check something 2014-12-16 07:08:19 +00:00
Bindings [OCaml] PR21901: Update tests. 2014-12-24 01:58:45 +00:00
Bitcode IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
BugPoint IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
CodeGen [FastIsel][X86] Fix invalid register replacement for bool args 2014-12-27 13:10:15 +00:00
DebugInfo Band-aid fix for PR22032: don't emit DWARF debug info if AddressSanitizer is enabled on Windows 2014-12-26 17:00:51 +00:00
ExecutionEngine Small model and JIT generally don't go well with each other. 2014-11-25 17:14:22 +00:00
Feature IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
FileCheck
Instrumentation [asan] change the coverage collection scheme so that we can easily emit coverage for the entire process as a single bit set, and if coverage_bitset=1 actually emit that bitset 2014-12-23 22:32:17 +00:00
Integer
JitListener IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
Linker Reapply "Linker: Drop superseded subprograms" 2014-12-18 01:05:33 +00:00
LTO llvm-lto: Add testing coverage for local contexts 2014-12-17 02:00:38 +00:00
MC Convert test to llvm-readobj. NFC. 2014-12-26 22:47:39 +00:00
Object [Object] Don't crash on empty export lists. 2014-12-19 02:31:01 +00:00
Other
SymbolRewriter Transform: add SymbolRewriter pass 2014-11-07 21:32:08 +00:00
TableGen
tools Add printing the LC_THREAD load commands with llvm-objdump’s -private-headers. 2014-12-23 22:56:39 +00:00
Transforms InstCombine: Infer nuw for multiplies 2014-12-26 09:50:35 +00:00
Unit
Verifier IR: Stop printing 'metadata' in Metadata::print() 2014-12-16 07:40:31 +00:00
YAMLParser
.clang-format
CMakeLists.txt Revert r224149, llvm-dsymutil was already here. 2014-12-12 21:25:07 +00:00
lit.cfg Teach lit.cfg to recognize -windows-gnu in addition to -mingw32. 2014-12-17 09:55:15 +00:00
lit.site.cfg.in
Makefile OCAMLFLAGS can contain =, don't use = with sed 2014-11-13 09:29:30 +00:00
Makefile.tests
TestRunner.sh