Skip to content
  1. Feb 28, 2018
    • Simon Pilgrim's avatar
      [X86] Regenerate cmpxchg tests · c38756a9
      Simon Pilgrim authored
      Add 64-bit cmpxchg8b tests
      
      llvm-svn: 326380
      c38756a9
    • Sanjay Patel's avatar
      [InstCombine] simplify code for X * -1.0 --> -X; NFC · eaf5a120
      Sanjay Patel authored
      I've added random FMF to one of the tests to show those are propagated.
      
      llvm-svn: 326377
      eaf5a120
    • Jonas Devlieghere's avatar
      [GlobalOpt] don't change CC of musttail calle(e|r) · 9ca06455
      Jonas Devlieghere authored
      When the function has musttail call - its cc is fixed to be equal to the
      cc of the musttail callee. In such case (and in the case of the musttail
      callee), GlobalOpt should not change the cc to fastcc as it will break
      the invariant.
      
      This fixes PR36546
      
      Patch by: Fedor Indutny (indutny)
      
      Differential revision: https://reviews.llvm.org/D43859
      
      llvm-svn: 326376
      9ca06455
    • Craig Topper's avatar
      [X86] Lower extract_element from k-registers by bitcasting from v16i1 to i16... · e31b9d1e
      Craig Topper authored
      [X86] Lower extract_element from k-registers by bitcasting from v16i1 to i16 and extending/truncating.
      
      This is equivalent to what isel was doing anyway but by canonicalizing earlier we can remove some patterns.
      
      llvm-svn: 326375
      e31b9d1e
    • Simon Pilgrim's avatar
      [X86][AVX512] Improve support for signed saturation truncation stores · 72b86586
      Simon Pilgrim authored
      Matches what we already manage for unsigned saturation truncation stores
      
      Differential Revision: https://reviews.llvm.org/D43629
      
      llvm-svn: 326372
      72b86586
    • Krzysztof Parzyszek's avatar
      [Hexagon] Implement target feature +reserved-r19 · b1cdb60e
      Krzysztof Parzyszek authored
      llvm-svn: 326364
      b1cdb60e
    • Craig Topper's avatar
      [InstCombine] Split the FP constant code out of lookThroughFPExtensions and... · b95298b0
      Craig Topper authored
      [InstCombine] Split the FP constant code out of lookThroughFPExtensions and use nullptr as a sentinel
      
      Currently this code's control flow very much assumes that there are no meaningful checks after determining that it's a ConstantFP. So whenever it wants to stop it just does "return V". But V is also the variable name it uses when it wants to return a new value. So 'return V' appears multiple times with different meanings.
      
      This patch just moves all the code into a helper function and returns nullptr when it wants to stop.
      
      I've split this from D43774 while I try to figure out how to best handle the vector case there. But this change by itself at least seemed like a readability improvement.
      
      Differential Revision: https://reviews.llvm.org/D43833
      
      llvm-svn: 326361
      b95298b0
    • Lei Huang's avatar
      Losen time contraint to accommodate system loads · 9db7bd5c
      Lei Huang authored
      llvm-svn: 326359
      9db7bd5c
    • Dimitry Andric's avatar
      Fix llvm-config --system-libs output on FreeBSD and NetBSD · a73ed459
      Dimitry Andric authored
      Summary:
      For various reasons, CMake's detection mechanism for `backtrace()`
      returns an absolute path `/usr/lib/libexecinfo.so` on FreeBSD and
      NetBSD.
      
      Since `tools/llvm-config/CMakeLists.txt` only checks if system
      libraries start with `-`, this causes `llvm-config --system-libs` to
      produce the following incorrect output:
      
      ```
      -lrt -l/usr/lib/libexecinfo.so -ltinfo -lpthread -lz -lm
      ```
      
      Fix it by removing the path and the `lib` prefix, to make it look like a
      regular short library name, suitable for appending to a `-l` link flag.
      
      This also fixes the `Bindings/Go/go.test` test case, since that always
      died with "unable to find library -l/usr/lib/libexecinfo.so".
      
      Reviewers: chandlerc, emaste, joerg, krytarowski
      
      Reviewed By: krytarowski
      
      Subscribers: hans, bdrewery, mgorny, hintonda, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D42702
      
      llvm-svn: 326358
      a73ed459
    • Tim Renouf's avatar
      [AMDGPU] added writelane intrinsic · 2a99fa2c
      Tim Renouf authored
      Summary:
      For use by LLPC SPV_AMD_shader_ballot extension.
      
      The v_writelane instruction was already implemented for use by SGPR
      spilling, but I had to add an extra dummy operand tied to the
      destination, to represent that all lanes except the selected one keep
      the old value of the destination register.
      
      .ll test changes were due to schedule changes caused by that new
      operand.
      
      Differential Revision: https://reviews.llvm.org/D42838
      
      llvm-svn: 326353
      2a99fa2c
    • Vedant Kumar's avatar
      Fixed spelling mistake in comments of LLVM Analysis passes · d319674a
      Vedant Kumar authored
      Patch by Reshabh Sharma!
      
      Differential Revision: https://reviews.llvm.org/D43861
      
      llvm-svn: 326352
      d319674a
    • Vedant Kumar's avatar
      [InstrProfiling] Emit the runtime hook when no counters are lowered · 9a041a75
      Vedant Kumar authored
      The API verification tool tapi has difficulty processing frameworks
      which enable code coverage, but which have no code. The profile lowering
      pass does not emit the runtime hook in this case because no counters are
      lowered.
      
      While the hook is not needed for program correctness (the profile
      runtime doesn't have to be linked in), it's needed to allow tapi to
      validate the exported symbol set of instrumented binaries.
      
      It was not possible to add a workaround in tapi for empty binaries due
      to an architectural issue: tapi generates its expected symbol set before
      it inspects a binary. Changing that model has a higher cost than simply
      forcing llvm to always emit the runtime hook.
      
      rdar://36076904
      
      Differential Revision: https://reviews.llvm.org/D43794
      
      llvm-svn: 326350
      9a041a75
    • Artem Belevich's avatar
      [NVPTX] Removed always-true predicates in NVPTX. · 18a7c515
      Artem Belevich authored
      NVPTX stopped supporting GPUs older than sm_20 (Fermi) quite a while back.
      Removal of support of pre-Fermi GPUs made a lot of predicates in the NVPTX
      backend pointless as they can't ever be false any more.
      It's time to retire them. NFC intended.
      
      Differential Revision: https://reviews.llvm.org/D43843
      
      llvm-svn: 326349
      18a7c515
    • Roman Tereshin's avatar
      [GlobalISel] Print/Parse FailedISel MachineFunction property · 3054ecea
      Roman Tereshin authored
      FailedISel MachineFunction property is part of the CodeGen pipeline
      state as much as every other property, notably, Legalized,
      RegBankSelected, and Selected. Let's make that part of the state also
      serializable / de-serializable, so if GlobalISel aborts on some of the
      functions of a large module, but not the others, it could be easily seen
      and the state of the pipeline could be maintained through llc's
      invocations with -stop-after / -start-after.
      
      To make MIR printable and generally to not to break it too much too
      soon, this patch also defers cleaning up the vreg -> LLT map until
      ResetMachineFunctionPass.
      
      To make MIR with FailedISel: true also machine verifiable, machine
      verifier is changed so it treats a MIR-module as non-regbankselected and
      non-selected if there is FailedISel property set.
      
      Reviewers: qcolombet, ab
      
      Reviewed By: dsanders
      
      Subscribers: javed.absar, rovka, kristof.beyls, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D42877
      
      llvm-svn: 326343
      3054ecea
    • Chih-Hung Hsieh's avatar
      [TLS] use emulated TLS if the target supports only this mode · 9f9e4681
      Chih-Hung Hsieh authored
      Emulated TLS is enabled by llc flag -emulated-tls,
      which is passed by clang driver.
      When llc is called explicitly or from other drivers like LTO,
      missing -emulated-tls flag would generate wrong TLS code for targets
      that supports only this mode.
      Now use useEmulatedTLS() instead of Options.EmulatedTLS to decide whether
      emulated TLS code should be generated.
      Unit tests are modified to run with and without the -emulated-tls flag.
      
      Differential Revision: https://reviews.llvm.org/D42999
      
      llvm-svn: 326341
      9f9e4681
    • Nicholas Wilson's avatar
      [WebAssembly] Reorder symbol table to match MC order · 586320c0
      Nicholas Wilson authored
      This removes a TODO introduced in rL325860
      
      Differential Revision: https://reviews.llvm.org/D43685
      
      llvm-svn: 326334
      586320c0
    • Pablo Barrio's avatar
      [ARM] Lower lower saturate to 0 and lower saturate to -1 using bit-operations · 512f7ee3
      Pablo Barrio authored
      Summary:
      Expressions of the form x < 0 ? 0 :  x; and x < -1 ? -1 : x can be lowered using bit-operations instead of branching or conditional moves
      
      In thumb-mode this results in a two-instruction sequence, a shift followed by a bic or or while in ARM/thumb2 mode that has flexible second operand the shift can be folded into a single bic/or instructions. In most cases this results in smaller code and possibly less branches, and in no case larger than before.
      
      Patch by Martin Svanfeldt
      
      Reviewers: fhahn, pbarrio, rogfer01
      
      Reviewed By: pbarrio, rogfer01
      
      Subscribers: chrib, yroux, eugenis, efriedma, rogfer01, aemerson, javed.absar, kristof.beyls, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D42574
      
      llvm-svn: 326333
      512f7ee3
    • Sanjay Patel's avatar
      [InstCombine] auto-generate complete checks; NFC · 356e77f5
      Sanjay Patel authored
      llvm-svn: 326331
      356e77f5
    • Sanjay Patel's avatar
      [InstCombine] move invariant call out of loop; NFC · b3f4f626
      Sanjay Patel authored
      We really shouldn't need a 2-loop here at all, but that's another cleanup.
      
      llvm-svn: 326330
      b3f4f626
    • Sanjay Patel's avatar
      [InstCombine] move constant check into foldBinOpIntoSelectOrPhi; NFCI · 8fdd87f9
      Sanjay Patel authored
      Also, rename 'foldOpWithConstantIntoOperand' because that's annoyingly 
      vague. The constant check is redundant in some cases, but it allows 
      removing duplication for most of the calls.
      
      llvm-svn: 326329
      8fdd87f9
    • Alexey Bataev's avatar
      [DEBUGINFO] Add flag for DWARF2 or less to use sections as references. · 9de940b9
      Alexey Bataev authored
      Summary:
      Some targets does not support labels inside debug sections, but support
      references in form `section +|- offset`. Patch adds initial support
      for this. Also, this patch disables emission of all additional debug
        sections that may have labels inside of it (like pub sections and
        string tables).
      
      Reviewers: probinson, echristo
      
      Subscribers: JDevlieghere, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D43627
      
      llvm-svn: 326328
      9de940b9
    • Nicholas Wilson's avatar
      [WebAssembly] Fix copy-paste error in debugging string · 7e4eee98
      Nicholas Wilson authored
      llvm-svn: 326326
      7e4eee98
    • Simon Dardis's avatar
      [mips] Begin reworking instruction predicates for ISAs/encodings (1/N) · 4529aac2
      Simon Dardis authored
      The MIPS backend has inconsistent usage of instruction predicates
      for assembly and code generation. The issue arises from supporting three
      encodings, two (MIPS and microMIPS) of which have a near 1:1 instruction
      mapping across ISA revisions and a third encoding with a more restricted
      set of instructions (MIPS16e).
      
      To enforce consistent usage, each of the ISA_* adjectives has (or will
      have) the relevant encoding attached to it along the relevant ISA revision
      where the instruction is defined.
      
      Each instruction, pattern or alias will then have the correct ISA adjective
      attached to it, and the base instruction description classes will have any
      predicates relating to ISA encoding or revision removed.
      
      Pseudo instructions will also be guarded for the encoding or ABI that they are
      supported in.
      
      Finally, the hasStandardEncoding() / inMicroMipsMode() / inMips16Mode() methods
      of MipsSubtarget will be changed such that only one can be true at any one time.
      
      The result of this is that code generation and assembly will produce the
      correct encoding up front, while code generated from pseudo instructions
      and other inserted sequences of instructions will be able to rely on the mapping
      tables to produce the correct encoding. This should fix numerous bugs where
      the result 'happens' to be correct but has edge cases where microMIPS and MIPS
      have subtle differences (e.g. microMIPSR6 using 'j', 'jal' instructions.)
      
      This patch starts the process by changing most of the ISA adjectives to make
      use of the EncodingPredicate member of PredicateControl. Follow on patches
      will annotate instructions with their correct ISA adjective and eliminate
      the usage of "let Predicates = [..]", "let AdditionalPredicates = [..]" and
      "isCodeGenOnly = 1" in the cases where it was used to control instruction
      availability.
      
      Contributions from Nitesh Jain.
      
      Reviewers: atanasyan
      
      Differential Revision: https://reviews.llvm.org/D41434
      
      llvm-svn: 326322
      4529aac2
    • Alexander Ivchenko's avatar
      [GlobalIsel][X86] Support G_INTTOPTR instruction. · c01f7504
      Alexander Ivchenko authored
      Add legalization/selection for x86/x86_64 and
      corresponding tests.
      
      Reviewed By: igorb
      
      Differential Revision: https://reviews.llvm.org/D43622
      
      llvm-svn: 326320
      c01f7504
    • Xin Tong's avatar
      Fix typo. NFC · 256869d8
      Xin Tong authored
      llvm-svn: 326319
      256869d8
    • Xin Tong's avatar
      [MergeICmp] Fix a bug in MergeICmp that can lead to a block being processed more than once. · 8ba674e4
      Xin Tong authored
      Summary:
      Fix a bug in MergeICmp that can lead to a BCECmp block being processed more than once and eventually lead to a broken LLVM module.
      The problem is that if the non-constant value is not produced by the last block, the producer will be processed once when the its parent block
      is processed and second time when the last block is processed.
      
      We end up having 2 same BCECmpBlock in the merge queue. And eventually lead to a broken LLVM module.
      
      Reviewers: courbet, davide
      
      Reviewed By: courbet
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D43825
      
      llvm-svn: 326318
      8ba674e4
    • Klaus Kretzschmar's avatar
      [IR] - Make User construction exception safe · 60f57369
      Klaus Kretzschmar authored
      There are many instruction ctors that call the setName method of the Value base class, which can throw a bad_alloc exception in OOM situations. 
      In such situations special User delete operators are called which are not implemented yet.
      
      Example:
       Lets look at the construction of a CallInst instruction during IR generation:
      
      static CallInst *Create(FunctionType *Ty, Value *Func, ArrayRef<Value *> Args, .. ){
      ...
      
      return new (TotalOps, DescriptorBytes) CallInst(Ty, Func, Args, Bundles, NameStr, InsertBefore);
      
      }
      
      CallInst::CalInst(Value* Func, ...) {
      ...
      Op<-1>() = Func;
      ....
      setName(name); // throws
      ...
      }
      Op<-1>() returns a reference to a Use object of the CallInst instruction and the operator= inserts this use object into the UseList of Func. 
      The same object is removed from that UseList by calling the User::operator delete If the CallInst object is deleted. 
      Since setName can throw a bad_alloc exception (if LLVM_ENABLE_EXCEPTIONS is switched on), the unwind chain runs into assertions ("Constructor throws?") in 
      special User::operator deletes operators:
      
      operator delete(void* Usr, unsigned)
      operator delete(void* Usr, unsigned, bool)
      This situation can be fixed by simlpy calling the User::operator delete(void*) in these unimplemented methods.
      
      To ensure that this additional call succeeds all information that is necessary to calculate the storage pointer from the Usr address 
      must be restored in the special case that a sublass has changed this information, e.g. GlobalVariable can change the NumberOfOperands.
      
      Reviewd by: rnk
      
      Differential Revision: https://reviews.llvm.org/D42731
      
      llvm-svn: 326316
      60f57369
    • David Green's avatar
      [Dominators] Remove verifyDomTree and add some verifying for Post Dom Trees · 7c35de12
      David Green authored
      Removes verifyDomTree, using assert(verify()) everywhere instead, and
      changes verify a little to always run IsSameAsFreshTree first in order
      to print good output when we find errors. Also adds verifyAnalysis for
      PostDomTrees, which will allow checking of PostDomTrees it the same way
      we check DomTrees and MachineDomTrees.
      
      Differential Revision: https://reviews.llvm.org/D41298
      
      llvm-svn: 326315
      7c35de12
    • Alexander Ivchenko's avatar
      [GlobalIsel][X86] Support G_PTRTOINT instruction. · 46e07e36
      Alexander Ivchenko authored
      Add legalization/selection for x86/x86_64 and
      corresponding tests.
      
      Reviewed By: igorb
      
      Differential Revision: https://reviews.llvm.org/D43617
      
      llvm-svn: 326311
      46e07e36
    • Alex Bradbury's avatar
      [RISCV] Update two tests after r326208 · 1b2a0f43
      Alex Bradbury authored
      llvm-svn: 326309
      1b2a0f43
    • Craig Topper's avatar
      [X86] Don't use EXTRACT_ELEMENT from v1i1 with i8/i32 result type when we need... · 48d5ed26
      Craig Topper authored
      [X86] Don't use EXTRACT_ELEMENT from v1i1 with i8/i32 result type when we need to guarantee zeroes in the upper bits of return.
      
      An extract_element where the result type is larger than the scalar element type is semantically an any_extend of from the scalar element type to the result type. If we expect zeroes in the upper bits of the i8/i32 we need to mae sure those zeroes are explicit in the DAG.
      
      For these cases the best way to accomplish this is use an insert_subvector to pad zeroes to the upper bits of the v1i1 first. We extend to either v16i1(for i32) or v8i1(for i8). Then bitcast that to a scalar and finish with a zero_extend up to i32 if necessary. We can't extend past v16i1 because that's the largest mask size on KNL. But isel is smarter enough to know that a zext of a bitcast from v16i1 to i16 can use a KMOVW instruction. The insert_subvectors will be dropped during isel because we can determine that the producing instruction already zeroed the upper bits of the k-register.
      
      llvm-svn: 326308
      48d5ed26
    • Craig Topper's avatar
      [X86] Change the masked FPCLASS implementation to use AND instead of OR to... · ac799b05
      Craig Topper authored
      [X86] Change the masked FPCLASS implementation to use AND instead of OR to combine the mask results.
      
      While the description for the instruction does mention OR, its talking about how the individual classification test results are ORed together.
      
      The incoming mask is used as a zeroing write mask. If the bit is 1 the classification is written to the output. The bit is 0 the output is 0. This equivalent to an AND.
      
      Here is pseudocode from the intrinsics guide
      
      FOR j := 0 to 1
              i := j*64
              IF k1[j]
                      k[j] := CheckFPClass_FP64(a[i+63:i], imm8[7:0])
              ELSE
                      k[j] := 0
              FI
      ENDFOR
      k[MAX:2] := 0
      
      llvm-svn: 326306
      ac799b05
    • Andrew Zhogin's avatar
      [ARM] Cortex-A57 scheduler fix for ARM backend (missed 16-bit, v8.1/v8.2/v8.3,... · f8e88af1
      Andrew Zhogin authored
      [ARM] Cortex-A57 scheduler fix for ARM backend (missed 16-bit, v8.1/v8.2/v8.3, thumb and pseudo instructions)
      
      Added missed scheduling info for ARM Cortex A57 (AArch32) to have CompleteModel with this checkCompleteness fix: https://reviews.llvm.org/D43235.
      
      Reviewed By: RKSimon
      
      Differential Revision: https://reviews.llvm.org/D43808
      
      llvm-svn: 326304
      f8e88af1
    • Mohammad Shahid's avatar
      [SLP] Added new tests and updated existing for jumbled load, NFC. · ddeee12f
      Mohammad Shahid authored
      llvm-svn: 326303
      ddeee12f
    • Lang Hames's avatar
      [RuntimeDyld][MachO] Support ARM64_RELOC_BRANCH26 for BL instructions by · 6588f14a
      Lang Hames authored
      relaxing an assertion.
      
      llvm-svn: 326290
      6588f14a
    • Justin Bogner's avatar
      update_mir_test_checks: Use the regexes from UpdateTestChecks.common · 35a9d1b1
      Justin Bogner authored
      Some of the update_*_test_checks regexes have been moved into a
      library, so we might as well use them in update_mir_test_checks.
      Also includes minor bugfixes to the regexes that are there so we
      don't regress update_mir_test_checks
      
      llvm-svn: 326288
      35a9d1b1
    • Justin Bogner's avatar
      update_mir_test_checks: Drop support for vreg block checks · d3eccb54
      Justin Bogner authored
      Since vregs are printed in the instruction stream now, checking the
      vreg block is always redundant. Remove the temporary feature that
      allowed us to do that.
      
      This reverts r316134
      
      llvm-svn: 326284
      d3eccb54
    • Sam Clegg's avatar
      [WebAssembly] Remove DataSize from linking metadata section · 86b4a09a
      Sam Clegg authored
      Neither the linker nor the runtime need this information
      anymore.  We were originally using this to model BSS size
      but the plan is now to use the segment metadata to allow
      for BSS segments.
      
      Differential Revision: https://reviews.llvm.org/D41366
      
      llvm-svn: 326267
      86b4a09a
  2. Feb 27, 2018
Loading