Skip to content
  • Evan Cheng's avatar
    Added optimization that narrow load / op / store and the 'op' is a bit... · a9cda8ab
    Evan Cheng authored
    Added optimization that narrow load / op / store and the 'op' is a bit twiddling instruction and its second operand is an immediate. If bits that are touched by 'op' can be done with a narrower instruction, reduce the width of the load and store as well. This happens a lot with bitfield manipulation code.
    e.g.
    orl     $65536, 8(%rax)
    =>
    orb     $1, 10(%rax)
    
    Since narrowing is not always a win, e.g. i32 -> i16 is a loss on x86, dag combiner consults with the target before performing the optimization.
    
    llvm-svn: 72507
    a9cda8ab
Loading