1. Jan 27, 2015
    • Ben Langmuir's avatar
      Fix assert instantiating string init of static variable · 577b3934
      Ben Langmuir authored
      ... when the variable's type is a typedef of a ConstantArrayType. Just
      look through the typedef (and any other sugar).  We only use the
      constant array type here to get the element count.
      
      llvm-svn: 227115
      577b3934
    • Eric Christopher's avatar
      Update for LLVM API change. · 611dfed9
      Eric Christopher authored
      llvm-svn: 227114
      611dfed9
    • Eric Christopher's avatar
      Move DataLayout back to the TargetMachine from TargetSubtargetInfo · 8b770651
      Eric Christopher authored
      derived classes.
      
      Since global data alignment, layout, and mangling is often based on the
      DataLayout, move it to the TargetMachine. This ensures that global
      data is going to be layed out and mangled consistently if the subtarget
      changes on a per function basis. Prior to this all targets(*) have
      had subtarget dependent code moved out and onto the TargetMachine.
      
      *One target hasn't been migrated as part of this change: R600. The
      R600 port has, as a subtarget feature, the size of pointers and
      this affects global data layout. I've currently hacked in a FIXME
      to enable progress, but the port needs to be updated to either pass
      the 64-bitness to the TargetMachine, or fix the DataLayout to
      avoid subtarget dependent features.
      
      llvm-svn: 227113
      8b770651
    • Philip Reames's avatar
      Refine memory dependence's notion of volatile semantics · a7ad6a58
      Philip Reames authored
      According to my reading of the LangRef, volatiles are only ordered with respect to other volatiles. It is entirely legal and profitable to forward unrelated loads over the volatile load. This patch implements this for GVN by refining the transition rules MemoryDependenceAnalysis uses when encountering a volatile.
      
      The added test cases show where the extra flexibility is profitable for local dependence optimizations. I have a related change (227110) which will extend this to non-local dependence (i.e. PRE), but that's essentially orthogonal to the semantic change in this patch. I have tested the two together and can confirm that PRE works over a volatile load with both changes.  I will be submitting a PRE w/volatiles test case seperately in the near future.
      
      Differential Revision: http://reviews.llvm.org/D6901
      
      llvm-svn: 227112
      a7ad6a58
    • Sanjay Patel's avatar
      Model sqrtsd as a binary operation with one source operand tied to the destination (PR14221) · 805bc02c
      Sanjay Patel authored
      This patch fixes the following miscompile:
      
      define void @sqrtsd(<2 x double> %a) nounwind uwtable ssp {
        %0 = tail call <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double> %a) nounwind 
        %a0 = extractelement <2 x double> %0, i32 0
        %conv = fptrunc double %a0 to float
        %a1 = extractelement <2 x double> %0, i32 1
        %conv3 = fptrunc double %a1 to float
        tail call void @callee2(float %conv, float %conv3) nounwind
        ret void
      }
      
      Current codegen:
      
      sqrtsd	%xmm0, %xmm1        ## high element of %xmm1 is undef here
      xorps	%xmm0, %xmm0
      cvtsd2ss	%xmm1, %xmm0
      shufpd	$1, %xmm1, %xmm1
      cvtsd2ss	%xmm1, %xmm1 ## operating on undef value
      jmp	_callee
      
      This is a continuation of http://llvm.org/viewvc/llvm-project?view=revision&revision=224624 ( http://reviews.llvm.org/D6330 ) 
      which was itself a continuation of r167064 ( http://llvm.org/viewvc/llvm-project?view=revision&revision=167064 ).
      
      All of these patches are partial fixes for PR14221 ( http://llvm.org/bugs/show_bug.cgi?id=14221 ); 
      this should be the final patch needed to resolve that bug.
      
      Differential Revision: http://reviews.llvm.org/D6885
      
      llvm-svn: 227111
      805bc02c
    • Philip Reames's avatar
      Pass QueryInst down through non-local dependency calculation · 32351455
      Philip Reames authored
      This change is mostly motivated by exposing information about the original query instruction to the actual scanning work in getPointerDependencyFrom when used by GVN PRE. In a follow up change, I will use this to be more precise with regards to the semantics of volatile instructions encountered in the scan of a basic block.
      
      Worth noting, is that this change (despite appearing quite simple) is not semantically preserving. By providing more information to the helper routine, we allow some optimizations to kick in that weren't previously able to (when called from this code path.) In particular, we see that treatment of !invariant.load becomes more precise. In theory, we might see a difference with an ordered/atomic instruction as well, but I'm having a hard time actually finding a test case which shows that.
      
      Test wise, I've included new tests for !invariant.load which illustrate this difference. I've also included some updated TBAA tests which highlight that this change isn't needed for that optimization to kick in - it's handled inside alias analysis itself. 
      
      Eventually, it would be nice to factor the !invariant.load handling inside alias analysis as well.
      
      Differential Revision: http://reviews.llvm.org/D6895
      
      llvm-svn: 227110
      32351455
    • Philip Reames's avatar
      Revert GCStrategy ownership changes · 56a03938
      Philip Reames authored
      This change reverts the interesting parts of 226311 (and 227046).  This change introduced two problems, and I've been convinced that an alternate approach is preferrable anyways.
      
      The bugs were:
      - Registery appears to require all users be within the same linkage unit.  After this change, asking for "statepoint-example" in Transform/ would sometimes get you nullptr, whereas asking the same question in CodeGen would return the right GCStrategy.  The correct long term fix is to get rid of the utter hack which is Registry, but I don't have time for that right now.  227046 appears to have been an attempt to fix this, but I don't believe it does so completely.
      - GCMetadataPrinter::finishAssembly was being called more than once per GCStrategy.  Each Strategy was being added to the GCModuleInfo multiple times.
      
      Once I get time again, I'm going to split GCModuleInfo into the gc.root specific part and a GCStrategy owning Analysis pass.  I'm probably also going to kill off the Registry.  Once that's done, I'll move the new GCStrategyAnalysis and all built in GCStrategies into Analysis.  (As original suggested by Chandler.)  This will accomplish my original goal of being able to access GCStrategy from Transform/  without adding all of the builtin GCs to IR/.  
      
      llvm-svn: 227109
      56a03938
    • Zachary Turner's avatar
      Teach raw_ostream to support hex formatting without a prefix '0x'. · 39571b37
      Zachary Turner authored
      Previously using format_hex() would always print a 0x prior to the
      hex characters.  This allows this to be optional, so that one can
      choose to print (e.g.) 255 as either 0xFF or just FF.
      
      Differential Revision: http://reviews.llvm.org/D7151
      
      llvm-svn: 227108
      39571b37
    • Eric Fiselier's avatar
      Change the available features used for no-rtti and no-exceptions · 6ffc9bf6
      Eric Fiselier authored
      llvm-svn: 227107
      6ffc9bf6
    • Viktor Kutuzov's avatar
      [Msan] Disable the ppoll unit test on FreeBSD · e8dd0ca4
      Viktor Kutuzov authored
      Differential Revision: http://reviews.llvm.org/D7145
      
      llvm-svn: 227106
      e8dd0ca4
    • Alex Rosenberg's avatar
      Remove trailing whitespace. NFC ® · f298f16c
      Alex Rosenberg authored
      llvm-svn: 227105
      f298f16c
    • Fariborz Jahanian's avatar
      Objective-C SDK modernizer to use NS_ENUM/NS_OPTIONS macros · 4732d43c
      Fariborz Jahanian authored
      with typed enums. rdar://19352510
      
      llvm-svn: 227104
      4732d43c
    • Alex Rosenberg's avatar
      Remove trailing whitespace. · 8108ef0a
      Alex Rosenberg authored
      Also test commit email processing by including this char: '®'
      
      llvm-svn: 227103
      8108ef0a
    • Eric Christopher's avatar
      Move the Mips target to storing the ABI in the TargetMachine rather · a5762816
      Eric Christopher authored
      than on MipsSubtargetInfo.
      
      This required a bit of massaging in the MC level to handle this since
      MC is a) largely a collection of disparate classes with no hierarchy,
      and b) there's no overarching equivalent to the TargetMachine, instead
      only the subtarget via MCSubtargetInfo (which is the base class of
      TargetSubtargetInfo).
      
      We're now storing the ABI in both the TargetMachine level and in the
      MC level because the AsmParser and the TargetStreamer both need to
      know what ABI we have to parse assembly and emit objects. The target
      streamer has a pointer to the one in the asm parser and is updated
      when the asm parser is created. This is fragile as the FIXME comment
      notes, but shouldn't be a problem in practice since we always
      create an asm parser before attempting to emit object code via the
      assembler. The TargetMachine now contains the ABI so that the DataLayout
      can be constructed dependent upon ABI.
      
      All testcases have been updated to use the -target-abi command line
      flag so that we can set the ABI without using a subtarget feature.
      
      Should be no change visible externally here.
      
      llvm-svn: 227102
      a5762816
    • Eric Christopher's avatar
      6e4ed49d
    • Viktor Kutuzov's avatar
      [Msan] Fix the statfs unit test to pass on FreeBSD · 965918e7
      Viktor Kutuzov authored
      Differential Revision: http://reviews.llvm.org/D7144
      
      llvm-svn: 227100
      965918e7
    • Daniel Berlin's avatar
      Fix incorrect partial aliasing · 16f7a526
      Daniel Berlin authored
      Update testcases
      
      llvm-svn: 227099
      16f7a526
    • Daniel Berlin's avatar
      Fix delegation · 8f10e387
      Daniel Berlin authored
      llvm-svn: 227098
      8f10e387
    • Marshall Clow's avatar
      07ef8e67
    • Zachary Turner's avatar
      Fix darwin-debug build in cmake (OS X) · 0bf09687
      Zachary Turner authored
      This patch fixes test_launch_in_terminal test which doesn't work
      in OS X since the moment as it was added in r225284. The test fails
      because Target::Launch returns the following error: "the darwin-debug
      executable doesn't exist at
      <output_dir>/lib/python2.7/site-packages/lldb/darwin-debug'".
      
      Patch by Ilia K
      Differential Revision: http://reviews.llvm.org/D7102
      
      llvm-svn: 227096
      0bf09687
    • Sanjay Patel's avatar
      fix line-endings; NFC · 078b612d
      Sanjay Patel authored
      llvm-svn: 227095
      078b612d
    • Michael J. Spencer's avatar
    • Chris Bieneman's avatar
      Putting all the standard tool options into a "Generic" category. · 831fc5e8
      Chris Bieneman authored
      Summary:
      This puts all the options that CommandLine.cpp implements into a category so that the APIs to hide options can not hide based on the generic category instead of string matching a partial list of argument strings.
      
      This patch is pretty simple and straight forward but it does impact the -help output of all tools using cl::opt. Specifically the options implemented in CommandLine.cpp (help, help-list, help-hidden, help-list-hidden, print-options, print-all-options, version) are all grouped together into an Option category, and these options are never hidden by the cl::HideUnrelatedOptions API.
      
      Reviewers: dexonsmith, chandlerc, majnemer
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D7150
      
      llvm-svn: 227093
      831fc5e8
  2. Jan 26, 2015