hanchenye-llvm-project/llvm
Sanjay Patel e5606b4fa5 [ConstantFold] fp_binop AnyConstant, undef --> NaN
With the updated LangRef ( D44216 / rL327138 ) in place, we can proceed with more constant folding.

I'm intentionally taking the conservative path here: no matter what the constant or the FMF, we can 
always fold to NaN. This is because the undef operand can be chosen as NaN, and in our simplified 
default FP env, nothing else happens - NaN just propagates to the result. If we find some way/need 
to propagate undef instead, that can be added subsequently.

The tests show that we always choose the same quiet NaN constant (0x7FF8000000000000 in IR text). 
There were suggestions to improve that with a 'NaN' string token or not always print a 64-bit hex 
value, but those are independent changes. We might also consider setting/propagating the payload of 
NaN constants as an enhancement.

Differential Revision: https://reviews.llvm.org/D44308

llvm-svn: 327208
2018-03-10 15:56:25 +00:00
..
bindings Because of CVE-2018-6574, some compiler options and linker options are restricted to prevent arbitrary code execution. 2018-02-23 20:12:24 +00:00
cmake [cmake] Append -Wl,-rpath-link conditionally to GNULD 2018-03-08 15:09:38 +00:00
docs [LangRef] make it clear that FP instructions do not have side effects 2018-03-09 15:27:48 +00:00
examples [ORC] Consolidate RTDyldObjectLinkingLayer GetMemMgr and GetResolver into a 2018-02-14 22:13:02 +00:00
include [WebAssembly] Object: Add accessor for wasm symbols 2018-03-10 05:34:04 +00:00
lib [ConstantFold] fp_binop AnyConstant, undef --> NaN 2018-03-10 15:56:25 +00:00
projects
resources
runtimes
test [ConstantFold] fp_binop AnyConstant, undef --> NaN 2018-03-10 15:56:25 +00:00
tools [llvm-objdump] Support disassembling by symbol name 2018-03-09 19:13:44 +00:00
unittests [GISel]: Add helpers for easy building G_FCONSTANT along with matchers 2018-03-09 17:31:51 +00:00
utils utils: add a helper class to lit for captured substitutions 2018-03-09 00:06:10 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt build: add the ability to create a symlink for dsymutil 2018-02-28 23:00:50 +00:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.