[all-commits] [llvm/llvm-project] 812970: [InstCombine] replace undef in vector constant for...

RotateRight via All-commits all-commits at lists.llvm.org
Thu Apr 9 05:22:59 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 812970edda3617fcee98729fc33e2ca8d226a01d
      https://github.com/llvm/llvm-project/commit/812970edda3617fcee98729fc33e2ca8d226a01d
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-04-09 (Thu, 09 Apr 2020)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/vector-xor.ll

  Log Message:
  -----------
  [InstCombine] replace undef in vector constant for safe shift transform (PR45447)

As noted in PR45447, we have a vector-constant-with-undef-element transform bug:
https://bugs.llvm.org/show_bug.cgi?id=45447

We replace undefs with a safe constant (0 or -1) based on the (non-)negative
predicate constraint.

So this is correct:
http://volta.cs.utah.edu:8080/z/WZE36H
...but this is not:
http://volta.cs.utah.edu:8080/z/boj8gJ

Previously, we were relying on getSafeVectorConstantForBinop() in the related fold (D76800).
But that's making an assumption about what qualifies as "safe", and that assumption may
not always hold.

Differential Revision: https://reviews.llvm.org/D77739




More information about the All-commits mailing list