1. Sep 09, 2019
  2. Sep 08, 2019
  3. Sep 07, 2019
    • Simon Atanasyan's avatar
    • Fangrui Song's avatar
      [ELF][MC] Set types of aliases of IFunc to STT_GNU_IFUNC · 72e99e63
      Fangrui Song authored
      ```
      .type  foo,@gnu_indirect_function
      .set   foo,foo_resolver
      
      .set foo2,foo
      .set foo3,foo2
      ```
      
      The types of foo2 and foo3 should be STT_GNU_IFUNC, but we currently
      resolve them to the type of foo_resolver. This patch fixes it.
      
      Differential Revision: https://reviews.llvm.org/D67206
      Patch by Senran Zhang
      
      llvm-svn: 371312
      72e99e63
    • Roman Lebedev's avatar
      [SimplifyCFG][NFC] Autogenerate PhiEliminate3.ll · 4e76f880
      Roman Lebedev authored
      llvm-svn: 371311
      4e76f880
    • Roman Lebedev's avatar
      [SimplifyCFG][NFC] Autogenerate two tests · 88bab08a
      Roman Lebedev authored
      llvm-svn: 371310
      88bab08a
    • Bjorn Pettersson's avatar
      [CodeGen] Handle SMULFIXSAT with scale zero in TargetLowering::expandFixedPointMul · d065c811
      Bjorn Pettersson authored
      Summary:
      Normally TargetLowering::expandFixedPointMul would handle
      SMULFIXSAT with scale zero by using an SMULO to compute the
      product and determine if saturation is needed (if overflow
      happened). But if SMULO isn't custom/legal it falls through
      and uses the same technique, using MULHS/SMUL_LOHI, as used
      for non-zero scales.
      
      Problem was that when checking for overflow (handling saturation)
      when not using MULO we did not expect to find a zero scale. So
      we ended up in an assertion when doing
        APInt::getLowBitsSet(VTSize, Scale - 1)
      
      This patch fixes the problem by adding a new special case for
      how saturation is computed when scale is zero.
      
      Reviewers: RKSimon, bevinh, leonardchan, spatel
      
      Reviewed By: RKSimon
      
      Subscribers: wuzish, nemanjai, hiraditya, MaskRay, jsji, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D67071
      
      llvm-svn: 371309
      d065c811
    • Bjorn Pettersson's avatar
      [Intrinsic] Add the llvm.umul.fix.sat intrinsic · 5e331e4c
      Bjorn Pettersson authored
      Summary:
      Add an intrinsic that takes 2 unsigned integers with
      the scale of them provided as the third argument and
      performs fixed point multiplication on them. The
      result is saturated and clamped between the largest and
      smallest representable values of the first 2 operands.
      
      This is a part of implementing fixed point arithmetic
      in clang where some of the more complex operations
      will be implemented as intrinsics.
      
      Patch by: leonardchan, bjope
      
      Reviewers: RKSimon, craig.topper, bevinh, leonardchan, lebedev.ri, spatel
      
      Reviewed By: leonardchan
      
      Subscribers: ychen, wuzish, nemanjai, MaskRay, jsji, jdoerfert, Ka-Ka, hiraditya, rjmccall, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D57836
      
      llvm-svn: 371308
      5e331e4c
    • Nikita Popov's avatar
      [X86] Fix pshuflw formation from repeated shuffle mask (PR43230) · 314893cc
      Nikita Popov authored
      Fix for https://bugs.llvm.org/show_bug.cgi?id=43230.
      
      When creating PSHUFLW from a repeated shuffle mask, we have to apply
      the checks to the repeated mask, not the original one. For the test
      case from PR43230 the inspected part of the original mask is all undef.
      
      Differential Revision: https://reviews.llvm.org/D67314
      
      llvm-svn: 371307
      314893cc
    • Nikita Popov's avatar
      [LVI] Look through extractvalue of insertvalue · fdc6977f
      Nikita Popov authored
      This addresses the issue mentioned on D19867. When we simplify
      with.overflow instructions in CVP, we leave behind extractvalue
      of insertvalue sequences that LVI no longer understands. This
      means that we can not simplify any instructions based on the
      with.overflow anymore (until some over pass like InstCombine
      cleans them up).
      
      This patch extends LVI extractvalue handling by calling
      SimplifyExtractValueInst (which doesn't do anything more than
      constant folding + looking through insertvalue) and using the block
      value of the simplification.
      
      A possible alternative would be to do something similar to
      SimplifyIndVars, where we instead directly try to replace
      extractvalue users of the with.overflow. This would need some
      additional structural changes to CVP, as it's currently not legal
      to remove anything but the current instruction -- we'd have to
      introduce a worklist with instructions scheduled for deletion or similar.
      
      Differential Revision: https://reviews.llvm.org/D67035
      
      llvm-svn: 371306
      fdc6977f
    • Nikita Popov's avatar
      [X86] Add test for PR43230; NFC · 5d02f259
      Nikita Popov authored
      llvm-svn: 371305
      5d02f259
    • Bjorn Pettersson's avatar
      [DwarfExpression] Disallow some rewrites to avoid undefined behavior · 2b698a13
      Bjorn Pettersson authored
      Summary:
      The value operand in DW_OP_plus_uconst/DW_OP_constu value can be
      large (it uses uint64_t as representation internally in LLVM).
      This means that in the uint64_t to int conversions, previously done
      by DwarfExpression::addMachineRegExpression, could lose information.
      Also, the negation done in "-Offset" was undefined behavior in case
      Offset was exactly INT_MIN.
      
      To avoid the above problems, we now avoid transformation like
       [Reg, DW_OP_plus_uconst, Offset] --> [DW_OP_breg, Offset]
      and
       [Reg, DW_OP_constu, Offset, DW_OP_plus]  --> [DW_OP_breg, Offset]
      when Offset > INT_MAX.
      
      And we avoid to transform
       [Reg, DW_OP_constu, Offset, DW_OP_minus] --> [DW_OP_breg,-Offset]
      when Offset > INT_MAX+1.
      
      The patch also adjusts DwarfCompileUnit::constructVariableDIEImpl
      to make sure that "DW_OP_constu, Offset, DW_OP_minus" is used
      instead of "DW_OP_plus_uconst, Offset" when creating DIExpressions
      with negative frame index offsets.
      
      Notice that this might just be the tip of the iceberg. There
      are lots of fishy handling related to these constants. I think both
      DIExpression::appendOffset and DIExpression::extractIfOffset may
      trigger undefined behavior for certain values.
      
      Reviewers: sdesmalen, rnk, JDevlieghere
      
      Reviewed By: JDevlieghere
      
      Subscribers: jholewinski, aprantl, hiraditya, ychen, uabelho, llvm-commits
      
      Tags: #debug-info, #llvm
      
      Differential Revision: https://reviews.llvm.org/D67263
      
      llvm-svn: 371304
      2b698a13
    • Bjorn Pettersson's avatar
      [DebugInfo] Pre-commit of test case for DW_OP_breg/DW_OP_fbreg folds · e85acf94
      Bjorn Pettersson authored
      This currently triggers undefined behavior if executed with an
      ubsan build. It is just a precommit of the test case to show that
      we got a problem.
      
      Fix is proposed in https://reviews.llvm.org/D67263 and plan is to
      commit the fix directly after this patch.
      
      llvm-svn: 371303
      e85acf94
    • Simon Pilgrim's avatar
      d7d8bb93
    • Roman Lebedev's avatar
      [SimplifyCFG][NFC] Make merge-cond-stores-cost.ll X86-specific, and rewrite it · 395f254b
      Roman Lebedev authored
      We clearly perform store-merging, even though div is really costly.
      
      llvm-svn: 371300
      395f254b
    • Fangrui Song's avatar
      [ELF][test] Improve tests · 0e79890d
      Fangrui Song authored
      Add file-level comments
      Delete insignificant addresses to make them more tolerant to layout changes
      Simplify test output
      
      Delete weak-undef-val.s - covered by relocation-undefined-weak.s
      Delete weak-undef-export.s - covered by additional test added to weak-undef.s
      Delete version-undef-sym.s - covered by undefined-versioned-symbol.s => version-symbol-undef.s
      Delete symbol-ordering-file2.s - covered by symbol-ordering-file.s
      Delete gotpcrelx.s - covered by gotpc-relax-und-dso.s => x86-64-gotpc-relax-und-dso.s
      
      llvm-svn: 371299
      0e79890d
    • Benjamin Kramer's avatar
      [Attributor] Make unimplemented method pure virtual. · 84c7904d
      Benjamin Kramer authored
      Otherwise the compiler mistakes it for a vtable anchor.
      
      llvm-svn: 371298
      84c7904d
    • Roman Lebedev's avatar
      [SimplifyCFG][NFC] Show that we don't consider the cost when merging cond stores · 0ff6d7f3
      Roman Lebedev authored
      We count instruction count in each BB's separately, not their cost.
      
      llvm-svn: 371297
      0ff6d7f3