[PATCH] D59541: [InstSimplify] SimplifyICmpInst - icmp eq/ne %X, undef -> undef

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 06:29:48 PDT 2019


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/Analysis/InstructionSimplify.cpp:3053
+  // predicate pass or fail, so we can return undef.
+  // Also, if both operands are undef, we can return undef.
+  // Matches behavior in llvm::ConstantFoldCompareInstruction.
----------------
If both operands are undef, we should not get here - that should always get constant folded above this.
So I'd remove that line of the code comment. You could add an assert to be extra safe...although that general sequence (handle constant folding first) happens in all or almost all functions within InstSimplify.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D59541





More information about the llvm-commits mailing list