[PATCH] D75801: [InstCombine] Remove known bits constant folding

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 20 04:51:16 PDT 2020


lebedev.ri added a comment.

SGTM, but i'll defer to @spatel.



================
Comment at: test/Analysis/ValueTracking/known-signbit-shift.ll:46
+; CHECK-NEXT:    [[SEL:%.*]] = select i1 [[B:%.*]], i32 2147221504, i32 2146959360
+; CHECK-NEXT:    ret i32 [[SEL]]
 ;
----------------
nikic wrote:
> I missed these Analysis test changes before. The shl here is poison because we know it wraps based on known bits. This optimization gets lost now.
> 
> I could add it back explicitly (and better, by returning undef rather than zero) like this: https://gist.github.com/nikic/29135f304f7cf9de6d18dff7ca12659a
> 
> I'm not sure whether that's worthwhile though, it seems that these tests are more about not crashing due to conflicting known bits than anything else.
This still seems like worthwhile fold.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75801





More information about the llvm-commits mailing list