Skip to content
  1. Aug 19, 2014
    • Duncan P. N. Exon Smith's avatar
      IR: Reduce RAUW traffic in ConstantVector · 687744d0
      Duncan P. N. Exon Smith authored
      Avoid creating a new `ConstantVector` on an RAUW of one of its members.
      This reduces RAUW traffic on any containing constant.
      
      This is part of PR20515.
      
      llvm-svn: 215966
      687744d0
    • Duncan P. N. Exon Smith's avatar
      IR: Fix ConstantArray::replaceUsesOfWithOnConstant() · b11cd6fb
      Duncan P. N. Exon Smith authored
      Previously, `ConstantArray::replaceUsesOfWithOnConstant()` neglected to
      check whether it becomes a `ConstantDataArray`.  Call
      `ConstantArray::getImpl()` to check for that.
      
      llvm-svn: 215965
      b11cd6fb
    • Duncan P. N. Exon Smith's avatar
      IR: Factor out replaceUsesOfWithOnConstantImpl(), NFC · d8c60542
      Duncan P. N. Exon Smith authored
      Factor out common code, and take advantage of the new function to
      add early returns to the callers.
      
      llvm-svn: 215964
      d8c60542
    • Duncan P. N. Exon Smith's avatar
      IR: Split up Constant{Array,Vector}::get(), NFC · 1c6a963d
      Duncan P. N. Exon Smith authored
      Introduce `getImpl()` that tries the simplification logic from `get()`
      and then gives up.  This allows the logic to be reused elsewhere in a
      follow-up commit.
      
      llvm-svn: 215963
      1c6a963d
    • Akira Hatanaka's avatar
    • Peter Collingbourne's avatar
      DFSan's set label function should avoid writing to the shadow memory when the... · 82ff058c
      Peter Collingbourne authored
      DFSan's set label function should avoid writing to the shadow memory when the write would not change the value in memory.
      
      When writing a label to shadow memory, don't write if the value is already set to the value being written.  This dramatically reduces real memory consumption in programs with sparse use of labels.
      
      Test Plan: It would be nice to test that unnecessary writes are skipped, but I do not see how a unit test could do this.
      
      Patch by Sam Kerner!
      
      Differential Revision: http://reviews.llvm.org/D4894
      
      llvm-svn: 215961
      82ff058c
    • Duncan P. N. Exon Smith's avatar
      IR: Reduce RAUW traffic in ConstantExpr · dfd04582
      Duncan P. N. Exon Smith authored
      Avoid RAUW-ing `ConstantExpr` when an operand changes unless the new
      `ConstantExpr` already has users.  This prevents the RAUW from rippling
      up the expression tree unnecessarily.
      
      This commit indirectly adds test coverage for r215953 (this is how I
      came across the bug).
      
      This is part of PR20515.
      
      llvm-svn: 215960
      dfd04582
    • Duncan P. N. Exon Smith's avatar
      IR: Replace uses of ConstantAggrUniqueMap with ConstantUniqueMap · 344ebf7c
      Duncan P. N. Exon Smith authored
      Now that `ConstantAggrUniqueMap` and `ConstantUniqueMap` work the same
      way, change the aggregates to use the new one.
      
      llvm-svn: 215959
      344ebf7c
    • Duncan P. N. Exon Smith's avatar
      Remove extraneous typenames from r215957 · 864ccec4
      Duncan P. N. Exon Smith authored
      llvm-svn: 215958
      864ccec4
    • Duncan P. N. Exon Smith's avatar
      IR: Rewrite ConstantUniqueMap · 8d12558b
      Duncan P. N. Exon Smith authored
      Rewrite `ConstantUniqueMap` to be more similar to
      `ConstantAggrUniqueMap`.
      
        - Use a `DenseMap` with custom MapInfo instead of a `std::map` with
          linear lookups and deletion.
        - Don't waste memory explicitly storing (heavyweight) keys.
      
      Only `ConstantExpr` and `InlineAsm` actually use this data structure, so
      I also updated them to use it.
      
      This code cleanup is a precursor to reducing RAUW traffic on
      `ConstantExpr` -- I felt badly adding a new (linear) call to
      `ConstantUniqueMap::FindExistingKey`, so this designs away the concern.
      
      A follow-up commit will transition the users of `ConstantAggrUniqueMap`
      over.
      
      llvm-svn: 215957
      8d12558b
    • Duncan P. N. Exon Smith's avatar
      IR: Declare LookupKey right before its use, NFC · 3fa26b76
      Duncan P. N. Exon Smith authored
      llvm-svn: 215956
      3fa26b76
    • Duncan P. N. Exon Smith's avatar
      IR: ArrayRef-ize {Insert,Extract}ValueConstantExpr constructors · 1cd4aebe
      Duncan P. N. Exon Smith authored
      No functionality change.
      
      llvm-svn: 215955
      1cd4aebe
    • Duncan P. N. Exon Smith's avatar
      25fb110f
    • Duncan P. N. Exon Smith's avatar
      NVPTX: Use RAUW instead of reinventing the wheel · 7b859ff2
      Duncan P. N. Exon Smith authored
      This code had a homemade RAUW that was incorrect when a user was a
      constant: instead of calling `replaceUsersWithOnConstant()` it would
      incorrectly update the operand in-place, invalidating
      `LLVMContextImpl::ExprConstants`.  RAUW does the job better.
      
      The ValueHandle that `GVMap` is holding onto needs to be removed first,
      so this commit also removes each variable from the map on-the-fly.
      
      Since deletions from `ExprConstants` use a linear search that compares
      directly on the pointer value (instead of using the key), there isn't an
      obvious way to expose this with a testcase.
      
      llvm-svn: 215953
      7b859ff2
    • Duncan P. N. Exon Smith's avatar
      LLParser: Handle BlockAddresses on-the-fly · 17169908
      Duncan P. N. Exon Smith authored
      Previously all `blockaddress()` constants were treated as forward
      references.  They were resolved twice:  once at the end of the function
      in question, and again at the end of the module.  Furthermore, if the
      same blockaddress was referenced N times, the parser created N distinct
      `GlobalVariable`s (one for each reference).
      
      Instead, resolve all block addresses at the beginning of the function,
      creating the standard `BasicBlock` forward references used for all other
      basic block references.  After the function, all references can be
      resolved immediately.  To check for the condition of parsing block
      addresses from within the same function, I created a reference to the
      current per-function-state in `BlockAddressPFS`.
      
      Also, create only one forward-reference per basic block.  Because
      forward references to block addresses are rare, the data structure here
      shouldn't matter.  If somehow it does someday, this can be pretty easily
      changed to a `DenseMap<std::pair<ValID, ValID>, GV>`.
      
      This is part of PR20515.
      
      llvm-svn: 215952
      17169908
    • Duncan P. N. Exon Smith's avatar
      verify-uselistorder: Call verifyModule() and improve output · 8e366958
      Duncan P. N. Exon Smith authored
      Call `verifyModule()` after parsing and after every transformation.
      Also convert some `DEBUG(dbgs())` to `errs()` to increase visibility
      into what's going on.
      
      llvm-svn: 215951
      8e366958
    • Jon Roelofs's avatar
      libcxxabi must link to dl if using bundled unwind · 79b57011
      Jon Roelofs authored
      Patch by Ismail Donmez
      http://reviews.llvm.org/D4953
      
      llvm-svn: 215950
      79b57011
    • Alexey Samsonov's avatar
      [LSan] Parse common flags from LSAN_OPTIONS even if LSan is combined with · 2e390279
      Alexey Samsonov authored
      another sanitizer.
      
      A user may run both LSan and LSan+ASan. It is weird to pass path to leak
      suppression file (or other common sanitizer flags, like "verbosity") in
      "LSAN_OPTIONS" in the first case and in "ASAN_OPTIONS" in the second case.
      
      llvm-svn: 215949
      2e390279
    • Rafael Espindola's avatar
      Use a range loop. NFC. · 57d9ab64
      Rafael Espindola authored
      llvm-svn: 215948
      57d9ab64
    • Gerolf Hoflehner's avatar
      [clang-rename] revert r215839 · 62bf7e83
      Gerolf Hoflehner authored
      The commit broke public build bots for more than 24 hours.
      
      (view as text)
      ******************** TEST 'Clang Tools :: clang-rename/VarTest.cpp' FAILED ********************
      Script:
      --
      cat /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang.src/tools/extra/test/clang-rename/VarTest.cpp > /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp
      clang-rename -offset=$(grep -FUbo 'foo;' /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp | head -1 | cut -d: -f1) -new-name=hector /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp -i --
      sed 's,//.*,,' /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp | FileCheck /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang.src/tools/extra/test/clang-rename/VarTest.cpp
      --
      Exit Code: 1
      
      Command Output (stderr):
      --
      clang-rename: could not find symbol at /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp:2:1 (offset 14).
      
      llvm-svn: 215947
      62bf7e83
    • Nico Weber's avatar
      Add a warning flag for an existing diagnostic. · f69cba64
      Nico Weber authored
      One more, and the number of flags without a dedicated flag fits in two decimal
      digits :-)
      
      llvm-svn: 215946
      f69cba64
    • Rafael Espindola's avatar
      These classes only need a StringRef, not a MemoryBuffer. · 43d22b83
      Rafael Espindola authored
      llvm-svn: 215945
      43d22b83
    • Rafael Espindola's avatar
      Delete unused method. · 7342ca41
      Rafael Espindola authored
      llvm-svn: 215944
      7342ca41
    • Robin Morisset's avatar
      Answer to Philip Reames comments · 9e98e7f7
      Robin Morisset authored
      - add check for volatile (probably unneeded, but I agree that we should be conservative about it).
      - strengthen condition from isUnordered() to isSimple(), as I don't understand well enough Unordered semantics (and it also matches the comment better this way) to be confident in the previous behaviour (thanks for catching that one, I had missed the case Monotonic/Unordered).
      - separate a condition in two.
      - lengthen comment about aliasing and loads
      - add tests in GVN/atomic.ll
      
      llvm-svn: 215943
      9e98e7f7
    • Robin Morisset's avatar
      Weak relaxing of the constraints on atomics in MemoryDependencyAnalysis · 4ffe8aaa
      Robin Morisset authored
      Monotonic accesses do not have to kill the analysis, as long as the QueryInstr is not
      itself atomic.
      
      llvm-svn: 215942
      4ffe8aaa
    • Alexey Samsonov's avatar
      Add regression test for PR15823 · 00c02b29
      Alexey Samsonov authored
      llvm-svn: 215941
      00c02b29
    • Alexey Samsonov's avatar
      Update link strategy for sanitizer runtime libraries on Linux: · c4f1fc2a
      Alexey Samsonov authored
      1. Always put static sanitizer runtimes to the front of the linker
      invocation line. This was already done for all sanitizers except UBSan:
      in case user provides static libstdc++ we need to make sure that new/delete
      operator definitions are picked from sanitizer runtimes instead of libstdc++.
      We have to put UBSan runtime first for similar reasons: it depends on some
      libstdc++ parts (e.g. __dynamic_cast function), and has to go first in
      link line to ensure these functions will be picked up from libstdc++.
      
      2. Put sanitizer libraries system dependencies (-ldl, -lpthread etc.) right
      after sanitizer runtimes. This will ensure these libraries participate in
      the link even if user provided -Wl,-as-needed flag. This should fix PR15823.
      
      3. In case we link in several sanitizer runtimes (e.g. "ubsan", "ubsan_cxx"
      and "san"), add system dependencies (-ldl, -lpthread, ...) only once.
      
      llvm-svn: 215940
      c4f1fc2a
    • Alexey Samsonov's avatar
      [TSan] Add -lpthread to the test which uses pthread_ functions · 591d1527
      Alexey Samsonov authored
      llvm-svn: 215939
      591d1527
  2. Aug 18, 2014
Loading