[PATCH] D30590: Don't assume cleanup emission preserves dominance in expr evaluation

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 6 14:00:06 PST 2017


rnk added inline comments.


================
Comment at: lib/CodeGen/CGExprComplex.cpp:204-206
+    Scope.ensureDominatingValue(&Vals.first);
+    Scope.ensureDominatingValue(&Vals.second);
+    Scope.ForceCleanup();
----------------
rsmith wrote:
> I'm a little concerned about the loose connection between `ensureDominatingValue` and `ForrceCleanup` here -- if you forget the `ForceCleanup`, you get silent misbehavior. How about removing `ensureDominatingValue` and instead passing a `std::initializer_list<Value**>` to `ForceCleanup`?
Done.


================
Comment at: lib/CodeGen/CodeGenFunction.h:539
   private:
+    SmallVector<llvm::Value **, 1> ValuesToReload;
 
----------------
rsmith wrote:
> If you keep a `SmallVector` here, set its inline size to 2 to avoid allocations for the `_Complex` case.
I removed it. Also, who wants to waste a whole pointer of stack space for _Complex expression evaluation. ;)


https://reviews.llvm.org/D30590





More information about the cfe-commits mailing list