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
Assembler
Bindings [OCaml] PR21901: Update tests. 2014-12-24 01:58:45 +00:00
Bitcode
BugPoint
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
Feature
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
Linker
LTO
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
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
YAMLParser
.clang-format
CMakeLists.txt
lit.cfg
lit.site.cfg.in
Makefile
Makefile.tests
TestRunner.sh