llvm-6502/test
Jingyue Wu e08f05f3a5 [NVPTX] expand extload/truncstore for vectors of floats
Summary:
According to PTX ISA:

For convenience, ld, st, and cvt instructions permit source and destination data operands to be wider than the instruction-type size, so that narrow values may be loaded, stored, and converted using regular-width registers. For example, 8-bit or 16-bit values may be held directly in 32-bit or 64-bit registers when being loaded, stored, or converted to other types and sizes. The operand type checking rules are relaxed for bit-size and integer (signed and unsigned) instruction types; floating-point instruction types still require that the operand type-size matches exactly, unless the operand is of bit-size type.

So, the ISA does not support load with extending/store with truncatation for floating numbers. This is reflected in setting the loadext/truncstore actions to expand in the code for floating numbers, but vectors of floating numbers are not taken care of.

As a result, loading a vector of floats followed by a fp_extend may be combined by DAGCombiner to a extload, and the extload may be lowered to NVPTXISD::LoadV2 with extending information. However, NVPTXISD::LoadV2 does not perform extending, and no extending instructions are inserted. Finally, PTX instructions with mismatched types are generated, like
ld.v2.f32 {%fd3, %fd4}, [%rd2]

This patch adds the correct actions for vectors of floats, so DAGCombiner would not create loads with extending, and correct code is generated.

Patched by Gang Hu. 

Test Plan: Test case attached.

Reviewers: jingyue

Reviewed By: jingyue

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241191 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 21:32:42 +00:00
..
Analysis [LAA] Try to prove non-wrapping of pointers if SCEV cannot 2015-06-26 17:25:43 +00:00
Assembler Add a DIModule metadata node to the IR. 2015-06-29 23:03:47 +00:00
Bindings test: Move target dependent test in their own folder for c API test 2015-06-23 06:46:54 +00:00
Bitcode Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
BugPoint
CodeGen [NVPTX] expand extload/truncstore for vectors of floats 2015-07-01 21:32:42 +00:00
DebugInfo Revert "[DWARF] Fix debug info generation for function static variables, typedefs, and records" 2015-07-01 18:07:16 +00:00
ExecutionEngine Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
Feature Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
FileCheck
Instrumentation [SanitizerCoverage] Don't add instrumentation to unreachable blocks. 2015-06-30 23:11:45 +00:00
Integer
JitListener
LibDriver Use correct escaping for semicolon on Windows. 2015-06-20 01:28:20 +00:00
Linker Linker: Do not expect comdat to exist in source module. 2015-06-22 21:46:51 +00:00
LTO Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
MC [AArch64] Implement add/adds/sub/subs/cmp/cmn with negative immediate aliases 2015-07-01 15:05:58 +00:00
Object Return ErrorOr from getSection. 2015-07-01 12:56:27 +00:00
Other Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
SymbolRewriter
TableGen
tools Pass -m to the linker in this test. 2015-06-23 18:04:54 +00:00
Transforms [LoopUnroll] Use undef for phis with no value live 2015-07-01 05:38:07 +00:00
Unit
Verifier Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
YAMLParser
.clang-format
CMakeLists.txt LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00
lit.cfg LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00
lit.site.cfg.in
Makefile
Makefile.tests
TestRunner.sh