Skip to content
  1. Mar 04, 2014
  2. Mar 02, 2014
  3. Mar 01, 2014
    • Hal Finkel's avatar
      Remove extra truncs/exts around i32 bit operations on PPC64 · 46043edc
      Hal Finkel authored
      This generalizes the code to eliminate extra truncs/exts around i1 bit
      operations to also do the same on PPC64 for i32 bit operations. This eliminates
      a fairly prevalent code wart:
      
      int foo(int a) {
        return a == 5 ? 7 : 8;
      }
      
      On PPC64, because of the extension implied by the ABI, this would generate:
      
      	cmplwi 0, 3, 5
      	li 12, 8
      	li 4, 7
      	isel 3, 4, 12, 2
      	rldicl 3, 3, 0, 32
      	blr
      
      where the 'rldicl 3, 3, 0, 32', the extension, is completely unnecessary. At
      least for the single-BB case (which is all that the DAG combine mechanism can
      handle), this unnecessary extension is no longer generated.
      
      llvm-svn: 202600
      46043edc
  4. Feb 28, 2014
    • Hal Finkel's avatar
      Swap PPC isel operands to allow for 0-folding · b998915e
      Hal Finkel authored
      The PPC isel instruction can fold 0 into the first operand (thus eliminating
      the need to materialize a zero-containing register when the 'true' result of
      the isel is 0). When the isel is fed by a bit register operation that we can
      invert, do so as part of the bit-register-operation peephole routine.
      
      llvm-svn: 202469
      b998915e
    • Hal Finkel's avatar
      Trying to unbreak the darwin11 builder · 5cae2168
      Hal Finkel authored
      The CR bit tracking code broke PPC/Darwin; trying to get it working again...
      
      (the darwin11 builder, which defaults to the darwin ABI when running PPC tests,
      asserted when running test/CodeGen/PowerPC/inverted-bool-compares.ll)
      
      llvm-svn: 202459
      5cae2168
    • Hal Finkel's avatar
      Try to unbreak the C++11 build · b39a0475
      Hal Finkel authored
      Cannot use negative numbers in case statements without running afoul of -Wc++11-narrowing.
      
      llvm-svn: 202455
      b39a0475
    • Hal Finkel's avatar
      Add CR-bit tracking to the PowerPC backend for i1 values · 940ab934
      Hal Finkel authored
      This change enables tracking i1 values in the PowerPC backend using the
      condition register bits. These bits can be treated on PowerPC as separate
      registers; individual bit operations (and, or, xor, etc.) are supported.
      Tracking booleans in CR bits has several advantages:
      
       - Reduction in register pressure (because we no longer need GPRs to store
         boolean values).
      
       - Logical operations on booleans can be handled more efficiently; we used to
         have to move all results from comparisons into GPRs, perform promoted
         logical operations in GPRs, and then move the result back into condition
         register bits to be used by conditional branches. This can be very
         inefficient, because the throughput of these CR <-> GPR moves have high
         latency and low throughput (especially when other associated instructions
         are accounted for).
      
       - On the POWER7 and similar cores, we can increase total throughput by using
         the CR bits. CR bit operations have a dedicated functional unit.
      
      Most of this is more-or-less mechanical: Adjustments were needed in the
      calling-convention code, support was added for spilling/restoring individual
      condition-register bits, and conditional branch instruction definitions taking
      specific CR bits were added (plus patterns and code for generating bit-level
      operations).
      
      This is enabled by default when running at -O2 and higher. For -O0 and -O1,
      where the ability to debug is more important, this feature is disabled by
      default. Individual CR bits do not have assigned DWARF register numbers,
      and storing values in CR bits makes them invisible to the debugger.
      
      It is critical, however, that we don't move i1 values that have been promoted
      to larger values (such as those passed as function arguments) into bit
      registers only to quickly turn around and move the values back into GPRs (such
      as happens when values are returned by functions). A pair of target-specific
      DAG combines are added to remove the trunc/extends in:
        trunc(binary-ops(binary-ops(zext(x), zext(y)), ...)
      and:
        zext(binary-ops(binary-ops(trunc(x), trunc(y)), ...)
      In short, we only want to use CR bits where some of the i1 values come from
      comparisons or are used by conditional branches or selects. To put it another
      way, if we can do the entire i1 computation in GPRs, then we probably should
      (on the POWER7, the GPR-operation throughput is higher, and for all cores, the
      CR <-> GPR moves are expensive).
      
      POWER7 test-suite performance results (from 10 runs in each configuration):
      
      SingleSource/Benchmarks/Misc/mandel-2: 35% speedup
      MultiSource/Benchmarks/Prolangs-C++/city/city: 21% speedup
      MultiSource/Benchmarks/MiBench/automotive-susan: 23% speedup
      SingleSource/Benchmarks/CoyoteBench/huffbench: 13% speedup
      SingleSource/Benchmarks/Misc-C++/Large/sphereflake: 13% speedup
      SingleSource/Benchmarks/Misc-C++/mandel-text: 10% speedup
      
      SingleSource/Benchmarks/Misc-C++-EH/spirit: 10% slowdown
      MultiSource/Applications/lemon/lemon: 8% slowdown
      
      llvm-svn: 202451
      940ab934
  5. Feb 26, 2014
  6. Feb 25, 2014
  7. Feb 21, 2014
  8. Feb 19, 2014
    • Rafael Espindola's avatar
      move getNameWithPrefix and getSymbol to TargetMachine. · a3ad4e69
      Rafael Espindola authored
      TargetLoweringBase is implemented in CodeGen, so before this patch we had
      a dependency fom Target to CodeGen. This would show up as a link failure of
      llvm-stress when building with -DBUILD_SHARED_LIBS=ON.
      
      This fixes pr18900.
      
      llvm-svn: 201711
      a3ad4e69
    • Rafael Espindola's avatar
      Add back r201608, r201622, r201624 and r201625 · daeafb4c
      Rafael Espindola authored
      r201608 made llvm corretly handle private globals with MachO. r201622 fixed
      a bug in it and r201624 and r201625 were changes for using private linkage,
      assuming that llvm would do the right thing.
      
      They all got reverted because r201608 introduced a crash in LTO. This patch
      includes a fix for that. The issue was that TargetLoweringObjectFile now has
      to be initialized before we can mangle names of private globals. This is
      trivially true during the normal codegen pipeline (the asm printer does it),
      but LTO has to do it manually.
      
      llvm-svn: 201700
      daeafb4c
    • Daniel Jasper's avatar
      Revert r201622 and r201608. · 7e198ad8
      Daniel Jasper authored
      This causes the LLVMgold plugin to segfault. More information on the
      replies to r201608.
      
      llvm-svn: 201669
      7e198ad8
  9. Feb 18, 2014
    • Rafael Espindola's avatar
      Fix PR18743. · 09dcc6a5
      Rafael Espindola authored
      The IR
      @foo = private constant i32 42
      
      is valid, but before this patch we would produce an invalid MachO from it. It
      was invalid because it would use an L label in a section where the liker needs
      the labels in order to atomize it.
      
      One way of fixing it would be to just reject this IR in the backend, but that
      would not be very front end friendly.
      
      What this patch does is use an 'l' prefix in sections that we know the linker
      requires symbols for atomizing them. This allows frontends to just use
      private and not worry about which sections they go to or how the linker handles
      them.
      
      One small issue with this strategy is that now a symbol name depends on the
      section, which is not available before codegen. This is not a problem in
      practice. The reason is that it only happens with private linkage, which will
      be ignored by the non codegen users (llvm-nm and llvm-ar).
      
      llvm-svn: 201608
      09dcc6a5
    • Rafael Espindola's avatar
      Rename a DebugLoc variable to DbgLoc and a DataLayout to DL. · ea09c595
      Rafael Espindola authored
      This is quiet a bit less confusing now that TargetData was renamed DataLayout.
      
      llvm-svn: 201606
      ea09c595
  10. Feb 13, 2014
    • Daniel Sanders's avatar
      Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove... · 753e1762
      Daniel Sanders authored
      Re-commit: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call
      
      Summary:
      AsmPrinter::EmitInlineAsm() will no longer use the EmitRawText() call for
      targets with mature MC support. Such targets will always parse the inline
      assembly (even when emitting assembly). Targets without mature MC support
      continue to use EmitRawText() for assembly output.
      
      The hasRawTextSupport() check in AsmPrinter::EmitInlineAsm() has been replaced
      with MCAsmInfo::UseIntegratedAs which when true, causes the integrated assembler
      to parse inline assembly (even when emitting assembly output). UseIntegratedAs
      is set to true for targets that consider any failure to parse valid assembly
      to be a bug. Target specific subclasses generally enable the integrated
      assembler in their constructor. The default value can be overridden with
      -no-integrated-as.
      
      All tests that rely on inline assembly supporting invalid assembly (for example,
      those that use mnemonics such as 'foo' or 'hello world') have been updated to
      disable the integrated assembler.
      
      Changes since review (and last commit attempt):
      - Fixed test failures that were missed due to configuration of local build.
        (fixes crash.ll and a couple others).
      - Fixed tests that happened to pass because the local build was on X86
        (should fix 2007-12-17-InvokeAsm.ll)
      - mature-mc-support.ll's should no longer require all targets to be compiled.
        (should fix ARM and PPC buildbots)
      - Object output (-filetype=obj and similar) now forces the integrated assembler
        to be enabled regardless of default setting or -no-integrated-as.
        (should fix SystemZ buildbots)
      
      Reviewers: rafael
      
      Reviewed By: rafael
      
      CC: llvm-commits
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2686
      
      llvm-svn: 201333
      753e1762
  11. Feb 12, 2014
    • Daniel Sanders's avatar
      Revert r201237+r201238: Demote EmitRawText call in AsmPrinter::EmitInlineAsm()... · abe212a3
      Daniel Sanders authored
      Revert r201237+r201238: Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call
      
      It introduced multiple test failures in the buildbots.
      
      llvm-svn: 201241
      abe212a3
    • Daniel Sanders's avatar
      Demote EmitRawText call in AsmPrinter::EmitInlineAsm() and remove hasRawTextSupport() call · a7d504cf
      Daniel Sanders authored
      Summary:
      AsmPrinter::EmitInlineAsm() will no longer use the EmitRawText() call for targets with mature MC support. Such targets will always parse the inline assembly (even when emitting assembly). Targets without mature MC support continue to use EmitRawText() for assembly output.
      
      The hasRawTextSupport() check in AsmPrinter::EmitInlineAsm() has been replaced with MCAsmInfo::UseIntegratedAs which when true, causes the integrated assembler to parse inline assembly (even when emitting assembly output). UseIntegratedAs is set to true for targets that consider any failure to parse valid assembly to be a bug. Target specific subclasses generally enable the integrated assembler in their constructor. The default value can be overridden with -no-integrated-as.
      
      All tests that rely on inline assembly supporting invalid assembly (for example, those that use mnemonics such as 'foo' or 'hello world') have been updated to disable the integrated assembler.
      
      Reviewers: rafael
      
      Reviewed By: rafael
      
      CC: llvm-commits
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2686
      
      llvm-svn: 201237
      a7d504cf
  12. Feb 08, 2014
  13. Feb 06, 2014
  14. Feb 05, 2014
  15. Feb 02, 2014
    • Hal Finkel's avatar
      Replace PPC instruction-size code with MCInstrDesc getSize · a7bbaf6d
      Hal Finkel authored
      As part of the cleanup done to enable the disassembler, the PPC instructions
      now have a valid Size description field. This can now be used to replace some
      custom logic in a few places to compute instruction sizes.
      
      Patch by David Wiberg!
      
      llvm-svn: 200623
      a7bbaf6d
  16. Jan 29, 2014
  17. Jan 28, 2014
  18. Jan 26, 2014
Loading