[PATCH] [CodeGen] Reuse stack space from unused function results (with more accurate unused result detection)
Reid Kleckner
rnk at google.com
Thu Jun 4 17:18:38 PDT 2015
REPOSITORY
rL LLVM
================
Comment at: lib/CodeGen/CGCall.h:158-159
@@ -157,3 +157,4 @@
class ReturnValueSlot {
llvm::PointerIntPair<llvm::Value *, 1, bool> Value;
+ bool IsUnused = false;
----------------
There's another low alignment bit here, you should really fold it in here to keep this thing pointer-sized. You can either nest PointerIntPair<> twice or use `PointerIntPair<llvm::Value *, 2, unsigned>` Value and then do bitwise arithmetic in the helpers.
================
Comment at: lib/CodeGen/CGExprAgg.cpp:65
@@ -63,4 +64,3 @@
public:
- AggExprEmitter(CodeGenFunction &cgf, AggValueSlot Dest)
- : CGF(cgf), Builder(CGF.Builder), Dest(Dest) {
- }
+ AggExprEmitter(CodeGenFunction &cgf, AggValueSlot Dest, bool isResultUnused)
+ : CGF(cgf), Builder(CGF.Builder), Dest(Dest),
----------------
You can follow the convention for Dest and name the parameter after the member with the same case. It's correct.
http://reviews.llvm.org/D10042
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list