Skip to content
  1. Oct 12, 2021
  2. Oct 11, 2021
  3. Oct 10, 2021
  4. Oct 09, 2021
  5. Oct 08, 2021
  6. Oct 07, 2021
    • Adrian Prantl's avatar
      Do not emit prologue_end for line 0 locs if there is a non-zero loc present · 9f93f2bf
      Adrian Prantl authored
      This change fixes a bug where the compiler generates a prologue_end
      for line 0 locs. That is because line 0 is not associated with any
      source location, so there should not be a prolgoue_end at a location
      that doesn't correspond to a source location.
      
      There were some LLVM tests that were explicitly checking for line 0
      prologue_end's as well since I believe that to be incorrect, I had to
      change those tests as well.
      
      Patch by Shubham Rastogi!
      
      Differential Revision: https://reviews.llvm.org/D110740
      9f93f2bf
    • Jay Foad's avatar
      [TargetPassConfig] Enable machine verification after miscellaneous passes · 097339b1
      Jay Foad authored
      In a couple of places machine verification was disabled for no apparent
      reason, probably just because an "addPass(..., false)" line was cut and
      pasted from elsewhere.
      
      After this patch the only remaining place where machine verification is
      disabled in the generic TargetPassConfig code, is after addPreEmitPass.
      097339b1
    • Jay Foad's avatar
    • Jay Foad's avatar
      3ff0a574
    • Jay Foad's avatar
      [PHIElimination] Account for INLINEASM_BR when inserting kills · 3c9dfba1
      Jay Foad authored
      When PHIElimination adds kills after lowering PHIs to COPYs it knows
      that some instructions after the inserted COPY might use the same
      SrcReg, but it was only looking at the terminator instructions at the
      end of the block, not at other instructions like INLINEASM_BR that can
      appear after the COPY insertion point.
      
      Since we have already called findPHICopyInsertPoint, which knows about
      INLINEASM_BR, we might as well reuse the insertion point that it
      calculated when looking for instructions that might use SrcReg.
      
      This fixes a machine verification failure if you force machine
      verification to run after PHIElimination (currently it is disabled for
      other reasons) when running
      test/CodeGen/X86/callbr-asm-phi-placement.ll.
      
      Differential Revision: https://reviews.llvm.org/D110834
      3c9dfba1
    • Amara Emerson's avatar
      [GlobalISel] Port the udiv -> mul by constant combine. · 8bfc0e06
      Amara Emerson authored
      This is a straight port from the equivalent DAG combine.
      
      Differential Revision: https://reviews.llvm.org/D110890
      8bfc0e06
    • Jay Foad's avatar
      [MIRParser] Add support for IsInlineAsmBrIndirectTarget · 548b01c7
      Jay Foad authored
      Print this basic block flag as inlineasm-br-indirect-target and parse
      it. This allows you to write MIR test cases for INLINEASM_BR. The test
      case I added is one that I wanted to precommit anyway for D110834.
      
      Differential Revision: https://reviews.llvm.org/D111291
      548b01c7
    • Bradley Smith's avatar
    • Jack Andersen's avatar
      [MachineInstr] Move MIParser's DBG_VALUE RegState::Debug invariant into MachineInstr::addOperand · bd4dad87
      Jack Andersen authored
      Based on the reasoning of D53903, register operands of DBG_VALUE are
      invariably treated as RegState::Debug operands. This change enforces
      this invariant as part of MachineInstr::addOperand so that all passes
      emit this flag consistently.
      
      RegState::Debug is inconsistently set on DBG_VALUE registers throughout
      LLVM. This runs the risk of a filtering iterator like
      MachineRegisterInfo::reg_nodbg_iterator to process these operands
      erroneously when not parsed from MIR sources.
      
      This issue was observed in the development of the llvm-mos fork which
      adds a backend that relies on physical register operands much more than
      existing targets. Physical RegUnit 0 has the same numeric encoding as
      $noreg (indicating an undef for DBG_VALUE). Allowing debug operands into
      the machine scheduler correlates $noreg with RegUnit 0 (i.e. a collision
      of register numbers with different zero semantics). Eventually, this
      causes an assert where DBG_VALUE instructions are prohibited from
      participating in live register ranges.
      
      Reviewed By: MatzeB, StephenTozer
      
      Differential Revision: https://reviews.llvm.org/D110105
      bd4dad87
    • Carl Ritson's avatar
      [MachineCopyPropagation] Handle propagation of undef copies · b5d6ad20
      Carl Ritson authored
      When propagating undefined copies the undef flag must also be
      propagated.
      
      Reviewed By: foad
      
      Differential Revision: https://reviews.llvm.org/D111219
      b5d6ad20
    • Jay Foad's avatar
      [TwoAddressInstruction] Fix ReplacedAllUntiedUses in processTiedPairs · df2d4bc4
      Jay Foad authored
      Fix the calculation of ReplacedAllUntiedUses when any of the tied defs
      are early-clobber. The effect of this is to fix the placement of kill
      flags on an instruction like this (from @f2 in
       test/CodeGen/SystemZ/asm-18.ll):
      
        INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], killed %4:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit
      
      After TwoAddressInstruction without this patch:
      
        %3:grh32bit = COPY killed %4:grh32bit
        INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], %3:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit
      
      Note that the COPY kills %4, even though there is a later use of %4 in
      the INLINEASM. This fails machine verification if you force it to run
      after TwoAddressInstruction (currently it is disabled for other
      reasons).
      
      After TwoAddressInstruction with this patch:
      
        %3:grh32bit = COPY %4:grh32bit
        INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], %3:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit
      
      Differential Revision: https://reviews.llvm.org/D110848
      df2d4bc4
    • Mikael Holmen's avatar
    • Itay Bookstein's avatar
      [IR][NFC] Rename getBaseObject to getAliaseeObject · 40ec1c0f
      Itay Bookstein authored
      To better reflect the meaning of the now-disambiguated {GlobalValue,
      GlobalAlias}::getBaseObject after breaking off GlobalIFunc::getResolverFunction
      (D109792), the function is renamed to getAliaseeObject.
      40ec1c0f
    • David Blaikie's avatar
      DebugInfo: Use clang's preferred names for integer types · f6a561c4
      David Blaikie authored
      This reverts c7f16ab3 / r109694 - which
      suggested this was done to improve consistency with the gdb test suite.
      Possible that at the time GCC did not canonicalize integer types, and so
      matching types was important for cross-compiler validity, or that it was
      only a case of over-constrained test cases that printed out/tested the
      exact names of integer types.
      
      In any case neither issue seems to exist today based on my limited
      testing - both gdb and lldb canonicalize integer types (in a way that
      happens to match Clang's preferred naming, incidentally) and so never
      print the original text name produced in the DWARF by GCC or Clang.
      
      This canonicalization appears to be in `integer_types_same_name_p` for
      GDB and in `TypeSystemClang::GetBasicTypeEnumeration` for lldb.
      
      (I tested this with one translation unit defining 3 variables - `long`,
      `long (*)()`, and `int (*)()`, and another translation unit that had
      main, and a function that took `long (*)()` as a parameter - then
      compiled them with mismatched compilers (either GCC+Clang, or
      Clang+(Clang with this patch applied)) and no matter the combination,
      despite the debug info for one CU naming the type "long int" and the
      other naming it "long", both debuggers printed out the name as "long"
      and were able to correctly perform overload resolution and pass the
      `long int (*)()` variable to the `long (*)()` function parameter)
      
      Did find one hiccup, identified by the lldb test suite - that CodeView
      was relying on these names to map them to builtin types in that format.
      So added some handling for that in LLVM. (these could be split out into
      separate patches, but seems small enough to not warrant it - will do
      that if there ends up needing any reverti/revisiting)
      
      Differential Revision: https://reviews.llvm.org/D110455
      f6a561c4
  7. Oct 06, 2021
    • Arthur Eubanks's avatar
      Reland [IR] Increase max alignment to 4GB · 05392466
      Arthur Eubanks authored
      Currently the max alignment representable is 1GB, see D108661.
      Setting the align of an object to 4GB is desirable in some cases to make sure the lower 32 bits are clear which can be used for some optimizations, e.g. https://crbug.com/1016945.
      
      This uses an extra bit in instructions that carry an alignment. We can store 15 bits of "free" information, and with this change some instructions (e.g. AtomicCmpXchgInst) use 14 bits.
      We can increase the max alignment representable above 4GB (up to 2^62) since we're only using 33 of the 64 values, but I've just limited it to 4GB for now.
      
      The one place we have to update the bitcode format is for the alloca instruction. It stores its alignment into 5 bits of a 32 bit bitfield. I've added another field which is 8 bits and should be future proof for a while. For backward compatibility, we check if the old field has a value and use that, otherwise use the new field.
      
      Updating clang's max allowed alignment will come in a future patch.
      
      Reviewed By: hans
      
      Differential Revision: https://reviews.llvm.org/D110451
      05392466
    • Arthur Eubanks's avatar
      Revert "Reland [IR] Increase max alignment to 4GB" · 569346f2
      Arthur Eubanks authored
      This reverts commit 8d64314f.
      569346f2
    • Arthur Eubanks's avatar
      Reland [IR] Increase max alignment to 4GB · 8d64314f
      Arthur Eubanks authored
      Currently the max alignment representable is 1GB, see D108661.
      Setting the align of an object to 4GB is desirable in some cases to make sure the lower 32 bits are clear which can be used for some optimizations, e.g. https://crbug.com/1016945.
      
      This uses an extra bit in instructions that carry an alignment. We can store 15 bits of "free" information, and with this change some instructions (e.g. AtomicCmpXchgInst) use 14 bits.
      We can increase the max alignment representable above 4GB (up to 2^62) since we're only using 33 of the 64 values, but I've just limited it to 4GB for now.
      
      The one place we have to update the bitcode format is for the alloca instruction. It stores its alignment into 5 bits of a 32 bit bitfield. I've added another field which is 8 bits and should be future proof for a while. For backward compatibility, we check if the old field has a value and use that, otherwise use the new field.
      
      Updating clang's max allowed alignment will come in a future patch.
      
      Reviewed By: hans
      
      Differential Revision: https://reviews.llvm.org/D110451
      8d64314f
    • Arthur Eubanks's avatar
      Revert "[IR] Increase max alignment to 4GB" · 72cf8b60
      Arthur Eubanks authored
      This reverts commit df84c1fe.
      
      Breaks some bots
      72cf8b60
    • Arthur Eubanks's avatar
      [IR] Increase max alignment to 4GB · df84c1fe
      Arthur Eubanks authored
      Currently the max alignment representable is 1GB, see D108661.
      Setting the align of an object to 4GB is desirable in some cases to make sure the lower 32 bits are clear which can be used for some optimizations, e.g. https://crbug.com/1016945.
      
      This uses an extra bit in instructions that carry an alignment. We can store 15 bits of "free" information, and with this change some instructions (e.g. AtomicCmpXchgInst) use 14 bits.
      We can increase the max alignment representable above 4GB (up to 2^62) since we're only using 33 of the 64 values, but I've just limited it to 4GB for now.
      
      The one place we have to update the bitcode format is for the alloca instruction. It stores its alignment into 5 bits of a 32 bit bitfield. I've added another field which is 8 bits and should be future proof for a while. For backward compatibility, we check if the old field has a value and use that, otherwise use the new field.
      
      Updating clang's max allowed alignment will come in a future patch.
      
      Reviewed By: hans
      
      Differential Revision: https://reviews.llvm.org/D110451
      df84c1fe
Loading