Skip to content
  1. Oct 07, 2020
  2. Oct 06, 2020
    • Scott Linder's avatar
      [AMDGPU] Fix remaining kernel descriptor test · bf5c1d92
      Scott Linder authored
      Follow up on e4a9e4ef to fix a test I missed in the original patch.
      Committed as obvious.
      bf5c1d92
    • Scott Linder's avatar
      [AMDGPU] Emit correct kernel descriptor on big-endian hosts · e4a9e4ef
      Scott Linder authored
      Previously we wrote multi-byte values out as-is from host memory. Use
      the `emitIntN` helpers in `MCStreamer` to produce a valid descriptor
      irrespective of the host endianness.
      
      Reviewed By: arsenm, rochauha
      
      Differential Revision: https://reviews.llvm.org/D88858
      e4a9e4ef
    • Nikita Popov's avatar
      [MemCpyOpt] Use dereferenceable pointer helper · 616f5450
      Nikita Popov authored
      The call slot optimization has some home-grown code for checking
      whether the destination is dereferenceable. Replace this with the
      generic isDereferenceableAndAlignedPointer() helper.
      
      I'm not checking alignment here, because that is currently handled
      separately and may be an enforced alignment for allocas. The clean
      way of integrating that part would probably be to accept a callback
      in isDereferenceableAndAlignedPointer() for the actual isAligned check,
      which would then have a chance to use an enforced alignment instead.
      
      This allows the destination to be a GEP (among other things), though
      the two open TODOs may prevent it from working in practice.
      
      Differential Revision: https://reviews.llvm.org/D88805
      616f5450
    • Nikita Popov's avatar
      [MemCpyOpt] Check for throwing calls during call slot optimization · 6b441ca5
      Nikita Popov authored
      When performing call slot optimization for a non-local destination,
      we need to check whether there may be throwing calls between the
      call and the copy. Otherwise, the early write to the destination
      may be observable by the caller.
      
      This was already done for call slot optimization of load/store,
      but not for memcpys. For the sake of clarity, I'm moving this check
      into the common optimization function, even if that does need an
      additional instruction scan for the load/store case.
      
      As efriedma pointed out, this check is not sufficient due to
      potential accesses from another thread. This case is left as a TODO.
      
      Differential Revision: https://reviews.llvm.org/D88799
      6b441ca5
    • Fangrui Song's avatar
      [X86] .code16: temporarily set Mode32Bit when matching an instruction with the data32 prefix · 43c7dc52
      Fangrui Song authored
      PR47632
      
      This allows MC to match `data32 ...` as one instruction instead of two (data32 without insn + insn).
      
      The compatibility with GNU as improves: `data32 ljmp` will be matched as ljmpl.
      `data32 lgdt 4(%eax)` will be matched as `lgdtl` (prefixes: 0x67 0x66, instead
      of 0x66 0x67).
      
      GNU as supports many other `data32 *w` as `*l`. We currently just hard code
      `data32 callw` and `data32 ljmpw`.  Generalizing the suffix replacement is
      tricky and requires a think about the "bwlq" appending suffix rules in MatchAndEmitATTInstruction.
      
      Reviewed By: craig.topper
      
      Differential Revision: https://reviews.llvm.org/D88772
      43c7dc52
    • Dávid Bolvanský's avatar
    • Arthur Eubanks's avatar
      [BPF][NewPM] Make BPFTargetMachine properly adjust NPM optimizer pipeline · 40251fee
      Arthur Eubanks authored
      This involves porting BPFAbstractMemberAccess and BPFPreserveDIType to
      NPM, then adding them BPFTargetMachine::registerPassBuilderCallbacks
      (the NPM equivalent of adjustPassManager()).
      
      Reviewed By: yonghong-song, asbirlea
      
      Differential Revision: https://reviews.llvm.org/D88855
      40251fee
    • Arthur Eubanks's avatar
      [test][InstCombine][NewPM] Fix InstCombine tests under NPM · 8df17b4d
      Arthur Eubanks authored
      Some of these depended on analyses being present that aren't provided
      automatically in NPM.
      
      early_dce_clobbers_callgraph.ll was previously inlining a noinline function?
      
      cast-call-combine.ll relied on the legacy always-inline pass being a
      CGSCC pass and getting rerun.
      
      Reviewed By: asbirlea
      
      Differential Revision: https://reviews.llvm.org/D88187
      8df17b4d
    • Arthur Eubanks's avatar
      [test][NewPM] Make dead-uses.ll work under NPM · 61d4b342
      Arthur Eubanks authored
      This one is weird...
      
      globals-aa needs to be already computed at licm, or else a function pass
      can't run a module analysis and won't have access to globals-aa.
      But the globals-aa result is impacted by instcombine in a way that
      affects what the test is expecting. If globals-aa is computed before
      instcombine, it is cached and globals-aa used in licm won't contain the
      necessary info provided by instcombine.
      Another catch is that if we don't invalidate AAManager, it will use the
      cached AAManager that instcombine requested, which may not contain
      globals-aa. So we have to invalidate<aa> so that licm can recompute
      an AAManager with the globals-aa created by the require<globals-aa>.
      
      This is essentially the problem described in https://reviews.llvm.org/D84259.
      
      Reviewed By: asbirlea
      
      Differential Revision: https://reviews.llvm.org/D88118
      61d4b342
    • Johannes Doerfert's avatar
      [Attributor][FIX] Move assertion to make it not trivially fail · 4a7a9884
      Johannes Doerfert authored
      The idea of this assertion was to check the simplified value before we
      assign it, not after, which caused this to trivially fail all the time.
      4a7a9884
    • Johannes Doerfert's avatar
      [Attributor][FIX] Dead return values are not `noundef` · 04f69513
      Johannes Doerfert authored
      When we assume a return value is dead we might still visit return
      instructions via `Attributor::checkForAllReturnedValuesAndReturnInsts(..)`.
      When we do so the "returned value" is potentially simplified to `undef`
      as it is the assumed "returned value". This is a problem if there was a
      preexisting `noundef` attribute that will only be removed as we manifest
      the `undef` return value. We should not use this combination to derive
      `unreachable` though. Two test cases fixed.
      04f69513
Loading