llvm-project/llvm/test
Andrea Di Biagio 2905999c22 [ConstantFolding] Fix wrong folding of intrinsic 'convert.from.fp16'.
Function 'ConstantFoldScalarCall' (in ConstantFolding.cpp) works under the
wrong assumption that a call to 'convert.from.fp16' returns a value of
type 'float'.
However, intrinsic 'convert.from.fp16' can be overloaded; for example, we
can call 'convert.from.fp16.f64' to convert from half to double; etc.

Before this patch, the following example would have triggered an assertion
failure in opt (with -constprop):

```
define double @foo() {
entry:
  %0 = call double @llvm.convert.from.fp16.f64(i16 0)
  ret double %0
}
```

This patch fixes the problem in ConstantFolding.cpp. When folding a call to
convert.from.fp16, we perform a different kind of conversion based on the call
return type.

Added test 'Transform/ConstProp/convert-from-fp16.ll'.

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

llvm-svn: 237377
2015-05-14 18:01:48 +00:00
..
Analysis [Statepoints] Support for "patchable" statepoints. 2015-05-12 23:52:24 +00:00
Assembler IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
Bindings IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
Bitcode Bitcode: Set LastDL after writing DebugLocs 2015-05-06 22:51:12 +00:00
BugPoint IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
CodeGen [Hexagon] Remove dead constant assignment in hardware loop pass 2015-05-14 17:31:40 +00:00
DebugInfo [DebugInfo] Debug locations for constant SD nodes 2015-05-13 08:58:03 +00:00
ExecutionEngine [Orc] Reapply r236465 with fixes for the MSVC bots. 2015-05-05 17:37:18 +00:00
Feature [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
FileCheck FileCheck: Add CHECK-SAME 2015-02-26 04:53:00 +00:00
Instrumentation Changed renaming of local symbols by inserting a dot vefore the numeric suffix. 2015-05-12 16:47:30 +00:00
Integer [opaque pointer type] Add textual IR support for explicit type parameter to the call instruction 2015-04-16 23:24:18 +00:00
JitListener IR: Give 'DI' prefix to debug info metadata 2015-04-29 16:38:44 +00:00
LTO Revert changes to LTO test case since llvm-lto can't handle textual IR inputs 2015-04-24 18:13:27 +00:00
Linker Changed renaming of local symbols by inserting a dot vefore the numeric suffix. 2015-05-12 16:47:30 +00:00
MC [mips] [IAS] Enforce .set nomacro. 2015-05-14 14:51:32 +00:00
Object [llvm-readobj/obj2yaml/yaml2obj] Support MIPS machine ELF header flags 2015-05-08 07:04:59 +00:00
Other Let llc and opt override "-target-cpu" and "-target-features" via command line 2015-05-06 23:54:14 +00:00
SymbolRewriter
TableGen Reverting r237234, "Use std::bitset for SubtargetFeatures" 2015-05-13 10:28:46 +00:00
Transforms [ConstantFolding] Fix wrong folding of intrinsic 'convert.from.fp16'. 2015-05-14 18:01:48 +00:00
Unit
Verifier Add function entry count metadata. 2015-05-13 15:13:45 +00:00
YAMLParser YAML: Implement block scalar parsing. 2015-05-13 23:10:51 +00:00
tools InstrProf: Fix display of large numbers in llvm-cov 2015-05-13 22:41:48 +00:00
.clang-format
CMakeLists.txt Remove duplicate cmake target I added in r236792. 2015-05-08 16:59:53 +00:00
Makefile test: Make a start on a test suite for libLTO. 2015-03-19 23:55:38 +00:00
Makefile.tests
TestRunner.sh
lit.cfg Add yaml-bench to the list of tools make check needs to run 2015-05-07 22:53:11 +00:00
lit.site.cfg.in test: Make a start on a test suite for libLTO. 2015-03-19 23:55:38 +00:00