Skip to content
  1. Nov 09, 2016
    • Greg Clayton's avatar
      Added the ability to dump hex bytes easily into a raw_ostream. · bde0a163
      Greg Clayton authored
      Unit tests were added to verify this functionality keeps working correctly.
      
      Example output for raw hex bytes:
      llvm::ArrayRef<uint8_t> Bytes = ...;
      llvm::outs() << format_hex_bytes(Bytes);
      554889e5 4881ec70 04000048 8d051002
      00004c8d 05fd0100 004c8b0d d0020000
      
      Example output for raw hex bytes with offsets:
      llvm::outs() << format_hex_bytes(Bytes, 0x100000d10);
      0x0000000100000d10: 554889e5 4881ec70 04000048 8d051002
      0x0000000100000d20: 00004c8d 05fd0100 004c8b0d d0020000
      
      Example output for raw hex bytes with ASCII with offsets:
      llvm::outs() << format_hex_bytes_with_ascii(Bytes, 0x100000d10);
      0x0000000100000d10: 554889e5 4881ec70 04000048 8d051002 |UH.?H.?p...H....|
      0x0000000100000d20: 00004c8d 05fd0100 004c8b0d d0020000 |..L..?...L..?...|
      
      The default groups bytes into 4 byte groups, but this can be changed to 1 byte:
      llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 16 /*NumPerLine*/, 1 /*ByteGroupSize*/);
      0x0000000100000d10: 55 48 89 e5 48 81 ec 70 04 00 00 48 8d 05 10 02
      0x0000000100000d20: 00 00 4c 8d 05 fd 01 00 00 4c 8b 0d d0 02 00 00
      
      llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 16 /*NumPerLine*/, 2 /*ByteGroupSize*/);
      0x0000000100000d10: 5548 89e5 4881 ec70 0400 0048 8d05 1002
      0x0000000100000d20: 0000 4c8d 05fd 0100 004c 8b0d d002 0000
      
      llvm::outs() << format_hex_bytes(Bytes, 0x100000d10, 8 /*NumPerLine*/, 1 /*ByteGroupSize*/);
      0x0000000100000d10: 55 48 89 e5 48 81 ec 70
      0x0000000100000d18: 04 00 00 48 8d 05 10 02
      0x0000000100000d20: 00 00 4c 8d 05 fd 01 00
      0x0000000100000d28: 00 4c 8b 0d d0 02 00 00
      
      https://reviews.llvm.org/D26405
      
      llvm-svn: 286316
      bde0a163
    • Sanjay Patel's avatar
      [InstCombine] fix profitability equation for max-of-nots transform · 4e9d6cd3
      Sanjay Patel authored
      As the test change shows, we can increase the critical path by adding
      a 'not' instruction, so make sure that we're actually removing an
      instruction if we do this transform.
      
      This transform could also cause us to miss folds of min/max pairs.
      
      llvm-svn: 286315
      4e9d6cd3
    • Sanjay Patel's avatar
      [InstCombine] reduce indentation; NFC · 99dc5fef
      Sanjay Patel authored
      llvm-svn: 286314
      99dc5fef
  2. Nov 08, 2016
Loading