File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed 
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -4220,19 +4220,19 @@ void llvm::maybeMarkSanitizerLibraryCallNoBuiltin(
42204220}
42214221
42224222bool  llvm::canReplaceOperandWithVariable (const  Instruction *I, unsigned  OpIdx) {
4223+   const  auto  *Op = I->getOperand (OpIdx);
42234224  //  We can't have a PHI with a metadata type.
4224-   if  (I-> getOperand (OpIdx) ->getType ()->isMetadataTy ())
4225+   if  (Op ->getType ()->isMetadataTy ())
42254226    return  false ;
42264227
42274228  //  swifterror pointers can only be used by a load, store, or as a swifterror
42284229  //  argument; swifterror pointers are not allowed to be used in select or phi
42294230  //  instructions.
4230-   if  (OpIdx < I->getNumOperands ())
4231-     if  (I->getOperand (OpIdx)->isSwiftError ())
4232-       return  false ;
4231+   if  (Op->isSwiftError ())
4232+     return  false ;
42334233
42344234  //  Early exit.
4235-   if  (!isa<Constant, InlineAsm>(I-> getOperand (OpIdx) ))
4235+   if  (!isa<Constant, InlineAsm>(Op ))
42364236    return  true ;
42374237
42384238  switch  (I->getOpcode ()) {
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments