[PATCH] D60656: [LVI][CVP] Calculate with.overflow result range
    Roman Lebedev via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sat Apr 13 14:25:38 PDT 2019
    
    
  
lebedev.ri added a comment.
Similarly, looks ok, but someone familiar with LVI/CVP should review.
================
Comment at: llvm/lib/Analysis/LazyValueInfo.cpp:1083-1087
+  Instruction::BinaryOps BinOp;
+  switch (II->getIntrinsicID()) {
+    case Intrinsic::uadd_with_overflow:
+    case Intrinsic::sadd_with_overflow:
+      BinOp = Instruction::Add;
----------------
This seems like a repetitive, emergent pattern.
Would it make sense to add some function somewhere to return `std::pair<Instruction::BinaryOps, unsigned /*WrapType*/>` given `IntrinsicID`?
Repository:
  rL LLVM
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60656/new/
https://reviews.llvm.org/D60656
    
    
More information about the llvm-commits
mailing list