forked from OSchip/llvm-project
[GVN] Add support for unary FNeg to GVN pass
Differential Revision: https://reviews.llvm.org/D63896 llvm-svn: 364592
This commit is contained in:
parent
8007ff1ab1
commit
6e62a796d5
|
@ -492,6 +492,7 @@ uint32_t GVN::ValueTable::lookupOrAdd(Value *V) {
|
|||
switch (I->getOpcode()) {
|
||||
case Instruction::Call:
|
||||
return lookupOrAddCall(cast<CallInst>(I));
|
||||
case Instruction::FNeg:
|
||||
case Instruction::Add:
|
||||
case Instruction::FAdd:
|
||||
case Instruction::Sub:
|
||||
|
|
|
@ -43,9 +43,8 @@ define double @test4(double %x, double %y) {
|
|||
|
||||
define double @test5(double %x, double %y) {
|
||||
; CHECK: @test5(double %x, double %y)
|
||||
; CHECK: %neg1 = fneg double %x, !fpmath !0
|
||||
; CHECK: %neg2 = fneg double %x, !fpmath !1
|
||||
; CHECK: %foo = fadd double %neg1, %neg2
|
||||
; CHECK: %neg1 = fneg double %x, !fpmath !1
|
||||
; CHECK: %foo = fadd double %neg1, %neg1
|
||||
%neg1 = fneg double %x, !fpmath !0
|
||||
%neg2 = fneg double %x, !fpmath !1
|
||||
%foo = fadd double %neg1, %neg2
|
||||
|
|
Loading…
Reference in New Issue