]> granicus.if.org Git - llvm/commit
[AMDGPU] Avoid DAG combining assert with fneg(fadd(A,0))
authorTim Renouf <tpr.llvm@botech.co.uk>
Thu, 18 Apr 2019 05:27:01 +0000 (05:27 +0000)
committerTim Renouf <tpr.llvm@botech.co.uk>
Thu, 18 Apr 2019 05:27:01 +0000 (05:27 +0000)
commitfed299e82d6d20d93860a792d40e52ca0c3e3347
tree9d51a77ba99ca39cc7b948eca5bea26dc14f5691
parentaac8ffb5ffa2efd09c0aeb89c0f0d1b6a0f13f75
[AMDGPU] Avoid DAG combining assert with fneg(fadd(A,0))

fneg combining attempts to turn it into fadd(fneg(A), fneg(0)), but
creating the new fadd folds to just fneg(A). When A has multiple uses,
this confuses it and you get an assert. Fixed.

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

Change-Id: I0ddc9b7286abe78edc0cd8d734fdeb05ff09821c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358640 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
test/CodeGen/AMDGPU/fneg-combines.ll