[PATCH] D149423: [ValueTracking] Use knownbits interface for determining if `div`/`rem` are safe to speculate

Dmitry Chernenkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 03:07:16 PDT 2023


steelannelida added a comment.

@goldstein.w.n The newest commit seams to break speculate-div.ll test. I'm working on a reproduciton in upstream, but in our setup the 
output is:

  llvm/test/Transforms/LICM/speculate-div.ll:54:15: error: CHECK-NEXT: is not on the line after the previous match
  ; CHECK-NEXT: br label [[LOOP:%.*]]
                ^
  <stdin>:37:2: note: 'next' match was here
   br label %loop
   ^
  <stdin>:35:23: note: previous match ended here
   %x = and i16 %xo, 123
                        ^
  <stdin>:36:1: note: non-matching line after previous match is here
   %div = sdiv i16 %n, %x
  ^
  llvm/test/Transforms/LICM/speculate-div.ll:77:15: error: CHECK-NEXT: is not on the line after the previous match
  ; CHECK-NEXT: br label [[LOOP:%.*]]
                ^
  <stdin>:50:2: note: 'next' match was here
   br label %loop
   ^
  <stdin>:48:20: note: previous match ended here
   %x = or i16 %xx, 1
                     ^
  <stdin>:49:1: note: non-matching line after previous match is here
   %div = srem i16 %n, %x
  ^
  llvm/test/Transforms/LICM/speculate-div.ll:166:15: error: CHECK-NEXT: is not on the line after the previous match
  ; CHECK-NEXT: br label [[LOOP:%.*]]
                ^
  <stdin>:100:2: note: 'next' match was here
   br label %loop
   ^
  <stdin>:98:20: note: previous match ended here
   %x = or i16 %xx, 1
                     ^
  <stdin>:99:1: note: non-matching line after previous match is here
   %div = udiv i16 %n, %x
  ^
  
  Input file: <stdin>
  Check file: llvm/test/Transforms/LICM/speculate-div.ll
  
  -dump-input=help explains the following input dump.
  
  Input was:
  <<<<<<
            .
            .
            .
           32: define void @sdiv_ok(i16 %n, i16 noundef %xx) { 
           33: entry: 
           34:  %xo = or i16 %xx, 1 
           35:  %x = and i16 %xo, 123 
           36:  %div = sdiv i16 %n, %x 
           37:  br label %loop 
  next:54       !~~~~~~~~~~~~~  error: match on wrong line
           38:  
           39: loop: ; preds = %loop, %entry 
           40:  call void @maythrow() 
           41:  call void @use(i16 %div) 
           42:  br label %loop 
           43: } 
           44:  
           45: define void @srem_ok2(i16 noundef %nn, i16 noundef %xx) { 
           46: entry: 
           47:  %n = and i16 %nn, 123 
           48:  %x = or i16 %xx, 1 
           49:  %div = srem i16 %n, %x 
           50:  br label %loop 
  next:77       !~~~~~~~~~~~~~  error: match on wrong line
           51:  
           52: loop: ; preds = %loop, %entry 
           53:  call void @maythrow() 
           54:  call void @use(i16 %div) 
           55:  br label %loop 
            .
            .
            .
           95:  
           96: define void @udiv_ok(i16 %n, i16 noundef %xx) { 
           97: entry: 
           98:  %x = or i16 %xx, 1 
           99:  %div = udiv i16 %n, %x 
          100:  br label %loop 
  next:166      !~~~~~~~~~~~~~  error: match on wrong line
          101:  
          102: loop: ; preds = %loop, %entry 
          103:  call void @maythrow() 
          104:  call void @use(i16 %div) 
          105:  br label %loop 
            .
            .
            .
  >>>>>>


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149423/new/

https://reviews.llvm.org/D149423



More information about the llvm-commits mailing list