Skip to content
  1. Nov 03, 2014
    • Charlie Turner's avatar
      Remove the cortex-a9-mp CPU. · 1d8cc909
      Charlie Turner authored
      This CPU definition is redundant. The Cortex-A9 is defined as
      supporting multiprocessing extensions. Remove its definition and
      update appropriate tests.
      
      LLVM defines both a cortex-a9 CPU and a cortex-a9-mp CPU. The only
      difference between the two CPU definitions in ARM.td is that
      cortex-a9-mp contains the feature FeatureMP for multiprocessing
      extensions.
      
      This is redundant since the Cortex-A9 is defined as having
      multiprocessing extensions in the TRMs. armcc also defines the
      Cortex-A9 as having multiprocessing extensions by default.
      
      Change-Id: Ifcadaa6c322be0a33d9d2a39cfdd7da1d75981a7
      llvm-svn: 221166
      1d8cc909
    • Oliver Stannard's avatar
      [AArch64] Fix miscompile of comparison with 0xffffffffffffffff · 269a275c
      Oliver Stannard authored
      Some literals in the AArch64 backend had 15 'f's rather than 16, causing
      comparisons with a constant 0xffffffffffffffff to be miscompiled.
      
      llvm-svn: 221157
      269a275c
    • Sid Manning's avatar
      Handle ctor/init_array initialization. · 326f8af4
      Sid Manning authored
      Hexagon was not calling InitializeELF and could not select between
      ctors and init_array.
      
      Phabricator revision: http://reviews.llvm.org/D6061
      
      llvm-svn: 221156
      326f8af4
    • Charlie Turner's avatar
      Merge the directive-eabi_attribute.s and directive-eabi_attribute-2.s tests. · abaec9da
      Charlie Turner authored
      test/MC/ARM/directive-eabi_attribute.s had gotten out-of-sync with
      test/MC/ARM/directive-eabi_attribute-2.s. The former tests the encoding of
      build attributes in object files, and the latter the encoding in assembly
      files. Since both these tests need to be updated at the same time, it makes
      sense to combine them into a single test. The object file encodings are being
      checked against the ouput of -arm-attributes rather than by direct byte
      comparisons which makes for easier reading.
      
      Change-Id: I0075de506ae5626fb2fa235383fe5ce6a65a15a9
      llvm-svn: 221155
      abaec9da
    • Rafael Espindola's avatar
      Add CRLF support to LineIterator. · 42bce8f6
      Rafael Espindola authored
      The MRI scripts have to work with CRLF, and in general it is probably
      a good idea to support this in a core utility like LineIterator.
      
      llvm-svn: 221153
      42bce8f6
    • Oliver Stannard's avatar
      Revert r221150, as it broke sanitizer tests · cf6bfb1d
      Oliver Stannard authored
      llvm-svn: 221151
      cf6bfb1d
    • Oliver Stannard's avatar
      Emit .eh_frame with relocations to functions, rather than sections · 652ec6ee
      Oliver Stannard authored
      When LLVM emits DWARF call frame information, it currently creates a local,
      section-relative symbol in the code section, which is pointed to by a
      relocation on the .eh_frame section. However, for C++ we emit some functions in
      section groups, and the SysV ABI has some rules to make it easier to remove
      these sections
      (http://www.sco.com/developers/gabi/latest/ch4.sheader.html#section_group_rules):
      
        A symbol table entry with STB_LOCAL binding that is defined relative to one
        of a group's sections, and that is contained in a symbol table section that is
        not part of the group, must be discarded if the group members are discarded.
        References to this symbol table entry from outside the group are not allowed.
      
      This means that we need to use the function symbol for the relocation, not a
      temporary symbol.
      
      There was a comment in the code claiming that the local symbol was used to
      avoid creating a relocation, but a relocation must be created anyway as the
      code and CFI are in different sections.
      
      llvm-svn: 221150
      652ec6ee
    • Peter Zotov's avatar
      Unbreak build. · aea393be
      Peter Zotov authored
      A bug in lit.cfg was introduced in r221137.
      
      llvm-svn: 221144
      aea393be
    • Peter Zotov's avatar
      [OCaml] Avoid embedding absolute paths into executables. · f21b6c84
      Peter Zotov authored
      Bindings built out-of-tree, e.g. via OPAM, should append
      a line to META.llvm like the following:
      
      linkopts = "-cclib -L$libdir -cclib -Wl,-rpath,$libdir"
      
      where $libdir is the lib/ directory where LLVM libraries are
      installed.
      
      llvm-svn: 221139
      f21b6c84
    • Peter Zotov's avatar
      [OCaml] Run tests twice, with ocamlc and ocamlopt (if available) · 2f4735a1
      Peter Zotov authored
      ocamlc and ocamlopt expose a distinct set of buildsystem bugs, e.g.
      only ocamlc would detect -custom or -dllib-related bugs, and as all
      buildbots will have ocamlopt, these bugs will stay hidden.
      
      This change should add no more than 30 seconds of testing time.
      
      llvm-svn: 221137
      2f4735a1
    • David Majnemer's avatar
      Forgot to add input file for test added in r221133 · aafa6790
      David Majnemer authored
      llvm-svn: 221134
      aafa6790
    • David Majnemer's avatar
      llvm-vtabledump: Handle Itanium VTables · e268361b
      David Majnemer authored
      Add support in the vtable dumper for the Itanium ABI.
      
      llvm-svn: 221133
      e268361b
    • David Majnemer's avatar
      InstCombine: Combine (X | Y) - X to (~X & Y) · 72a643dc
      David Majnemer authored
      This implements the transformation from (X | Y) - X to (~X & Y).
      
      Differential Revision: http://reviews.llvm.org/D5791
      
      llvm-svn: 221129
      72a643dc
  2. Nov 02, 2014
    • Rafael Espindola's avatar
      Revert r221096 bringing back r221014 with a fix. · 778fcc77
      Rafael Espindola authored
      The issue was that linkAppendingVarProto does the full linking job, including
      deleting the old dst variable. The fix is just to call it and return early
      if we have a GV with appending linkage.
      
      original message:
      
          Refactor duplicated code in liking GlobalValues.
      
          There is quiet a bit of logic that is common to any GlobalValue but was
          duplicated for Functions, GlobalVariables and GlobalAliases.
      
          While at it, merge visibility even when comdats are used, fixing pr21415.
      
      llvm-svn: 221098
      778fcc77
    • Chandler Carruth's avatar
      Revert r221014: "Refactor duplicated code in liking GlobalValues." · fd38af2d
      Chandler Carruth authored
      This commit introduces heap-use-after-free detected by ASan. Here is the output
      for one of several tests that detect it:
      
      ******************** TEST 'LLVM :: Linker/AppendingLinkage.ll' FAILED ********************
      Command Output (stderr):
      --
      =================================================================
      ==2122==ERROR: AddressSanitizer: heap-use-after-free on address 0x60c00000b9c8 at pc 0x0000005d05d1 bp 0x7fff64ed27c0 sp 0x7fff64ed27b8
      READ of size 4 at 0x60c00000b9c8 thread T0
          #0 0x5d05d0 in llvm::GlobalValue::setUnnamedAddr(bool) /usr/local/google/home/chandlerc/src/llvm/build/../include/llvm/IR/GlobalValue.h:115:35
          #1 0x69fff1 in (anonymous namespace)::ModuleLinker::linkGlobalValueProto(llvm::GlobalValue*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1041:5
          #2 0x697229 in (anonymous namespace)::ModuleLinker::run() /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1485:9
          #3 0x696542 in llvm::Linker::linkInModule(llvm::Module*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1621:10
          #4 0x4a2db7 in main /usr/local/google/home/chandlerc/src/llvm/build/../tools/llvm-link/llvm-link.cpp:116:9
          #5 0x7f4ae61e5ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287
          #6 0x41eb71 in _start (/usr/local/google/home/chandlerc/src/llvm/build/bin/llvm-link+0x41eb71)
      
      0x60c00000b9c8 is located 72 bytes inside of 128-byte region [0x60c00000b980,0x60c00000ba00)
      freed by thread T0 here:
          #0 0x4a1e6b in operator delete(void*) /usr/local/google/home/chandlerc/src/llvm/opt-build/../projects/compiler-rt/lib/asan/asan_new_delete.cc:94:3
          #1 0x5d1a7a in llvm::iplist<llvm::GlobalVariable, llvm::ilist_traits<llvm::GlobalVariable> >::erase(llvm::ilist_iterator<llvm::GlobalVariable>) /usr/local/google/home/chandlerc/src/llvm/build/../inclu
      de/llvm/ADT/ilist.h:466:5
          #2 0x5d1980 in llvm::GlobalVariable::eraseFromParent() /usr/local/google/home/chandlerc/src/llvm/build/../lib/IR/Globals.cpp:204:3
          #3 0x6a8a4d in (anonymous namespace)::ModuleLinker::linkAppendingVarProto(llvm::GlobalVariable*, llvm::GlobalVariable const*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.
      cpp:980:3
          #4 0x6a7403 in (anonymous namespace)::ModuleLinker::linkGlobalVariableProto(llvm::GlobalVariable const*, llvm::GlobalValue*, bool) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkMod
      ules.cpp:1074:11
          #5 0x69ff4e in (anonymous namespace)::ModuleLinker::linkGlobalValueProto(llvm::GlobalValue*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1028:13
          #6 0x697229 in (anonymous namespace)::ModuleLinker::run() /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1485:9
          #7 0x696542 in llvm::Linker::linkInModule(llvm::Module*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1621:10
          #8 0x4a2db7 in main /usr/local/google/home/chandlerc/src/llvm/build/../tools/llvm-link/llvm-link.cpp:116:9
          #9 0x7f4ae61e5ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287
      
      previously allocated by thread T0 here:
          #0 0x4a192b in operator new(unsigned long) /usr/local/google/home/chandlerc/src/llvm/opt-build/../projects/compiler-rt/lib/asan/asan_new_delete.cc:62:35
          #1 0x61d85c in llvm::User::operator new(unsigned long, unsigned int) /usr/local/google/home/chandlerc/src/llvm/build/../lib/IR/User.cpp:57:19
          #2 0x6a7525 in (anonymous namespace)::ModuleLinker::linkGlobalVariableProto(llvm::GlobalVariable const*, llvm::GlobalValue*, bool) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkMod
      ules.cpp:1100:3
          #3 0x69ff4e in (anonymous namespace)::ModuleLinker::linkGlobalValueProto(llvm::GlobalValue*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1028:13
          #4 0x697229 in (anonymous namespace)::ModuleLinker::run() /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1485:9
          #5 0x696542 in llvm::Linker::linkInModule(llvm::Module*) /usr/local/google/home/chandlerc/src/llvm/build/../lib/Linker/LinkModules.cpp:1621:10
          #6 0x4a2db7 in main /usr/local/google/home/chandlerc/src/llvm/build/../tools/llvm-link/llvm-link.cpp:116:9
          #7 0x7f4ae61e5ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287
      
      SUMMARY: AddressSanitizer: heap-use-after-free /usr/local/google/home/chandlerc/src/llvm/build/../include/llvm/IR/GlobalValue.h:115 llvm::GlobalValue::setUnnamedAddr(bool)
      Shadow bytes around the buggy address:
        0x0c187fff96e0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
        0x0c187fff96f0: 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa
        0x0c187fff9700: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
        0x0c187fff9710: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
        0x0c187fff9720: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
      =>0x0c187fff9730: fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd
        0x0c187fff9740: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
        0x0c187fff9750: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa
        0x0c187fff9760: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
        0x0c187fff9770: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
        0x0c187fff9780: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa
      Shadow byte legend (one shadow byte represents 8 application bytes):
        Addressable:           00
        Partially addressable: 01 02 03 04 05 06 07
        Heap left redzone:       fa
        Heap right redzone:      fb
        Freed heap region:       fd
        Stack left redzone:      f1
        Stack mid redzone:       f2
        Stack right redzone:     f3
        Stack partial redzone:   f4
        Stack after return:      f5
        Stack use after scope:   f8
        Global redzone:          f9
        Global init order:       f6
        Poisoned by user:        f7
        Container overflow:      fc
        Array cookie:            ac
        ASan internal:           fe
      ==2122==ABORTING
      
      llvm-svn: 221096
      fd38af2d
    • Elena Demikhovsky's avatar
      Use Alias Analysis to hoist 2 loads from diamond to the common predecessor basic block. · 27152aea
      Elena Demikhovsky authored
      Alias Analysis allows to detect real barriers for load hoisting.
      
      Review in http://reviews.llvm.org/D5991
      
      llvm-svn: 221091
      27152aea
    • Rafael Espindola's avatar
      Update test to use llvm-readobj. NFC. · e3cfb6c7
      Rafael Espindola authored
      llvm-svn: 221074
      e3cfb6c7
    • David Blaikie's avatar
    • David Majnemer's avatar
      InstCombine: Don't assume that m_ZExt matches an Instruction · 634ca236
      David Majnemer authored
      m_ZExt might bind against a ConstantExpr instead of an Instruction.
      Assuming this, using cast<Instruction>, results in InstCombine crashing.
      
      Instead, introduce ZExtOperator to bridge both Instruction and
      ConstantExpr ZExts.
      
      This fixes PR21445.
      
      llvm-svn: 221069
      634ca236
    • David Blaikie's avatar
      Remove test coverage added in 221067 due to it being non-portable. · eed309da
      David Blaikie authored
      Will try to find a portable way to test this (or a fixed-target test I
      can add such coverage to) shortly.
      
      llvm-svn: 221068
      eed309da
    • David Blaikie's avatar
      Remove DwarfUnit::LabelEnd in favor of computing the length of the section directly · 983bfea0
      David Blaikie authored
      This was a compile-unit specific label (unused in type units) and seems
      unnecessary anyway when we can more easily directly compute the size of
      the compile unit.
      
      llvm-svn: 221067
      983bfea0
  3. Nov 01, 2014
  4. Oct 31, 2014
    • Michael Zolotukhin's avatar
      Correctly update dom-tree after loop vectorizer. · 9b9624de
      Michael Zolotukhin authored
      llvm-svn: 221009
      9b9624de
    • Tom Stellard's avatar
      R600: Don't promote allocas when one of the users is a ptrtoint instruction · 5b2927fe
      Tom Stellard authored
      We need to figure out how to track ptrtoint values all the
      way until result is converted back to a pointer in order
      to correctly rewrite the pointer type.
      
      llvm-svn: 220997
      5b2927fe
    • Tom Stellard's avatar
      R600: Make sure to inline all internal functions · aa738317
      Tom Stellard authored
      Function calls aren't supported yet.
      
      llvm-svn: 220996
      aa738317
    • Bill Schmidt's avatar
      [PowerPC] Initial VSX intrinsic support, with min/max for vector double · 1ca69fa6
      Bill Schmidt authored
      Now that we have initial support for VSX, we can begin adding
      intrinsics for programmer access to VSX instructions.  This patch adds
      basic support for VSX intrinsics in general, and tests it by
      implementing intrinsics for minimum and maximum for the vector double
      data type.
      
      The LLVM portion of this is quite straightforward.  There is a
      companion patch for Clang.
      
      llvm-svn: 220988
      1ca69fa6
    • Kostya Serebryany's avatar
      [asan] do not treat inline asm calls as indirect calls · ea48bdc7
      Kostya Serebryany authored
      llvm-svn: 220985
      ea48bdc7
    • Quentin Colombet's avatar
      [CodeGenPrepare] Move extractelement close to store if they can be combined. · c32615df
      Quentin Colombet authored
      This patch adds an optimization in CodeGenPrepare to move an extractelement
      right before a store when the target can combine them.
      The optimization may promote any scalar operations to vector operations in the
      way to make that possible.
      
      
      ** Context **
      
      Some targets use different register files for both vector and scalar operations.
      This means that transitioning from one domain to another may incur copy from one
      register file to another. These copies are not coalescable and may be expensive.
      For example, according to the scheduling model, on cortex-A8 a vector to GPR
      move is 20 cycles.
      
      
      ** Motivating Example **
      
      Let us consider an example:
      define void @foo(<2 x i32>* %addr1, i32* %dest) {
       %in1 = load <2 x i32>* %addr1, align 8
       %extract = extractelement <2 x i32> %in1, i32 1
       %out = or i32 %extract, 1
       store i32 %out, i32* %dest, align 4
       ret void
      }
      
      As it is, this IR generates the following assembly on armv7:
        vldr  d16, [r0]            @vector load  
        vmov.32 r0, d16[1]  @ cross-register-file copy: 20 cycles
        orr r0, r0, #1           @ scalar bitwise or
        str r0, [r1]               @ scalar store
        bx  lr
      
      Whereas we could generate much faster code:
        vldr  d16, [r0]               @ vector load
        vorr.i32  d16, #0x1     @ vector bitwise or
        vst1.32 {d16[1]}, [r1:32] @ vector extract + store
        bx  lr
      
      Half of the computation made in the vector is useless, but this allows to get
      rid of the expensive cross-register-file copy.
      
      
      ** Proposed Solution **
      
      To avoid this cross-register-copy penalty, we promote the scalar operations to
      vector operations. The penalty will be removed if we manage to promote the whole
      chain of computation in the vector domain.
      Currently, we do that only when the chain of computation ends by a store and the
      target is able to combine an extract with a store.
      
      Stores are the most likely candidates, because other instructions produce values
      that would need to be promoted and so, extracted as some point[1]. Moreover,
      this is customary that targets feature stores that perform a vector extract (see
      AArch64 and X86 for instance).
      
      The proposed implementation relies on the TargetTransformInfo to decide whether
      or not it is beneficial to promote a chain of computation in the vector domain.
      Unfortunately, this interface is rather inaccurate for this level of details and
      although this optimization may be beneficial for X86 and AArch64, the inaccuracy
      will lead to the optimization being too aggressive.
      Basically in TargetTransformInfo, everything that is legal has a cost of 1,
      whereas, even if a vector type is legal, usually a vector operation is slightly
      more expensive than its scalar counterpart. That will lead to too many
      promotions that may not be counter balanced by the saving of the
      cross-register-file copy. For instance, on AArch64 this penalty is just 4
      cycles.
      
      For now, the optimization is just enabled for ARM prior than v8, since those
      processors have a larger penalty on cross-register-file copies, and the scope is
      limited to basic blocks. Because of these two factors, we limit the effects of
      the inaccuracy. Indeed, I did not want to build up a fancy cost model with block
      frequency and everything on top of that.
      
      [1] We can imagine targets that can combine an extractelement with  other
      instructions than just stores. If we want to go into that direction, the current
      interfaces must be augmented and, moreover, I think this becomes a global isel
      problem.
      
      Differential Revision: http://reviews.llvm.org/D5921
      
      <rdar://problem/14170854>
      
      llvm-svn: 220978
      c32615df
    • Kostya Serebryany's avatar
    • Rafael Espindola's avatar
      Unify and update link-messages.ll and redefinition.ll. NFC. · 67926f10
      Rafael Espindola authored
      llvm-svn: 220968
      67926f10
    • Chad Rosier's avatar
      [AArch64] CondOpt pass is missing FCMP instructions when searching backward for · a675e550
      Chad Rosier authored
      a CMP which defines the flags used by B.CC.
      
      http://reviews.llvm.org/D6047
      Patch by Zhaoshi Zheng <zhaoshiz@codeaurora.org>!
      
      llvm-svn: 220961
      a675e550
    • Bradley Smith's avatar
      [SCEV] Improve Scalar Evolution's use of no {un,}signed wrap flags · 9992b167
      Bradley Smith authored
      In a case where we have a no {un,}signed wrap flag on the increment, if
      RHS - Start is constant then we can avoid inserting a max operation bewteen
      the two, since we can statically determine which is greater.
      
      This allows us to unroll loops such as:
      
       void testcase3(int v) {
         for (int i=v; i<=v+1; ++i)
           f(i);
       }
      
      llvm-svn: 220960
      9992b167
    • Ulrich Weigand's avatar
      [PowerPC] Load BlockAddress values from the TOC in 64-bit SVR4 code · c8c2ea28
      Ulrich Weigand authored
      Since block address values can be larger than 2GB in 64-bit code, they
      cannot be loaded simply using an @l / @ha pair, but instead must be
      loaded from the TOC, just like GlobalAddress, ConstantPool, and
      JumpTable values are.
      
      The commit also fixes a bug in PPCLinuxAsmPrinter::doFinalization where
      temporary labels could not be used as TOC values, since code would
      attempt (and fail) to use GetOrCreateSymbol to create a symbol of the
      same name as the temporary label.
      
      llvm-svn: 220959
      c8c2ea28
    • Peter Zotov's avatar
      [OCaml] Ensure consistent naming. · e2b8b143
      Peter Zotov authored
      Specifically:
        * Directories match module names.
        * Test names match module names.
        * The language is called "OCaml", not "Ocaml".
      
      llvm-svn: 220958
      e2b8b143
    • Peter Zotov's avatar
      [OCaml] Rework Llvm_executionengine using ctypes. · b1f54ff4
      Peter Zotov authored
      Since JIT->MCJIT migration, most of the ExecutionEngine interface
      became deprecated and/or broken. This especially affected the OCaml
      bindings, as runFunction is no longer available, and unlike in C,
      it is not possible to coerce a pointer to a function and call it
      in OCaml.
      
      In practice, LLVM 3.5 shipped completely unusable
      Llvm_executionengine.
      
      The GenericValue interface and runFunction were essentially
      a poor man's FFI. As such, this interface was removed and instead
      a dependency on ctypes >=0.3 added, which handled platform-specific
      aspects of accessing data and calling functions.
      
      The new interface does not expose JIT (which is a shim around MCJIT),
      as well as the interpreter (which can't handle a lot of valid IR).
      
      Llvm_executionengine.add_global_mapping is currently unusable
      due to PR20656.
      
      llvm-svn: 220957
      b1f54ff4
Loading