Skip to content
  1. Aug 28, 2017
    • Craig Topper's avatar
      [X86] Use getUnpackl helper to create an ISD::VECTOR_SHUFFLE instead of using... · 33681161
      Craig Topper authored
      [X86] Use getUnpackl helper to create an ISD::VECTOR_SHUFFLE instead of using X86ISD::UNPCKL in reduceVMULWidth.
      
      This runs fairly early, we should use target independent nodes if possible.
      
      llvm-svn: 311873
      33681161
    • Craig Topper's avatar
      [X86] Add an early out to combineLoopMAddPattern and combineLoopSADPattern when SSE2 is disabled. · 2c77011d
      Craig Topper authored
      Without this the madd.ll and sad.ll test cases both throw assertions if you run them with SSE2 disabled.
      
      llvm-svn: 311872
      2c77011d
    • Lang Hames's avatar
      [Error] Add a handleExpected utility. · 5d06c23d
      Lang Hames authored
      handleExpected is similar to handleErrors, but takes an Expected<T> as its first
      input value and a fallback functor as its second, followed by an arbitary list
      of error handlers (equivalent to the handler list of handleErrors). If the first
      input value is a success value then it is returned from handleErrors
      unmodified. Otherwise the contained error(s) are passed to handleErrors, along
      with the handlers. If handleErrors returns success (indicating that all errors
      have been handled) then handleExpected runs the fallback functor and returns its
      result. If handleErrors returns a failure value then the failure value is
      returned and the fallback functor is never run.
      
      This simplifies the process of re-trying operations that return Expected values.
      Without this utility such retry logic is cumbersome as the internal Error must
      be explicitly extracted from the Expected value, inspected to see if its
      handleable and then consumed:
      
      enum FooStrategy { Aggressive, Conservative };
      Expected<Foo> tryFoo(FooStrategy S);
      
      Expected<Foo> Result;
      (void)!!Result; // "Check" Result so that it can be safely overwritten.
      if (auto ValOrErr = tryFoo(Aggressive))
        Result = std::move(ValOrErr);
      else {
        auto Err = ValOrErr.takeError();
        if (Err.isA<HandleableError>()) {
          consumeError(std::move(Err));
          Result = tryFoo(Conservative);
        } else
          return std::move(Err);
      }
      
      with handleExpected, this can be re-written as:
      
      auto Result =
        handleExpected(
          tryFoo(Aggressive),
          []() { return tryFoo(Conservative); },
          [](HandleableError&) { /* discard to handle */ });
      
      llvm-svn: 311870
      5d06c23d
    • Dehao Chen's avatar
      revert r310985 which breaks for the following case: · 191b24d3
      Dehao Chen authored
      struct string {
        ~string();
      };
      void f2();
      void f1(int) { f2(); }
      void run(int c) {
        string body;
        while (true) {
          if (c)
            f1(c);
          else
            f1(c);
        }
      }
      
      Will recommit once the issue is fixed.
      
      llvm-svn: 311864
      191b24d3
  2. Aug 27, 2017
  3. Aug 26, 2017
  4. Aug 25, 2017
Loading