Skip to content
Snippets Groups Projects
  • Bill Wendling's avatar
    Match this pattern so that we can generate simpler code: · 94f299f2
    Bill Wendling authored
      %a = ...
      %b = and i32 %a, 2
      %c = srl i32 %b, 1
      %d = br i32 %c, 
    
    into
    
      %a = ...
      %b = and %a, 2
      %c = X86ISD::CMP %b, 0
      %d = X86ISD::BRCOND %c ...
    
    This applies only when the AND constant value has one bit set and the SRL
    constant is equal to the log2 of the AND constant. The back-end is smart enough
    to convert the result into a TEST/JMP sequence.
    
    llvm-svn: 67728
    94f299f2