[Inline] Use poison instead of undef as placeholder [NFC]
authorNuno Lopes <nuno.lopes@tecnico.ulisboa.pt>
Sat, 22 Jul 2023 12:23:32 +0000 (13:23 +0100)
committerNuno Lopes <nuno.lopes@tecnico.ulisboa.pt>
Sat, 22 Jul 2023 12:23:40 +0000 (13:23 +0100)
llvm/lib/Transforms/Utils/InlineFunction.cpp

index 23144c0..f7b93fc 100644 (file)
@@ -2657,7 +2657,7 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
     if (!CB.use_empty()) {
       ReturnInst *R = Returns[0];
       if (&CB == R->getReturnValue())
-        CB.replaceAllUsesWith(UndefValue::get(CB.getType()));
+        CB.replaceAllUsesWith(PoisonValue::get(CB.getType()));
       else
         CB.replaceAllUsesWith(R->getReturnValue());
     }
@@ -2769,7 +2769,7 @@ llvm::InlineResult llvm::InlineFunction(CallBase &CB, InlineFunctionInfo &IFI,
     // using the return value of the call with the computed value.
     if (!CB.use_empty()) {
       if (&CB == Returns[0]->getReturnValue())
-        CB.replaceAllUsesWith(UndefValue::get(CB.getType()));
+        CB.replaceAllUsesWith(PoisonValue::get(CB.getType()));
       else
         CB.replaceAllUsesWith(Returns[0]->getReturnValue());
     }