1. Jun 30, 2017
  2. Jun 29, 2017
    • Gheorghe-Teodor Bercea's avatar
      [OpenMP] Pass -fopenmp-is-device to preprocessing and machine specific code generation stages · 3addb7d8
      Gheorghe-Teodor Bercea authored
      Summary: The preprocessing and code generation and optimization stages of the compiler are also passed the "-fopenmp-is-device" flag. This is used to trigger machine specific preprocessing and code generation when performing device offloading to an NVIDIA GPU via OpenMP directives.
      
      Reviewers: arpith-jacob, caomhin, carlo.bertolli, Hahnfeld, hfinkel, tstellar
      
      Reviewed By: Hahnfeld
      
      Subscribers: Hahnfeld, rengolin
      
      Differential Revision: https://reviews.llvm.org/D29645
      
      llvm-svn: 306691
      3addb7d8
    • Krzysztof Parzyszek's avatar
      [Hexagon] Keep all phi nodes when building DFG in addr-mode-opt · 00894194
      Krzysztof Parzyszek authored
      The dead phis are needed for finding correct would-be reaching defs
      in register propagation.
      
      llvm-svn: 306690
      00894194
    • Gheorghe-Teodor Bercea's avatar
      [OpenMP] Add support for auxiliary triple specification · 59d7b77b
      Gheorghe-Teodor Bercea authored
      Summary: Device offloading requires the specification of an additional flag containing the triple of the //other// architecture the code is being compiled on if such an architecture exists. If compiling for the host, the auxiliary triple flag will contain the triple describing the device and vice versa.
      
      Reviewers: arpith-jacob, sfantao, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar
      
      Reviewed By: Hahnfeld
      
      Subscribers: rengolin, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D29339
      
      llvm-svn: 306689
      59d7b77b
    • Nirav Dave's avatar
      [DAG] Fold FrameIndex offset into BaseIndexOffset analysis. NFCI. · 168c5a6a
      Nirav Dave authored
      Relanding after restricting equalBaseIndex to not erroneuosly consider
      a FrameIndices stemming from alloca from being comparable as its
      offset is set post-selectionDAG.
      
      Pull FrameIndex comparision reasoning from DAGCombiner::isAlias to
      general BaseIndexOffset.
      
      llvm-svn: 306688
      168c5a6a
    • Eugene Leviant's avatar
      [llvm-objdump] Handle invalid instruction gracefully on ARM · 6269d39f
      Eugene Leviant authored
      Differential revision: https://reviews.llvm.org/D34813
      
      llvm-svn: 306687
      6269d39f
    • Pavel Labath's avatar
      Fix Mac build for the Timer move · 48090724
      Pavel Labath authored
      llvm-svn: 306686
      48090724
    • Yonghong Song's avatar
      bpf: remove unnecessary truncate operation · 5fbe01b1
      Yonghong Song authored
      
      
      For networking-type bpf program, it often needs to access
      packet data. A context data structure is provided to the bpf
      programs with two fields:
              u32 data;
              u32 data_end;
      User can access these two fields with ctx->data and ctx->data_end.
      During program verification process, the kernel verifier modifies
      the bpf program with loading of actual pointer value from kernel
      data structure.
          r = ctx->data      ===> r = actual data start ptr
          r = ctx->data_end  ===> r = actual data end ptr
      
      A typical program accessing ctx->data like
          char *data_ptr = (char *)(long)ctx->data
      will result in a 32-bit load followed by a zero extension.
      Such an operation is combined into a single LDW in DAG combiner
      as bpf LDW does zero extension automatically.
      
      In cases like the below (which can be a result of global value numbering
      and partial redundancy elimination before insn selection):
      B1:
         u32 a = load-32-bit &ctx->data
         u64 pa = zext a
         ...
      B2:
         u32 b = load-32-bit &ctx->data
         u64 pb = zext b
         ...
      B3:
         u32 m = PHI(a, b)
         u64 pm = zext m
      
      In B3, "pm = zext m" cannot be removed, which although is legal
      from compiler perspective, will generate incorrect code after
      kernel verification.
      
      This patch recognizes this pattern and traces through PHI node
      to see whether the operand of "zext m" is defined with LDWs or not.
      If it is, the "zext m" itself can be removed.
      
      The patch also recognizes the pattern where the load and use of
      the load value not in the same basic block, where truncate operation
      may be removed as well.
      
      The patch handles 1-byte, 2-byte and 4-byte truncation.
      
      Two test cases are added to verify the transformation happens properly
      for the above code pattern.
      
      Signed-off-by: default avatarYonghong Song <yhs@fb.com>
      llvm-svn: 306685
      5fbe01b1
    • Nikolai Bozhenov's avatar
      [NFC] Use stdin for some tests instead of positional argument. · 1925594e
      Nikolai Bozhenov authored
      Summary: Otherwise unexpected matches with the path to the tests might happen.
      
      Reviewers: rengolin, spatel, efriedma, RKSimon
      
      Reviewed By: spatel
      
      Subscribers: n.bozhenov, javed.absar, llvm-commits
      
      Patch by Andrei Elovikov <andrei.elovikov@intel.com>
      
      Differential Revision: https://reviews.llvm.org/D32994
      
      llvm-svn: 306684
      1925594e
    • Pavel Labath's avatar
      Android.rules: build x86 tests with -mstackrealign · 217a763b
      Pavel Labath authored
      All android builds systems have switched to -mstackrealign for building
      x86 binaries, so follow their cue with our mini build system.
      
      This presently breaks just one test (TestReturnValue), and this is due
      to a compiler bug, which has already been fixed in clang, but it hasn't
      made it yet into the official NDK compiler. While I'm touching that
      test, I also remove an android-specific XFAIL, which is not relevant
      anymore.
      
      llvm-svn: 306683
      217a763b
    • Pavel Labath's avatar
      Move Timer and TraceOptions from Core to Utility · 38d0632e
      Pavel Labath authored
      Summary:
      The classes have no dependencies, and they are used both by lldb and
      lldb-server, so it makes sense for them to live in the lowest layers.
      
      Reviewers: zturner, jingham
      
      Subscribers: emaste, mgorny, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D34746
      
      llvm-svn: 306682
      38d0632e
    • Daniel Neilson's avatar
      Restore original intent of memset instcombine test · aad1a6f0
      Daniel Neilson authored
      Summary:
      The original intent of test/Transforms/InstCombine/memset.ll was to test for lowering of llvm.memset into stores when the size of the memset is 1, 2, 4, or 8. Sometime between then and now the test has stopped testing for that, but remained passing due to testing for the absence of llvm.memset calls rather than the presence of store instructions. Right now this test ends up with an empty function body because the alloca is eliminated as safe-to-remove, which results in the llvm.memset calls's being eliminated due to their pointer args being undef; so it is not testing for conversion of llvm.memset into store instructions at all.
      
      This change alters the test to verify that store instructions are created, and moves the target of the memset to an arg of the proc to avoid it being eliminated as unused.
      
      Reviewers: anna, efriedma
      
      Reviewed By: efriedma
      
      Subscribers: efriedma, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D34642
      
      llvm-svn: 306681
      aad1a6f0
    • Alex Lorenz's avatar
      Fix NSAPI constants to reflect the current state of · 98d220e0
      Alex Lorenz authored
      NSStringMethodKind/NSDictionaryMethodKind enums
      
      Patch by Vladimir Voskresensky!
      
      Differential Revision: https://reviews.llvm.org/D34766
      
      llvm-svn: 306680
      98d220e0
    • Daniel Neilson's avatar
      Explicitly check for presence of correct results in instcombine memmove test · 82b01667
      Daniel Neilson authored
      Summary:
      Rather than testing for expected results, test/Transforms/InstCombine/memmove.ll is testing for the absence of calls to llvm.memmove.
      
      In the case of test3, the test has stopped testing for materialization of loads/stores, but remained passing due to testing for the absence of llvm.memset calls rather than the presence of load/store instructions. Right now this test ends up with an empty function body because the alloca is eliminated as safe-to-remove, which results in the llvm.memmove calls being eliminated due to a pointer arg being undef; so it is not testing for conversion of llvm.memmove into load/store instructions at all.
      
      Reviewers: eli.friedman, anna, efriedma
      
      Reviewed By: efriedma
      
      Subscribers: efriedma, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D34645
      
      llvm-svn: 306679
      82b01667
    • Hiroshi Inoue's avatar
      [PowerPC] fix potential verification error on __tls_get_addr · 6989caa9
      Hiroshi Inoue authored
      This patch fixes a verification error with -verify-machineinstrs while expanding __tls_get_addr by not creating ADJCALLSTACKUP and ADJCALLSTACKDOWN if there is another ADJCALLSTACKUP in this basic block since nesting ADJCALLSTACKUP/ADJCALLSTACKDOWN is not allowed.
      
      Here, ADJCALLSTACKUP and ADJCALLSTACKDOWN are created as a fence for instruction scheduling to avoid _tls_get_addr is scheduled before mflr in the prologue (https://bugs.llvm.org//show_bug.cgi?id=25839). So if another ADJCALLSTACKUP exists before _tls_get_addr, we do not need to create a new ADJCALLSTACKUP.
      
      Differential Revision: https://reviews.llvm.org/D34347
      
      llvm-svn: 306678
      6989caa9
    • George Rimar's avatar
      [DWARF] - Fix message reporting about broken relocation. · b25a09d0
      George Rimar authored
      Because of mistake introduced in r306517,
      wrong variable ("name" instead of "Name") was used
      in error message.
      As a result it reported section name instead of
      relocation name.
      
      This file still needs cleanup to match LLVM coding style
      and more tests I think.
      
      llvm-svn: 306677
      b25a09d0
    • Daniel Jasper's avatar
      Revert "r306529 - [X86] Correct dwarf unwind information in function epilogue" · 559aa753
      Daniel Jasper authored
      I am 99% sure that this breaks the PPC ASAN build bot:
      http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/3112/steps/64-bit%20check-asan/logs/stdio
      
      If it doesn't go back to green, we can recommit (and fix the original
      commit message at the same time :) ).
      
      llvm-svn: 306676
      559aa753
    • Florian Hahn's avatar
      [TBAA] Remove metadata keyword from IR examples in comments (NFC). · 8a44b7be
      Florian Hahn authored
      The metadata keyword has been removed from the IR.
      
      llvm-svn: 306675
      8a44b7be
    • Evgeny Astigeevich's avatar
      [TargetTransformInfo, API] Add a list of operands to TTI::getUserCost · 70ed78e5
      Evgeny Astigeevich authored
      The changes are a result of discussion of https://reviews.llvm.org/D33685.
      It solves the following problem:
      
      1. We can inform getGEPCost about simplified indices to help it with
         calculating the cost. But getGEPCost does not take into account the
         context which GEPs are used in.
      2. We have getUserCost which can take the context into account but we cannot
         inform about simplified indices.
      
      With the changes getUserCost will have access to additional information
      as getGEPCost has.
      
      The one parameter getUserCost is also provided.
      
      Differential Revision: https://reviews.llvm.org/D34057
      
      llvm-svn: 306674
      70ed78e5
    • Michael Zuckerman's avatar
      [Clang][X86][Goldmont]Adding new target-cpu: Goldmont · a046ef4c
      Michael Zuckerman authored
      [Clang-side] Connecting the GoldMont processor to his feature.
      
      
      Reviewers:
      1. igorb
      2. delena
      3. zvi
      
      
      Differential Revision: https://reviews.llvm.org/D34807
      
      llvm-svn: 306673
      a046ef4c
    • Krasimir Georgiev's avatar
      [clang-format] Fix parsing of msg{field}-style proto options · feeba610
      Krasimir Georgiev authored
      Summary:
      This patch makes the `{` in `msg_field{field: OK}` in a proto option scope be
      treated as an assignment operator. Previosly the added test case was formatted
      as:
      ```
      option (MyProto.options) = {
        field_a: OK
        field_b{field_c: OK} field_d: OKOKOK field_e: OK
      }
      ```
      
      Reviewers: djasper
      
      Reviewed By: djasper
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D34749
      
      llvm-svn: 306672
      feeba610
    • Pavel Labath's avatar
      Recommit "[Support] Add RetryAfterSignal helper function" · fe09f506
      Pavel Labath authored
      The difference from the previous version is the use of decltype, as the
      implementation of std::result_of in libc++ did not work correctly for
      variadic function like open(2).
      
      Original summary:
      This function retries an operation if it was interrupted by a signal
      (failed with EINTR). It's inspired by the TEMP_FAILURE_RETRY macro in
      glibc, but I've turned that into a template function. I've also added a
      fail-value argument, to enable the function to be used with e.g.
      fopen(3), which is documented to fail for any reason that open(2) can
      fail (which includes EINTR).
      
      The main user of this function will be lldb, but there were also a
      couple of uses within llvm that I could simplify using this function.
      
      Reviewers: zturner, silvas, joerg
      
      Subscribers: mgorny, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D33895
      
      llvm-svn: 306671
      fe09f506
    • Pavel Labath's avatar
      Make scripts/analyze-project-deps.py executable · 0e44cff1
      Pavel Labath authored
      llvm-svn: 306669
      0e44cff1
    • Pavel Labath's avatar
      [unittests] Add a helper function for getting an input file · 7ed3e22f
      Pavel Labath authored
      Summary:
      Fetching an input file required about five lines of code, and this was
      repeated in multiple unit tests, with slight variations. Add a helper
      function for doing that into the lldbUtilityMocks module (which I rename
      to lldbUtilityHelpers to commemorate the fact it includes more than
      mocks)
      
      Reviewers: zturner, eugene
      
      Subscribers: emaste, mgorny, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D34683
      
      llvm-svn: 306668
      7ed3e22f
    • Michael Kruse's avatar
      [ScopInfo] Do not use ScopStmt in Domain derivation of ScopInfo. NFC · 476f855e
      Michael Kruse authored
      
      
      ScopStmts were being used in the computation of the Domain of the SCoPs
      in ScopInfo. Once statements are split, there will not be a 1-to-1
      correspondence between Stmts and Basic blocks. Thus this patch avoids
      the use of getStmtFor() by creating a map of BB to InvalidDomain and
      using it to compute the domain of the statements.
      
      Contributed-by: default avatarNanidini Singhal <cs15mtech01004@iith.ac.in>
      
      Differential Revision: https://reviews.llvm.org/D33942
      
      llvm-svn: 306667
      476f855e
    • Pavel Labath's avatar
      [UnwindAssembly/x86] Add support for "lea imm(%ebp), %esp" pattern · 8996346b
      Pavel Labath authored
      Summary:
      The instruction pattern:
      and $-16, %esp
      sub $imm, %esp
      ...
      lea imm(%ebp), %esp
      
      appears when the compiler is realigning the stack (for example in
      main(), or almost everywhere with -mstackrealign switch). The "and"
      instruction is very difficult to model, but that's not necessary, as
      these frames are always %ebp-based (the compiler also needs a way to
      restore the original %esp). Therefore the plans we were generating for
      these function were almost correct already. The only place we were doing
      it wrong were the last instructions of the epilogue (usually just
      "ret"), where we had to revert to %esp-based unwinding, as the %ebp had
      been popped already.
      
      This was wrong because our "distance of esp from cfa" counter had picked
      up the "sub" instruction (and incremented the counter) but it had not
      seen that the register was reset by the "lea" instruction.
      
      This patch fixes that shortcoming, and adds a test for handling
      functions like this.
      
      I have not been able to tickle the compiler into producing a 64-bit
      function with this pattern, but I don't see a reason why it couldn't
      produce it, if it chose to, so I add a x86_64 test as well.
      
      Reviewers: jasonmolenda, tberghammer
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D34750
      
      llvm-svn: 306666
      8996346b
    • Igor Breger's avatar
      [GlobalISel][X86] Support vector type G_MERGE_VALUES selection. · 0cddd348
      Igor Breger authored
      Summary:
      Support vector type G_MERGE_VALUES selection. For now G_MERGE_VALUES marked as legal for any type, so nothing to do in legalizer.
      Split from https://reviews.llvm.org/D33665
      
      Reviewers: qcolombet, t.p.northover, zvi, guyblank
      
      Reviewed By: guyblank
      
      Subscribers: rovka, kristof.beyls, guyblank, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D33958
      
      llvm-svn: 306665
      0cddd348
    • Simon Pilgrim's avatar
      [X86][SSE] Dropped -mcpu from palignr tests · 9a68e69c
      Simon Pilgrim authored
      Use triple and attribute only for consistency 
      
      Add AVX tests as well
      
      llvm-svn: 306664
      9a68e69c
    • Simon Pilgrim's avatar
      [X86][SSE] Regenerate shuffle test with update_llc_test_checks.py · e2eacbfc
      Simon Pilgrim authored
      llvm-svn: 306663
      e2eacbfc
    • Simon Pilgrim's avatar
      [X86][SSE] Dropped -mcpu from vector shift tests · 0afe97f4
      Simon Pilgrim authored
      Use triple and attribute only for consistency 
      
      llvm-svn: 306662
      0afe97f4
    • Simon Pilgrim's avatar
      [X86][SSE] Dropped -mcpu from zero insertion tests · 91539ce2
      Simon Pilgrim authored
      Use triple and attribute only for consistency 
      
      llvm-svn: 306661
      91539ce2
    • NAKAMURA Takumi's avatar
      Revert r306653, "[OpenCL] Allow function declaration with empty argument list." · 0a6f7498
      NAKAMURA Takumi authored
      It broke bots.
      
      llvm-svn: 306660
      0a6f7498
    • Alex Lorenz's avatar
      [Tooling] FixedCompilationDatabase should be able to strip positional · e2863eca
      Alex Lorenz authored
      arguments when `-fsyntax-only` is used
      
      Previously, Clang failed to create a fixed compilation database when the
      compilation arguments use -fsyntax-only instead of -c. This commit fixes the
      issue by forcing Clang to look at the compilation job when stripping the
      positional arguments.
      
      Differential Revision: https://reviews.llvm.org/D34687
      
      llvm-svn: 306659
      e2863eca
    • Michael Zuckerman's avatar
      [LLVM][X86][Goldmont] Adding new target-cpu: Goldmont · 4bcb9c33
      Michael Zuckerman authored
      [LLVM SIDE]
      Connecting the GoldMont processor to his feature.
      
      Reviewers: 
      1. igorb
      2. zvi
      3. delena
      4. RKSimon
      5. craig.topper        
      
      Differential Revision: https://reviews.llvm.org/D34504
      
      llvm-svn: 306658
      4bcb9c33
    • NAKAMURA Takumi's avatar
      Test commit · 6936506f
      NAKAMURA Takumi authored
      llvm-svn: 306657
      6936506f
    • Ilya Biryukov's avatar
      [clangd] Run a test, searching for gcc install, only on Unix. · bb324b88
      Ilya Biryukov authored
      This should fix windows buildbots.
      
      llvm-svn: 306656
      bb324b88
    • Dinar Temirbulatov's avatar
      [SLPVectorizer] Introducing getTreeEntry() helper function [NFC] · 7b96266a
      Dinar Temirbulatov authored
      Differential Revision: https://reviews.llvm.org/D34756
      
      llvm-svn: 306655
      7b96266a
    • Florian Hahn's avatar
      [ARM] Add tGPRwithpc register class and use it for TBB/THH · 08fdd040
      Florian Hahn authored
      Summary:
      TBB and THH allow using a Thumb GPR or the PC as destination operand.
      A few machine verifier failures where due to those instructions not
      expecting PC as destination operand.
      
      Add -verify-machineinstrs to test/CodeGen/ARM/jump-table-tbh.ll to add
      test coverage even if expensive checks are disabled.
      
      
      
      Reviewers: MatzeB, t.p.northover, jmolloy
      
      Reviewed By: MatzeB
      
      Subscribers: aemerson, javed.absar, kristof.beyls, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D34610
      
      llvm-svn: 306654
      08fdd040
    • Alexey Bader's avatar
      [OpenCL] Allow function declaration with empty argument list. · 3d0c9788
      Alexey Bader authored
      Summary:
      does it make sense to enable K&R function declaration style for OpenCL?
      clang throws following error message for the declaration w/o arguments:
      
      ```
      int my_func();
      error: function with no prototype cannot use the spir_function calling convention
      ```
      
      Current way to fix this issue is to specify that parameter list is empty by using 'void':
      
      ```
      int my_func(void);
      ```
      
      Let me know what do you think about this patch.
      
      Reviewers: Anastasia, yaxunl
      
      Reviewed By: Anastasia
      
      Subscribers: cfe-commits, echuraev
      
      Differential Revision: https://reviews.llvm.org/D33681
      
      llvm-svn: 306653
      3d0c9788