[PATCH] D42100: Fix codegen of stores of vectors with non byte-sized elements.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 04:20:57 PST 2018


jonpa added a comment.

First attempt, which seems to work, sort of:

Most failing tests regenerated (as they had already been generated previously), except for two tests:

Failing Tests (2):

  LLVM :: CodeGen/SystemZ/vec-move-17.ll
  LLVM :: CodeGen/X86/pr32108.ll

During these tests, an assert triggers in SelectionDAG::computeKnownBits(). It seems somewhere there is a mixup of integer width where identical widths are assumed:

  (gdb) p Known
  $92 = (llvm::KnownBits &) @0x3ffffffb930: {Zero = {static WORD_MAX = 18446744073709551615, U = {
        VAL = 4294967294, pVal = 0xfffffffe}, BitWidth = 32}, One = {
      static WORD_MAX = 18446744073709551615, U = {VAL = 1, pVal = 0x1}, BitWidth = 32}}
  (gdb) p Known2
  $93 = {Zero = {static WORD_MAX = 18446744073709551615, U = {VAL = 0, pVal = 0x0}, BitWidth = 64},
    One = {static WORD_MAX = 18446744073709551615, U = {VAL = 0, pVal = 0x0}, BitWidth = 64}}
  
      // Output known-1 bits are only known if set in both the LHS & RHS.                                                                                                                                             
      Known.One &= Known2.One;
  ->
    APInt &operator&=(const APInt &RHS) {
      assert(BitWidth == RHS.BitWidth && "Bit widths must be the same");

I am guessing that my new code is probably missing some kind of flag, but I am not sure exactly what the fix is...

(SystemZ/vec-move-17.ll was previously just supposed to compile, but now there should probably be some test as well once it actually compiles with patch).

The tests I have gathered so far are right now in CodeGen/Generic/store_nonbytesized_vecs.ll. They seem to be correctly handled by CodeGen, but I am hoping that you will help to verify this, as well as give a suggestion as to where this test should be placed. In SystemZ run just for that target, or in Generic run by multiple targets, perhaps? Currently, I just added the generated output by update_llc_test_checks.py for SystemZ.


https://reviews.llvm.org/D42100





More information about the llvm-commits mailing list