Skip to content

Commit fb9e306

Browse files
committed
[FastISel] Pass the fneg input operand to hasTrivialKill in FastISel::selectFNeg.
We're trying to calculate the kill flag for OpReg which is the input so we need to pass the input here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360097 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent ccb55c7 commit fb9e306

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/CodeGen/SelectionDAG/FastISel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1719,7 +1719,7 @@ bool FastISel::selectFNeg(const User *I) {
17191719
unsigned OpReg = getRegForValue(X);
17201720
if (!OpReg)
17211721
return false;
1722-
bool OpRegIsKill = hasTrivialKill(I);
1722+
bool OpRegIsKill = hasTrivialKill(X);
17231723

17241724
// If the target has ISD::FNEG, use it.
17251725
EVT VT = TLI.getValueType(DL, I->getType());

test/CodeGen/X86/fast-isel-fneg-kill.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ define void @goo(double* %x, double* %y) nounwind {
99
; CHECK-NEXT: %[[REG1:.*]]:gr64 = COPY killed %[[REG0]]
1010
; CHECK-NEXT: %[[REG3:.*]]:gr64 = COPY killed %[[REG2]]
1111
; CHECK-NEXT: %[[REG10:.*]]:fr64 = MOVSDrm %[[REG1]], 1, $noreg, 0, $noreg :: (load 8 from %ir.x)
12-
; CHECK-NEXT: %[[REG6:.*]]:gr64 = MOVSDto64rr %[[REG10]]
12+
; CHECK-NEXT: %[[REG6:.*]]:gr64 = MOVSDto64rr killed %[[REG10]]
1313
; CHECK-NEXT: %[[REG7:.*]]:gr64 = MOV64ri -9223372036854775808
1414
; CHECK-NEXT: %[[REG8:.*]]:gr64 = XOR64rr killed %[[REG6]], %[[REG7]], implicit-def $eflags
1515
; CHECK-NEXT: %[[REG9:.*]]:fr64 = MOV64toSDrr killed %[[REG8]]

0 commit comments

Comments
 (0)