[llvm] Introduce DIExpression::foldConstantMath() (PR #71718)

Shubham Sandeep Rastogi via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 10:33:08 PDT 2024


================
@@ -2011,6 +2010,347 @@ DIExpression::constantFold(const ConstantInt *CI) {
           ConstantInt::get(getContext(), NewInt)};
 }
 
+// Returns true if the Op is a DW_OP_constu.
+static bool isConstantVal(uint64_t Op) { return Op == dwarf::DW_OP_constu; }
+
+// Returns true if an operation and operand result in a No Op.
+static bool isNeutralElement(uint64_t Op, uint64_t Val) {
----------------
rastogishubham wrote:

Yes but what is the difference/advantage of that?

https://github.com/llvm/llvm-project/pull/71718


More information about the llvm-commits mailing list