OSDN Git Service

InstCombine: fix fold "fcmp x, undef" to account for NaN
authorMehdi Amini <mehdi.amini@apple.com>
Mon, 9 Mar 2015 03:20:25 +0000 (03:20 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Mon, 9 Mar 2015 03:20:25 +0000 (03:20 +0000)
commit4c8f5afd99a18ab81efe12b1fb26b150728a332d
treeb166933d506a063e0c9f52a2a855578ef8d2aec6
parent9bfcfff05b8ae72bb837eb898fbc6e56d55fd6c3
InstCombine: fix fold "fcmp x, undef" to account for NaN

Summary:
See the two test cases.

; Can fold fcmp with undef on one side by choosing NaN for the undef

; Can fold fcmp with undef on both side
;   fcmp u_pred undef, undef -> true
;   fcmp o_pred undef, undef -> false
; because whatever you choose for the first undef
; you can choose NaN for the other undef

Reviewers: hfinkel, chandlerc, majnemer

Reviewed By: majnemer

Subscribers: majnemer, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231626 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Instructions.h
lib/Analysis/InstructionSimplify.cpp
lib/IR/ConstantFold.cpp
test/Transforms/InstCombine/fcmp.ll