[llvm] 1b7285b - [X86FastISel] Avoid ConstantExpr::getZExt() (NFC)
    Nikita Popov via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Sep 28 07:08:18 PDT 2023
    
    
  
Author: Nikita Popov
Date: 2023-09-28T16:06:24+02:00
New Revision: 1b7285bf3ee73975fa63acfc5301a9b57a53fca2
URL: https://github.com/llvm/llvm-project/commit/1b7285bf3ee73975fa63acfc5301a9b57a53fca2
DIFF: https://github.com/llvm/llvm-project/commit/1b7285bf3ee73975fa63acfc5301a9b57a53fca2.diff
LOG: [X86FastISel] Avoid ConstantExpr::getZExt() (NFC)
Work on APInt instead.
Added: 
    
Modified: 
    llvm/lib/Target/X86/X86FastISel.cpp
Removed: 
    
################################################################################
diff  --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index 04822fc6ecbee62..f60b7e74ce6e811 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/lib/Target/X86/X86FastISel.cpp
@@ -3284,9 +3284,9 @@ bool X86FastISel::fastLowerCall(CallLoweringInfo &CLI) {
     if (auto *CI = dyn_cast<ConstantInt>(Val)) {
       if (CI->getBitWidth() < 32) {
         if (Flags.isSExt())
-          Val = ConstantExpr::getSExt(CI, Type::getInt32Ty(CI->getContext()));
+          Val = ConstantInt::get(CI->getContext(), CI->getValue().sext(32));
         else
-          Val = ConstantExpr::getZExt(CI, Type::getInt32Ty(CI->getContext()));
+          Val = ConstantInt::get(CI->getContext(), CI->getValue().zext(32));
       }
     }
 
        
    
    
More information about the llvm-commits
mailing list