Age | Commit message (Collapse) | Author |
|
|
|
|
|
setjmp()+longjmp()
There are two parts to this:
* PNaClSjLjEH.cpp expands out the "invoke", "landingpad" and "resume"
instructions, modifying the control flow to use setjmp().
* ExceptionInfoWriter.cpp lowers landingpads' clause lists to data
that PNaCl's C++ runtime library will interpret. This part will be
reused when we drop the SjLj part and create a stable ABI for
zero-cost EH.
This pass isn't enabled in PNaClABISimplify yet: I'll do that in a
separate change.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3696
TEST=*.ll tests (also tested end-to-end: plumbing for this will follow later)
Review URL: https://codereview.chromium.org/24777002
|
|
Since we deleted the rewrite of ARM -> LE32 in the
bitcode reader, opt is unable to look up a TTI to transform
switch(c) { case 1: x = <const1>; break; case 2: x = <const2>; break; ... }
into a lookup table to get x from c.
This causes a regression in pnacl-llc's size (which has
lots of switch statements).
Fake the target lookup in opt for now. Eventually we should
look into making target info for le32.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=2554
TEST= trybot http://chromegw.corp.google.com/i/tryserver.nacl/builders/nacl-toolchain-linux-pnacl-x86_64/builds/887
http://chromegw.corp.google.com/i/tryserver.nacl/builders/nacl-toolchain-mac-pnacl-x86_32/builds/842
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/23551013
|
|
This is a follow-up to:
https://codereview.chromium.org/22240002/
And requires the Clang changes from:
https://codereview.chromium.org/22294002/
This new intrinsic represents ``asm("":::"~{memory}")`` as well as ``__sync_synchronize()``, and in IR it corresponds to a sequentially-consistent fence surrounded by ``call void asm sideeffect "", "~{memory}"()``.
R=jvoung@chromium.org
TEST= ninja check-all
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3475
Review URL: https://codereview.chromium.org/22474008
|
|
This is often used as a compiler barrier and should "just work" in user code.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2345
R=eliben@chromium.org
TEST= (cd ./pnacl/build/llvm_x86_64 && ninja check-all)
Review URL: https://codereview.chromium.org/21178002
|
|
|
|
|
|
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
|
|
Add portable support for concurrency in PNaCl's ABI:
- Promote volatile to atomic.
- Promote all memory ordering to sequential consistency.
- Rewrite all atomic operations to frozen NaCl intrinsics for pexe.
- Rewrite atomic intrinsics to LLVM instructions for translation.
This change also adds documentation to the PNaCl language reference, as
well as tests where it makes sense.
A future CL could clean up more of our code which mentions atomics,
volatiles, memory orderings.
Multiple reviewers because this is a big patch:
- eliben: LLVM-fu and ResolvePNaClIntrinsics.
- dschuff: ABI stability.
- mseaborn: ABI stability.
- sehr: Tron-duty (fight for the user's programs to work).
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3475
R=dschuff@chromium.org, eliben@chromium.org, sehr@google.com
TEST= (cd ./pnacl/build/llvm_x86_64; ninja check-all) && ./pnacl/test.sh test-x86-32 && ./pnacl/test.sh test-x86-64 && ./pnacl/test.sh test-arm && ./pnacl/test.sh test-x86-32-sbtc && ./pnacl/test.sh test-x86-64-sbtc && ./pnacl/test.sh test-arm-sbtc
Review URL: https://codereview.chromium.org/17777004
|
|
Convert calls to this intrinsic to use the 32-bit variant instead. Do
the same for the memcpy and memmove intrinsics too.
Change the PNaCl ABI verifier to check this argument.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3530
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/18226003
|
|
Disallow i1 on loads/stores and require the conversions to i8 to be
explicit. Add a pass, PromoteI1Ops, that adds the conversions.
(Load/store on i1 occur in practice in small_tests for some boolean
globals.)
Disallow i1 for most arithmetic/comparison operations since these
aren't very useful and it's a nuisance for a code generator to have to
support these. I haven't seen these occur in practice, but
PromoteI1Ops nevertheless expands them.
We still allow and/or/xor on i1 because these do occur in practice,
and they're less of a nuisance to handle because they never overflow:
no truncation to 1 bit is required, unlike with adds.
Restrict the type of alloca's argument. Clang always uses i32 here.
Disallow i1 in switch instructions. Clang doesn't generate i1
switches for booleans.
Move CopyLoadOrStoreAttrs() helper into a header to reuse.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3490
TEST=PNaCl toolchain trybots + GCC torture tests + Spec2k
Review URL: https://codereview.chromium.org/17356011
|
|
Until there is an intrinsic to *set* the rounding mode,
this intrinsic to *get* the rounding mode isn't so useful.
Separately we will add a test that for each platform, the
initial rounding mode is "1" (round to nearest). That is
the case right now for x86, ARM, and MIPS.
(see https://codereview.chromium.org/16785003/)
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3491
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/17229007
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3485
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/16146012
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3469
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/16385002
|
|
Add a pass, StripAttributes, for doing this, and enable it.
Add an ABI check to reject these attributes.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=2346
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3415
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/16325025
|
|
Also removes flag from llvm-as.cpp and LTOCodeGenerator.cpp
since one should call pnacl-finalize to
transform pexe's to PNaCl bitcode form.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3469
R=dschuff@chromium.org, jvoung@chromium.org
Review URL: https://codereview.chromium.org/16295014
|
|
Clang's implementation of C++ method pointers generates IR that uses
LLVM registers with struct type -- specifically, loads and stores of
struct values, and extractvalue instructions. See
lib/CodeGen/ItaniumCXXABI.cpp in Clang. Add a pass, ExpandStructRegs,
which expands out those uses.
Factor out a function from ExpandArithWithOverflow so that the two
passes can share some code.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343
TEST=*.ll tests + trybots + GCC torture tests
Review URL: https://codereview.chromium.org/15692014
|
|
This widens i1, i8 and i16 function arguments and return types.
Factor out RecreateFunction() helper function from existing PNaCl
passes since this is a reoccurring code fragment.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3342
TEST=*.ll tests + PNaCl toolchain trybots + GCC torture tests + LLVM test suite
Review URL: https://codereview.chromium.org/15971007
|
|
It turned out that umul.with.overflow wasn't the only *.with.overflow
intrinsic usage introduced by Clang.
I knew that Clang's CGExprCXX.cpp generates umul.with.overflow for an
overflow check for C++'s "new Foo[]". The same code for handling "new
Foo[]" also generates uadd.with.overflow in some cases. This happens
if class Foo has a destructor or a delete[] operator that takes a size
argument. In those cases, the C++ ABI adds a "cookie" to the
allocation which contains the array's size.
Rename the pass to "ExpandArithWithOverflow" and rename files
accordingly.
Also enable the pass.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3434
TEST=*.ll tests + trybots + GCC torture tests
Review URL: https://codereview.chromium.org/15688011
|
|
to external function calls during the translation stage (llc).
One of the passes is a ModulePass that adds the appropriate function
declarations to the module. The other is a FunctionPass that performs the
actual call replacement. This split exists because of bitcode streaming.
Initially the passes handle the llvm.nacl.{set|long}jmp intrinsics. In the
future they may handle additional intrinsics that are part of the PNaCl
stable bitcode ABI.
This CL also removes the previous approach to handling this conversion
(in SelectionDAGBuilder.cpp). That ended up not working - more details in
issue 3429.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3429
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/16047002
|
|
These meta-passes will be used to replace the pass lists that are
currently in the pnacl-ld.py driver script in the NaCl repo.
I've moved the comments across from pnacl-ld.py and added a couple
more comments for ExpandByVal and StripMetadata.
Fix the declaration of createResolveAliasesPass().
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3435
TEST=new *.ll tests + tested with change to pnacl-ld.py
Review URL: https://codereview.chromium.org/15669002
|
|
This adds a pass, ExpandMulWithOverflow, to expand out the
llvm.umul.with.overflow calls that Clang generates to implement an
overflow check for C++'s new[] operator.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3434
TEST=expand-mul-with-overflow.ll
Review URL: https://codereview.chromium.org/14649027
|
|
Adds command line option '-pnacl-freeze' to generate a pnacl bit code file
instead of an llvm bitcode file.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/15178005
|
|
ReplacePtrsWithInts converts IR to a normal form in which functions
don't reference any aggregate pointer types and pointer types only
appear inside a few instructions.
Change BlockAddress::replaceUsesOfWithOnConstant() to handle changing
a function's type by replacing a function with a bitcast ConstantExpr
of a new function.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343
TEST=replace-ptrs-with-ints.ll + PNaCl toolchain trybots, torture tests, etc.
Review URL: https://codereview.chromium.org/14262011
|
|
with stable bitcode intrinsics.
Starting with setjmp and longjmp.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3429
R=jvoung@chromium.org, mseaborn@chromium.org
Review URL: https://codereview.chromium.org/14617017
|
|
This pass (mostly) legalizes integer types by promoting them.
It has some limitations (e.g. it can't change function types)
but it is more than sufficient for what clang and SROA generate.
A more significant limitation of promotion is that packed
bitfields of size > 64 bits are still not handled. There are
none in our tests (other than callingconv_case_by_case which
doesn't require a stable pexe) but we will want to either
handle them by correctly expanding them, or find a better way
to error out.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3360
R=eliben@chromium.org, jvoung@chromium.org
Review URL: https://codereview.chromium.org/14569012
|
|
This IR pass for ARM inserts a comparison and a branch to trap if the
denominator of a DIV or REM instruction is zero. This makes ARM fault
identically to x86 in this case.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2833
R=eliben@chromium.org
Review URL: https://codereview.chromium.org/14607004
|
|
This pass expands out the "byval" and "sret" argument attributes.
This will affect the calling conventions for PPAPI under PNaCl (for
passing PP_Var etc. by value), so the PNaCl PPAPI shims will need to
be updated in order to enable this pass by default.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3400
TEST=PNaCl toolchain trybots + GCC torture tests + LLVM test suite + Spec2k
Review URL: https://codereview.chromium.org/13973018
|
|
This pass converts initializers for global variables into a flattened
normal form which removes nested struct types and simplifies
ConstantExprs.
In the future, we might change the bitcode format to use the flattened
bytes+relocs representation for global initializers. In that case, we
will be able to reuse the FlattenedConstant class in the bitcode
reader/writer for converting to and from this form.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3113
TEST=test/Transforms/NaCl/flatten-globals.ll
Review URL: https://codereview.chromium.org/14017011
|
|
naming to better match upstream
R=jvoung@chromium.org
BUG=bot LLVM roll
Review URL: https://codereview.chromium.org/14315012
|
|
Clean up the LLVMBuild and CMakeLists.txt files
BUG=none
TEST=none
Review URL: https://codereview.chromium.org/14328017
|
|
I can fix the testcases here:
http://lab.llvm.org:8011/builders/clang-native-arm-cortex-a9/builds/6952
This reverts commit r179512 due to testcases specifying triples
that they didn't actually mean and causing failures on other platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179513 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179512 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This reverts commit r179497 and the accompanying commit as it broke random platforms that aren't osx.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179499 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
and use that as the default triple for the module and target
data layout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179497 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179373 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
On freebsd this makes sure that symbols are exported on the binaries that need
them. The net result is that we should get symbols in the binaries that need
them on every platform.
On linux x86-64 this reduces the size of the bin directory from 262MB to 250MB.
Patch by Stephen Checkoway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178725 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
This allows the ABI checker passes to be used in the same way as
LLVM's "-verify" pass. It allows the checker to be run between other
passes, and without launching pnacl-abicheck as a separate process (so
without the overhead of reading bitcode into memory again).
Make the ABI checker passes produce fatal errors by default, to match
"-verify". This is overridden for pnacl-abicheck's use.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309
TEST=tested with pnacl-ld.py changes to use the ABI checker passes
Review URL: https://codereview.chromium.org/13323006
|
|
This only works on instruction attachments for now. Since it is a
ModulePass we can add something to strip NamedMetadata
based on a whitelist, if we want to retain some of that.
It does not touch debug metadata, and leaves -strip-debug to handle that.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3348
Review URL: https://codereview.chromium.org/12844027
|
|
This is similar to the GEP handling in visitGetElementPtr() in
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp.
Once this pass is enabled, it will simplify the language to reduce the
set of constructs that a PNaCl translator needs to handle as part of a
stable wire format for PNaCl.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343
TEST=test/Transforms/NaCl/expand-getelementptr.ll
Review URL: https://codereview.chromium.org/12849009
|
|
that work on the LLVMBuild based dependency specification didn't
actually work, we just now maintain dependencies in *3* places instead
of 2. Yay.
There may still be some missing dependencies, I'm still sifting through
the bots and my builds, but this is a step in the right direction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177988 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
its own library. These functions are bridging between the bitcode reader
and the ll parser which are in different libraries. Previously we didn't
have any good library to do this, and instead played fast and loose with
a "header only" set of interfaces in the Support library. This really
doesn't work well as evidenced by the recent attempt to add timing logic
to the these routines.
As part of this, make them normal functions rather than weird inline
functions, and sink the implementation into the library. Also clean up
the header to be nice and minimal.
This requires updating lots of build system dependencies to specify that
the IRReader library is needed, and several source files to not
implicitly rely upon the header file to transitively include all manner
of other headers.
If you are using IRReader.h, this commit will break you (the header
moved) and you'll need to also update your library usage to include
'irreader'. I will commit the corresponding change to Clang momentarily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177971 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
aliases.
R=mseaborn@chromium.org,eliben@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3339
Review URL: https://codereview.chromium.org/13036005
|
|
Once this pass is enabled, it will simplify the language to reduce the
set of constructs that a PNaCl translator needs to handle as part of a
stable wire format for PNaCl.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338
TEST=test/Transforms/NaCl/expand-varargs.ll
Review URL: https://codereview.chromium.org/12481021
|
|
Merge Nacl-LLVM work since the upstream merge branched
|
|
Once this pass is enabled, it will simplify the language to reduce the
set of constructs that a PNaCl translator needs to handle as part of a
stable wire format for PNaCl.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3337
TEST=test/Transforms/NaCl/expand-constantexpr.ll
Review URL: https://codereview.chromium.org/12792011
|
|
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
|
|
Conflicts:
include/llvm/CodeGen/IntrinsicLowering.h
include/llvm/MC/MCAssembler.h
include/llvm/MC/MCObjectStreamer.h
lib/LLVMBuild.txt
lib/Linker/LinkArchives.cpp
lib/MC/MCAssembler.cpp
lib/MC/MCELFStreamer.cpp
lib/MC/MCParser/AsmParser.cpp
lib/MC/MCPureStreamer.cpp
lib/MC/WinCOFFStreamer.cpp
lib/Makefile
lib/Support/Unix/Memory.inc
lib/Support/Unix/Process.inc
lib/Support/Unix/Program.inc
lib/Target/ARM/ARM.h
lib/Target/ARM/ARMFastISel.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
lib/Target/Mips/MipsInstrFPU.td
lib/Target/X86/CMakeLists.txt
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86TargetMachine.cpp
lib/Target/X86/X86TargetObjectFile.cpp
lib/Transforms/InstCombine/InstCombineCalls.cpp
test/CodeGen/X86/fast-isel-x86-64.ll
tools/llc/llc.cpp
tools/lto/LTOModule.cpp
utils/TableGen/EDEmitter.cpp
|
|
for refactoring the ARC Optimizer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173647 91177308-0d34-0410-b5e6-96231b3b80d8
|