[AArch64] isProfitableToHoist - remove nullptr test
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 25 Mar 2022 10:27:16 +0000 (10:27 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 25 Mar 2022 10:27:16 +0000 (10:27 +0000)
User is dereferenced on the main codepath so the null test is likely superfluous

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

index f2c51e1..cb8207e 100644 (file)
@@ -12176,8 +12176,7 @@ bool AArch64TargetLowering::isProfitableToHoist(Instruction *I) const {
 
   Instruction *User = I->user_back();
 
-  if (User &&
-      !(User->getOpcode() == Instruction::FSub ||
+  if (!(User->getOpcode() == Instruction::FSub ||
         User->getOpcode() == Instruction::FAdd))
     return true;