OSDN Git Service

[FastISel] Pass the fneg input operand to hasTrivialKill in FastISel::selectFNeg.
authorCraig Topper <craig.topper@intel.com>
Mon, 6 May 2019 23:09:09 +0000 (23:09 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 6 May 2019 23:09:09 +0000 (23:09 +0000)
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

lib/CodeGen/SelectionDAG/FastISel.cpp
test/CodeGen/X86/fast-isel-fneg-kill.ll

index fb607bb..a6212aa 100644 (file)
@@ -1719,7 +1719,7 @@ bool FastISel::selectFNeg(const User *I) {
   unsigned OpReg = getRegForValue(X);
   if (!OpReg)
     return false;
-  bool OpRegIsKill = hasTrivialKill(I);
+  bool OpRegIsKill = hasTrivialKill(X);
 
   // If the target has ISD::FNEG, use it.
   EVT VT = TLI.getValueType(DL, I->getType());
index d383601..d1d3ce7 100644 (file)
@@ -9,7 +9,7 @@ define void @goo(double* %x, double* %y) nounwind {
 ; CHECK-NEXT: %[[REG1:.*]]:gr64 = COPY killed %[[REG0]]
 ; CHECK-NEXT: %[[REG3:.*]]:gr64 = COPY killed %[[REG2]]
 ; CHECK-NEXT: %[[REG10:.*]]:fr64 = MOVSDrm %[[REG1]], 1, $noreg, 0, $noreg :: (load 8 from %ir.x)
-; CHECK-NEXT: %[[REG6:.*]]:gr64 = MOVSDto64rr %[[REG10]]
+; CHECK-NEXT: %[[REG6:.*]]:gr64 = MOVSDto64rr killed %[[REG10]]
 ; CHECK-NEXT: %[[REG7:.*]]:gr64 = MOV64ri -9223372036854775808
 ; CHECK-NEXT: %[[REG8:.*]]:gr64 = XOR64rr killed %[[REG6]], %[[REG7]], implicit-def $eflags
 ; CHECK-NEXT: %[[REG9:.*]]:fr64 = MOV64toSDrr killed %[[REG8]]