aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-04-11[MIPS] Fix LLVM issues with recent LLVM trunk mergePetar Jovanovic
This change fixes some of the issues that came with recent merge with LLVM trunk, and it removes some workarounds that are not needed anymore in the code. In more details, it: - removes hack to set ELF::EF_MIPS_PIC flag; - checks whether __nacl_read_tp is defined in the module, as different relocation(s) is used to calculate the address; - marks Mips::JALRPseudo as indirect call in NaCl rewrite pass; - fixes incorrect merge in MipsAsmPrinter.cpp and MipsMCTargetDesc.cpp. BUG= https://code.google.com/p/nativeclient/issues/detail?id=2275 TEST= run smoke tests Review URL: https://codereview.chromium.org/13601014
2013-04-10PNaCl ABI checker: Disallow the GetElementPtr instructionMark Seaborn
This instruction is removed by ExpandGetElementPtr. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343 TEST=test/NaCl/PNaClABI/instructions.ll + PNaCl toolchain trybots Review URL: https://codereview.chromium.org/14071005
2013-04-10PNaCl ABI checker: Disallow "section", "thread_local" and "gc" attributesMark Seaborn
* Disallow "section" on functions and global variables. * Disallow "thread_local" on global variables. * Disallow "gc" on functions. BUG= https://code.google.com/p/nativeclient/issues/detail?id=2837 BUG= https://code.google.com/p/nativeclient/issues/detail?id=3126 TEST=test/NaCl/PNaClABI/global-attributes.ll + PNaCl toolchain trybots Review URL: https://codereview.chromium.org/14063007
2013-04-04PNaCl: Change ExpandVarArgs to work around invalid use of va_argMark Seaborn
I've encountered two uses of va_arg on an empty argument list: NaCl's open() wrapper (now fixed), and 176.gcc in Spec2k. Although this is invalid use of va_arg (giving undefined behaviour), it's too awkward to fix 176.gcc. Work around this invalid usage by ensuring that the argument list pointer points to a location on the stack rather than being uninitialised. va_arg will return undefined values as it does in the usual native ABIs, rather than crashing. We could add options for non-strict and strict modes (possibly with a bounds check), but that's too much complication for now. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338 TEST=test/Transforms/NaCl/*.ll + ran 176.gcc from Spec2k Review URL: https://codereview.chromium.org/13510004
2013-04-02Disable shift-compare instcombine optimization for NaCl.Derek Schuff
This is one of at least 2 optimizations which introduce non-power-of-two integer sizes, which we don't want to allow in the PNaCl stable wire format. This transforms (icmp pred iM (shl iM %value, N), ConstInt) -> (icmp pred i(M-N) (trunc %value iM to i(N-N)), (trunc (ConstInt >> N)) and reduces the size of the compare and its operands. R=mseaborn@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=3360 Review URL: https://codereview.chromium.org/13182003
2013-04-01PNaCl: Tidy: Remove an unnecessary cast in the ABI checkerMark Seaborn
I noticed this while debugging a runtime cast assertion error. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309 TEST=test/NaCl/PNaClABI/*.ll Review URL: https://codereview.chromium.org/13261012
2013-04-01PNaCl ABI checker: Disable integer size check since it doesn't pass yetMark Seaborn
We would like to enable the ABI checker as soon as possible so that we can iterate. The check can be re-enabled when it passes. FileCheck doesn't allow CHECKs to be commented out so we have to disrupt them instead. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309 BUG=https://code.google.com/p/nativeclient/issues/detail?id=3360 TEST=run ABI checker on NaCl Scons-based tests Review URL: https://codereview.chromium.org/13375008
2013-04-01PNaCl: Fix ABI checker to give a better error message on BlockAddressesMark Seaborn
Before, the checker failed with a cast error, when trying to cast the BasicBlock in a BlockAddress to a Constant. Fix it so that we at least know which global initializer is being rejected. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309 TEST=test/NaCl/PNaClABI/types.ll Review URL: https://codereview.chromium.org/13392004
2013-04-01pnacl-abicheck: Fix exit status so that 256 errors aren't reported as successMark Seaborn
Avoid truncation problems. On Unix, exit(256) is equivalent to exit(0). BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309 TEST=none Review URL: https://codereview.chromium.org/13375007
2013-04-01PNaCl: Allow the ABI checker to be used from "opt"Mark Seaborn
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
2013-03-29PNaCl: Fix ExpandTls to handle a couple of corner cases involving PHI nodesMark Seaborn
ExpandTls's use of replaceUsesOfWith() didn't work for PHI nodes containing the same Constant twice (which needs to work for same or differing incoming BasicBlocks). The same applies to ExpandTlsConstantExpr. I noticed this while implementing ExpandConstantExpr. Fix this and factor out some common code that all three passes can use. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2837 TEST=test/Transforms/NaCl/*.ll Review URL: https://codereview.chromium.org/13128002
2013-03-28Add a pass to strip bitcode metadata.Jan Voung
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
2013-03-28Target Cortex-A9 with NEON in PNaCl's LLC driver.JF Bastien
This is a follow-up to: https://codereview.chromium.org/12683004/ https://codereview.chromium.org/12969002/ And will enable optiomizations for our minimum platform when translating with default flags. At some point we'll probably want to specialize further by detecting, e.g. A15 and turning on VFP4, IDIV, etc... R= dschuff@chromium.org, jvoung@chromium.org Review URL: https://codereview.chromium.org/13224003
2013-03-27Make pnacl-abicheck return nonzero status if errors are found.Derek Schuff
Also add -q flag for quiet operation; i.e. don't print the errors, only use the exit status to indicate failure. R=mseaborn@chromium.org,jvoung@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=2309 Review URL: https://codereview.chromium.org/13117004
2013-03-27PNaCl: Fix ExpandVarArgs to handle "byval" struct arguments properlyMark Seaborn
* Ensure that the "byval" attribute is preserved for the fixed arguments. Before, it was stripped off from function calls but left in for function definitions, which broke passing struct arguments (which PNaCl Clang generates as "byval"). * Ensure that function and return attributes are preserved too. * Handle "byval" variable arguments in calls too by dereferencing the pointer. These are not yet usable with PNaCl Clang, which does not allow va_arg on structs (see https://code.google.com/p/nativeclient/issues/detail?id=2381), but we might as well make this pass ready to handle this. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338 TEST=test/Transforms/NaCl/expand-varargs*.ll Review URL: https://codereview.chromium.org/13100002
2013-03-26PNaCl: Add ExpandGetElementPtr pass for converting GetElementPtr to arithmeticMark Seaborn
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
2013-03-25PNaCl ABI: add passes to cleanup/finalize some linkage types and resolve ↵Derek Schuff
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
2013-03-25PNaCl: Fix ExpandTls to handle GlobalAliases of thread-local variablesMark Seaborn
Expand out these aliases in the ExpandTlsConstantExpr pass. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3347 TEST=test/Transforms/NaCl/expand-tls-constexpr-alias.ll Review URL: https://codereview.chromium.org/12989011
2013-03-25Add -time-ir-parsing flag to llc.Eli Bendersky
This is in the process of being added upstream but the exact location is still debated and will take some time to settle. In the mean-time I'm adding it as a localmod so we can run our benchmarks effectively. Later this should be switched to the upstream implementation (or move to our own llc-replacement-driver). BUG=https://code.google.com/p/nativeclient/issues/detail?id=3349
2013-03-21PNaCl: Add ExpandVarArgs pass for expanding out variable-args function callsMark Seaborn
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
2013-03-20Properly conditionalize for NaCl an Mips AsmPrinter LOCALMOD that has toEli Bendersky
be kept to pass regression tests.
2013-03-20Merge remote-tracking branch 'origin/master'Eli Bendersky
Merge Nacl-LLVM work since the upstream merge branched
2013-03-20Apply after-merge fixes to return to working state.Eli Bendersky
2013-03-18Don't fold large offsets into FrameIndexBase displacements eitherDerek Schuff
R=sehr@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=3302 Review URL: https://codereview.chromium.org/12919017
2013-03-18Switch ABI verifier passes to manual initialization.Derek Schuff
This lines them up with the rest of the codebase and will make them work with statically-linked opt. R=mseaborn@chromium.org BUG=none TEST=existing tests keep working (we don't actually use static opt) Review URL: https://codereview.chromium.org/12902015
2013-03-15PNaCl: Add ExpandConstantExpr pass for converting ConstantExprs to InstructionsMark Seaborn
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
2013-03-14Fix CMakeFile as well.Derek Schuff
Carryover from https://codereview.chromium.org/12690007
2013-03-14Fix LLVMBuild.txt for NaCl analysis passesDerek Schuff
R=jvoung@chromium.org BUG= Sandboxed LLC doesn't build correctly anymore without it Review URL: https://codereview.chromium.org/12432018
2013-03-14Cleanup of ABI CheckerDerek Schuff
Fix spacing of error output, use OwningPtr everywhere at top level, fix command line parsing R=jvoung@chromium.org BUG= Review URL: https://codereview.chromium.org/12690007
2013-03-13ABI verifier: Add standalone tool pnacl-abicheckDerek Schuff
This CL adds a standalone tool pnacl-abicheck for checking the ABI validity of a bitcode file. It also adds a flag pnaclabi-verify to llc to enable the same checking in llc. It also improves the mechanism for handling and reporting validation errors and uses it in both tools. R=jvoung@chromium.org,mseaborn@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=2309 Review URL: https://codereview.chromium.org/12449014
2013-03-11Merge commit '279b9184c2ff4fea93b198a3519b8cb3a1d8d195'Eli Bendersky
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
2013-03-06Add an RPC to LLC.nexe to init with appended flags (vs set all flags).Jan Voung
This will take the default flags and append any extra flags. For now, this is only intended to support -O in the browser, and perhaps -mcpu=.*, -mattr=. We move the tuning parameters like -mcpu out of the default, so that a user does not end up setting the -mcpu more than once (which is disallowed). What does go into the default is -mtriple, which we may want to hard-code into the build somehow (but it's not yet clear how to do that cleanly). That way, a user does not need to specify that portion. We also hardcode the -sfi-* flags. Sort of tested by: https://codereview.chromium.org/12459004/ BUG= https://code.google.com/p/nativeclient/issues/detail?id=3325 Review URL: https://codereview.chromium.org/12490004
2013-03-04Prune unused PBQP register allocator and PBQP Heuristics from llvm-sb.Jan Voung
Saves about 58KB. These LinkAll{CodeGen/AsmWriter}Components.h headers are only #included by LLC/LLI. We could create our own version of these if we want to create our own version of LLC, but that could make it harder to notice when the header changes. BUG= http://code.google.com/p/nativeclient/issues/detail?id=1222 Review URL: https://codereview.chromium.org/12334018
2013-03-01Only fold small constants into memory reference displacements.Derek Schuff
This should more generally prevent negative values in index registers, but still allow most uses of this address mode for structure references. R=sehr@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=3302 Review URL: https://codereview.chromium.org/12389054
2013-02-28AArch64: Use cbnz instead of cmp/b.ne pair for atomic operations.Tim Northover
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176253 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28[msan] Implement sanitize_memory attribute.Evgeniy Stepanov
Shadow checks are disabled and memory loads always produce fully initialized values in functions that don't have a sanitize_memory attribute. Value and argument shadow is propagated as usual. This change also updates blacklist behaviour to match the above. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176247 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28Corrections for XFAIL armv5 testsRenato Golin
Most of the tests that behave differently on llvm-arm-linux buildbot did so becase the triple wasn't set correctly to armv5, so we can revert most of the special behaviour added previously. Some tests still need the special treatment, though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176243 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28Remove unused leftover declarations.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176240 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28Enable syntax highlighting for reStructuredText files.Bill Wendling
Patch by Journeyer J. Joh! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176235 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28[Support][ErrorOr] Add support for implicit conversion from error ↵Michael J. Spencer
code/condition enums. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176228 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28[PathV2] In llvm::sys::fs::unique_file, make sure it doesn't fall into an ↵Argyrios Kyrtzidis
infinite loop by constantly trying to create the parent path. This can happen if the path is a relative filename and the current directory was removed. Thanks to Daniel D. for the hint in fixing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176226 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-28Fix a problem in alias analysis. It is about the misinterpretation of "Object".Shuxin Yang
This problem is exposed by r171325 which is already reverted. It is rather hard to fabricate a testing case without it. r171325 should *NOT* be resurrected as it has a potential problem although this problem dosen't directly contribute to PR14988. The bug is tracked by: - rdar://13063553, and - http://llvm.org/bugs/show_bug.cgi?id=14988 Thank Arnold for coming up a better solution to this problem. After comparing this solution and my original proposal, I decided to ditch mine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176225 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Remove unnecessary check against isGlobalVariable. We check itEric Christopher
a few lines above. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176224 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Rework comment slightly and fix a few typos.Eric Christopher
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176223 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Remove unnecessary cast to void.Eric Christopher
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176222 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Debug Info: for static member variables, always put AT_MIPS_linkage_name to theManman Ren
definition DIE (TAG_variable), and put AT_MIPS_linkage_name to TAG_member when DarwinGDBCompat is true. Darwin GDB needs AT_MIPS_linkage_name at both places to work. Follow-up patch to r176143. rdar://problem/13291234 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176220 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Silence the unused variable warning. Nadav Rotem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176218 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27The FastISEL should be fast. But when we record statistics we use atomic ↵Nadav Rotem
operations to increment the counters. This patch disables the counters on non-debug builds. This reduces the runtime of SelectionDAGISel::SelectCodeCommon by ~5%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176214 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27Copy missing member in DataLayout copy ctor.David Blaikie
Test case is missing due to it not being reachable through the current tools but out of tree code such as the sample at http://llvm.org/docs/tutorial/LangImpl4.html Patch by Peng Cheng <gm4cheng@gmail.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176213 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-27ARM: FMA is legal only if VFP4 is available.Jim Grosbach
rdar://13306723 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176212 91177308-0d34-0410-b5e6-96231b3b80d8