[PATCH] Add an inalloca flag to allocas
Reid Kleckner
rnk at google.com
Fri Jan 17 16:03:38 PST 2014
Thanks!
================
Comment at: docs/LangRef.rst:734
@@ +733,3 @@
+ The alloca, or argument allocation, must also be tagged with the
+ inalloca keyword. Only the past argument may have the ``inalloca``
+ attribute, and that argument is guaranteed to be passed in memory.
----------------
David Majnemer wrote:
> Should "past" be "last" instead?
woops, yeah.
================
Comment at: include/llvm/IR/Instructions.h:104
@@ -103,3 +103,3 @@
unsigned getAlignment() const {
- return (1u << getSubclassDataFromInstruction()) >> 1;
+ return (1u << (getSubclassDataFromInstruction() & 31)) >> 1;
}
----------------
David Majnemer wrote:
> This is fine because we don't support alignments larger than 536870912 (which would leave us with bits 30 and 31 free).
>
> I would have an assert relating with Value::MaximumAlignment.
There's an assert in setAlignment that it round trips after masking and shifting, so I'm happy with that.
http://llvm-reviews.chandlerc.com/D2571
BRANCH
inalloca
ARCANIST PROJECT
llvm
More information about the llvm-commits
mailing list