[llvm] e699b5d - [AArch64] isProfitableToHoist - remove nullptr test

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 25 03:32:49 PDT 2022


Author: Simon Pilgrim
Date: 2022-03-25T10:27:16Z
New Revision: e699b5da445207d0957839aad139ee62f31cb0f5

URL: https://github.com/llvm/llvm-project/commit/e699b5da445207d0957839aad139ee62f31cb0f5
DIFF: https://github.com/llvm/llvm-project/commit/e699b5da445207d0957839aad139ee62f31cb0f5.diff

LOG: [AArch64] isProfitableToHoist - remove nullptr test

User is dereferenced on the main codepath so the null test is likely superfluous

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index f2c51e1c68af5..cb8207edec11a 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -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;
 


        


More information about the llvm-commits mailing list