[PATCH] D149390: [NFC][EarlyCSE]Modify test case to ensure branch weights are preserved with cse.

David Li via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 22:07:30 PDT 2023


davidxl added a comment.

How about  test cases with PRE of calls? (on the other hand, I think those cases are non trivial to support ).

a = pure_call();
if (cond) {

   b = pure_call();
  ..

}

>
-

a = pure_call();
if (cond) {

  b = a;

}

and

if (cond) {

  b = pure_call();

}
 a = pure_call();

>
-

if (cond) {

  t = pure_call();
  b = t;

} else {

  t = pure_call();

}
 a = t;

And LICM case:

for (...) {

  sum += pure_call();

}

>
-

t = pure_call();  
for (...) {

  sum += t;

}


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149390



More information about the llvm-commits mailing list