Age | Commit message (Collapse) | Author |
|
reader/writer, since they can't appear in PNaCl bitcode.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3590
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/20172002
|
|
Modifies PNaCl bitcode reader/writer to accept PNaClVersion=1 as supported,
and all other versions are unsupported and unreadable. The PNaCl bitcode
reader/writer will generate appropriate messages (including what version
is unsupported if applicable).
Also allows command-line option --pnacl-version for setting the PNaClVersion
in the PNaCl bitcode writer.
Also fixes some problems on PNaCl bitcode headers, using common support to
determine when the read/written PNaCl bitcode file is valid.
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/19400002
|
|
Fix printing of instructions/constants to explicitly check on cast opcodes
and binary operators, so that we don't accidentally allow unknown opcodes.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3570
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/19242003
|
|
Remove dead code for:
(1) Top-level inline assembly.
(2) Remove code for named sections.
(3) Remove code for GC names.
(4) Global variable aliases.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/18770005
|
|
|
|
BUG=None
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/19284013
|
|
Conflicts:
docs/LangRef.rst
include/llvm/CodeGen/CallingConvLower.h
include/llvm/IRReader/IRReader.h
include/llvm/Target/TargetMachine.h
lib/CodeGen/CallingConvLower.cpp
lib/IRReader/IRReader.cpp
lib/IRReader/LLVMBuild.txt
lib/IRReader/Makefile
lib/LLVMBuild.txt
lib/Makefile
lib/Support/MemoryBuffer.cpp
lib/Support/Unix/PathV2.inc
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMSubtarget.cpp
lib/Target/ARM/ARMTargetMachine.cpp
lib/Target/Mips/CMakeLists.txt
lib/Target/Mips/MipsDelaySlotFiller.cpp
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/Mips/MipsInstrInfo.td
lib/Target/Mips/MipsSubtarget.cpp
lib/Target/Mips/MipsSubtarget.h
lib/Target/X86/X86FastISel.cpp
lib/Target/X86/X86ISelDAGToDAG.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrControl.td
lib/Target/X86/X86InstrFormats.td
lib/Transforms/IPO/ExtractGV.cpp
lib/Transforms/InstCombine/InstCombineCompares.cpp
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/CodeGen/X86/fast-isel-divrem.ll
test/MC/ARM/data-in-code.ll
tools/Makefile
tools/llvm-extract/llvm-extract.cpp
tools/llvm-link/CMakeLists.txt
tools/opt/CMakeLists.txt
tools/opt/LLVMBuild.txt
tools/opt/Makefile
tools/opt/opt.cpp
|
|
Also removed local MaxGlobalType in WriteModuleInfo because it calls VE.getTypeID(GV->getTYpe(), which is no longer defined for globals.
Also noted that MaxAlignment in WriteModuleInfo was no longer used and removed it.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3541
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18185005
|
|
Generates simple global variable records, followed by list of records defining
byte initialization and relocations.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3504
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18111002
|
|
Before this change, NaClBitcodeReader had some icky use of C++
function overloading and reference types. Whether getValue() modified
its Slot argument depended on whether it was passed a Type argument,
which wasn't very readable:
// Modifies Slot.
bool getValue(SmallVector<uint64_t, 64> &Record, unsigned &Slot,
unsigned InstNum, Value *&ResVal);
// Does not modify Slot.
bool getValue(SmallVector<uint64_t, 64> &Record, unsigned Slot,
unsigned InstNum, Type *Ty, Value *&ResVal);
// Does not modify Slot.
Value *getValue(SmallVector<uint64_t, 64> &Record, unsigned Slot,
unsigned InstNum, Type *Ty);
So, do these cleanups:
* Convert non-const reference arguments to pointers. (Also add
"const" to the Record argument.)
* Remove the unused Type argument from getValue()/popValue().
* Remove the getValue() case that was identical to popValue(). Call
popValue() instead. Now popValue() modifies *Slot and getValue()
does not.
* Remove an unused getValue() case.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3507
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17938002
|
|
Change the reader to be stricter so that duplicate FORWARDTYPEREFs are
rejected.
Also fix typo in error message.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3507
TEST=see "Invalid FORWARDTYPEREF record" if EmitFnForwardTypeRef()
is changed to produce unnecessary FORWARDTYPEREFs
Review URL: https://codereview.chromium.org/17925002
|
|
These were for ELF dynamic linking support, which we are removing.
The same LOCALMODs were previously removed from PNaCl's fork of the
reader/writer (in https://codereview.chromium.org/17761005/).
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3520
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17854006
|
|
Despite removing metadata at the IR level, the writer was still
outputting a METADATA_BLOCK containing built-in strings such as "dbg",
"tbaa" and "fpmath".
Remove this by removing metadata support from the reader and writer.
I've removed most references to "metadata" and "MD".
I've also removed DEBUG_LOC handling, since that depends on
MDValueList in the reader.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3518
TEST=PNaCl toolchain trybots + check hello_world.final.pexe in bcanalyzer
Review URL: https://codereview.chromium.org/17761005
|
|
Before this change, the writer would only emit FORWARDTYPEREF for some
operands, e.g. the first operand of BINOP but not the second, on the
grounds that the type of the second operand can be inferred. However,
that makes the format complicated.
Change the writer so that it always emits FORWARDTYPEREF for a forward
ref. This unifies PushValueAndType() and pushValue(). pushValue()
gains a call to EmitFnForwardTypeRef() so becomes the same as
PushValueAndType().
Change the reader to be stricter, so that it requires a FORWARDTYPEREF
to have been emitted in most cases. This is done by ignoring the
implied type argument.
Tasks still remaining:
* Make reader stricter so that multiple FORWARDTYPEREFs are disallowed.
* Remove now-unused Type arguments in the reader.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3507
TEST=new llvm-lit test + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17806003
|
|
For some reason, the size operand of "alloca" was represented using an
absolute value ID + type, unlike other instructions where relative
value IDs are used.
Change the "alloca" representation to be consistent with other
instructions, so that we can use PushValueAndType() in the writer and
getValue() in the reader.
Also take this opportunity to remove the field for alloca's result
type, since it's always i8* in PNaCl.
This is part of a cleanup to make forward reference handling stricter:
it removes a use of getOrCreateFnValueByID(), which isn't strict (that
is, it doesn't reject duplicate FORWARDTYPEREF records).
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3507
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17757004
|
|
The magic number is no longer needed now that the reader for the old
switch representation has been removed (in
https://codereview.chromium.org/17764003), so we can remove this
baggage.
Also add a missing record size check to the reader.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3507
TEST=hello_world.pexe includes a switch statement; also PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17777005
|
|
The PNaCl pexe writer never writes this old representation.
This is part of a cleanup to make forward reference handling stricter:
it removes a use of getOrCreateFnValueByID(), which isn't strict (that
is, it doesn't reject duplicate FORWARDTYPEREF records).
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3507
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17764003
|
|
PNaCl only supports a fixed data layout, so treat this as implicit in
the pexe file.
Add the data layout field back at read time, to prevent accidentally
using any architecture-specific backend data layout when translating,
and to ensure that any IR passes that use the data layout work
correctly.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3505
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17591014
|
|
Simplify instruction records by adding concept of a forward type reference
map that maps ValueID's to types. Used to generate forward reference types
for instruction arguments that need a type because the forward reference
has not yet been generated.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3507
R=jvoung@chromium.org, mseaborn@chromium.org
Review URL: https://codereview.chromium.org/16963004
|
|
Currently, the triple that gets put into pexes is
"armv7-none-linux-gnueabi". This is a wart that we don't want to
keep. We can remove the triple entirely; PNaCl doesn't need it.
We don't need to add a triple back at read time: (pnacl-)llc tells the
backend explicitly what target to use.
I'm leaving MODULE_CODE_TRIPLE defined in the enum for now because
pnacl-bcanalyzer still refers to it.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3505
TEST=PNaCl toolchain trybots + GCC torture tests + Spec2k
Review URL: https://codereview.chromium.org/17321009
|
|
Remove support for reading and writing the PARAMATTR_BLOCK_ID and
PARAMATTR_GROUP_BLOCK_ID blocks.
These blocks will no longer be written into pexes. While PNaCl
doesn't allow function attributes on normal functions,
Function::Create() always inserts them back on intrinsics, so
previously the PARAMATTR blocks were being written into pexes.
Remove paramattr fields from two record types:
* MODULE_CODE_FUNCTION records (function declarations). Also remove
the fields that follow paramattr, which PNaCl also does not use.
* FUNC_CODE_INST_CALL (function calls).
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3506
TEST=PNaCl toolchain trybots + GCC torture tests + Spec2k
Review URL: https://codereview.chromium.org/17419013
|
|
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/17519003
|
|
Creates a bitcode-local enumeration for calling conventions for the PNaCl bitcode file, so that the bitcode file is better protected from (accidental) changes in LLVM code.
Also removes invokes from the bitcode.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3497
R=dschuff@chromium.org, mseaborn@chromium.org
Review URL: https://codereview.chromium.org/17118002
|
|
BUG=none
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/16838018
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/16836017
|
|
Fixes bug where we computed the length of fields buffer on the size of a pointer, rather then the actual length of the field.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3485
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/17003002
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/15907008
|
|
[1] Explicitly enumerate all abbreviation values, including the
maximum abbreviation for each type of block.
[2] Make "enter subblock" calculate number of bits needed by passing
in maximum abbreviation (associated with block) rather than requiring
the developer to compute this value every time a subblock is entered.
*NOTE* This code changes encoding sizes to be based on
the maximum allowed value, rather than requiring the
developer to calculate out the number of bits needed. This
change doesn't make the PNaCL bitcode files
incompatable with LLVM bitcode files, since it does
not effect the bitcode reader.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/14813032
|
|
Create type IDs based on number of references, rather than first reached.
This is done so that fewer bits are used to encode types that are commonly
used.
Note that this cuts the size of the generate bitcode file by about 1.5%, with
no effect on the reader, since it only changes the order type ID's are created.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/14495008
|
|
constructor enables
Patch by Robert Wilhelm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181138 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Create NaCl specific version of BitCodes.h so that we can custimize it
for the PNaCl wire format. Moves enums to namespace naclbitc. Renames
classes using NaCl prefix. Fixes references so that files compiles.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/14682013
|
|
the things, and renames it to CBindingWrapping.h. I also moved
CBindingWrapping.h into Support/.
This new file just contains the macros for defining different wrap/unwrap
methods.
The calls to those macros, as well as any custom wrap/unwrap definitions
(like for array of Values for example), are put into corresponding C++
headers.
Doing this required some #include surgery, since some .cpp files relied
on the fact that including Wrap.h implicitly caused the inclusion of a
bunch of other things.
This also now means that the C++ headers will include their corresponding
C API headers; for example Value.h must include llvm-c/Core.h. I think
this is harmless, since the C API headers contain just external function
declarations and some C types, so I don't believe there should be any
nasty dependency issues here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180881 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Copy classes for LLVM BitcodeReader into a NaCl subdirectory, to create a wire
format version. Renames classes/functions to include NaCl prefix, so that
they don't conflict with the LLVM Bitcode reader.
Also implements pnacl-thaw, showing that we can read the PNaCl wire format
files.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/14314016
|
|
TBR=kschimpf@google.com
BUG=none
Review URL: https://codereview.chromium.org/14520020
|
|
Copy classes for LLVM BitcodeWriter into a PNaCL subdirectory, to create a
PNaCL version. Renames classes/methods to include PNaCl prefix so that they
don't conflict with the LLVM BitcodeWriter.
Also removed experimental support for use-list order
preservation.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3405
Review URL: https://codereview.chromium.org/14126011
|
|
or the C++ files themselves. This enables people to use
just a C compiler to interoperate with LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180063 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178454 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Conflicts:
include/llvm/CodeGen/LexicalScopes.h
include/llvm/MC/MCAsmInfo.h
lib/Linker/LinkArchives.cpp
lib/Linker/LinkItems.cpp
lib/MC/MCAsmInfo.cpp
lib/MC/MCDwarf.cpp
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMSubtarget.cpp
lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp
lib/Target/Mips/MipsAsmPrinter.cpp
lib/Target/Mips/MipsDelaySlotFiller.cpp
lib/Target/Mips/MipsISelDAGToDAG.cpp
lib/Target/Mips/MipsSubtarget.cpp
lib/Target/Mips/MipsSubtarget.h
lib/Target/Mips/MipsTargetObjectFile.cpp
lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
lib/Target/X86/X86FastISel.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86TargetMachine.cpp
lib/Transforms/CMakeLists.txt
lib/Transforms/LLVMBuild.txt
lib/Transforms/Makefile
test/MC/ARM/arm_instructions.s
test/MC/X86/AlignedBundling/pad-align-to-bundle-end.s
|
|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175501 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
The bitcode writer emits a reference to the attribute group that the object at
the given index refers to. The bitcode reader is modified to read this in and
map it back to the attribute group.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174952 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174950 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174911 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174910 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174864 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
I have some uncommitted changes to the cast code that catch this sort of thing
at compile-time but I still need to do some other cleanup before I can enable
it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174853 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reads the attribute groups. It currently doesn't do anything with them.
NOTE: In the commit to the bitcode writer, the format *may* change in the near
future. Which means that this code would also change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174849 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This is some initial code for emitting the attribute groups into the bitcode.
NOTE: This format *may* change! Do not rely upon the attribute groups' bitcode
not changing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174845 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Attribute groups are essentially all AttributeSets which are used by the
program. Enumerate them here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174844 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
bitcode writer would generate abbrev records saying that the abbrev should be
filled with fixed zero-bit bitfields (this happens in the .bc writer when
the number of types used in a module is exactly one, since log2(1) == 0).
In this case, just handle it as a literal zero. We can't "just fix" the writer
without breaking compatibility with existing bc files, so have the abbrev reader
do the substitution.
Strengthen the assert in read to reject reads of zero bits so we catch such
crimes in the future, and remove the special case designed to handle this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174801 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174550 91177308-0d34-0410-b5e6-96231b3b80d8
|