[PATCH] D154307: [NewGVN] Add test with assume dominating an ICmp. NFC

Manuel Brito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 13 05:43:26 PDT 2023


ManuelJBrito added a comment.

I don't think doing phi-of-ops on the following is valid :

%f.0 = phi i32 [ undef, %entry ], [ %xor, %if.then ], [ %xor, %if.then2 ]
...
%tobool9.not = icmp eq i32 %f.0, 0

  entry:
  %tobool9.not = icmp eq i32 undef, 0 -> undef 
  
  if.then:
  %tobool9.not = icmp eq i32 %xor, 0 -> false (wrong! No way of knowing this!)
  
  if.then2:
  %tobool9.not = icmp eq i32 %xor, 0 -> false ( correct!! From the assume)
  
  
  %tobool9.not -> phi [undef, false, false] -> false ( wrong because of if.then value)

Alive2 proof: https://alive2.llvm.org/ce/z/V5ANuZ
Am I misunderstanding something?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154307



More information about the llvm-commits mailing list