[clang] [ExtendLifetimes] Add extend lifetimes to emit fake uses from clang (PR #106724)

Paul T Robinson via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 09:32:43 PDT 2024


================
@@ -3558,15 +3562,26 @@ static llvm::StoreInst *findDominatingStoreToReturnValue(CodeGenFunction &CGF) {
     llvm::BasicBlock *IP = CGF.Builder.GetInsertBlock();
     if (IP->empty()) return nullptr;
 
-    // Look at directly preceding instruction, skipping bitcasts and lifetime
-    // markers.
+    // Look at directly preceding instruction, skipping bitcasts, lifetime
+    // markers, and fake uses and their operands.
+    const llvm::Instruction *LoadIntoFakeUse = nullptr;
     for (llvm::Instruction &I : make_range(IP->rbegin(), IP->rend())) {
+      // Ignore instructions are just loads for fake uses; the load should
----------------
pogo59 wrote:

```suggestion
      // Ignore instructions that are just loads for fake uses; the load should
```
? 

https://github.com/llvm/llvm-project/pull/106724


More information about the cfe-commits mailing list