summaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorMatthias Guenther <mrguenther@google.com>2025-08-07 08:52:03 -0700
committerGitHub <noreply@github.com>2025-08-07 17:52:03 +0200
commitde2bac367ff9da74191bd2de130e4a81db07ae08 (patch)
tree6ca687345d7b0abd5776ab868571b43044a73a01 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent6f272d1ecf70fc555efb1a0c601095031d5b2ca9 (diff)
[MLIR] Allow `constFoldBinaryOp` to fold `(T1, T1) -> T2` (#151410)
The `constFoldBinaryOp` helper function had limited support for different input and output types, but the static type of the underlying value (e.g. `APInt`) had to match between the inputs and the output. This worked fine for int comparisons of the form `(intN, intN) -> int1`, as the static type signature was `(APInt, APInt) -> APInt`. However, float comparisons map `(floatN, floatN) -> int1`, with a static type signature of `(APFloat, APFloat) -> APInt`. This use case wasn't supported by `constFoldBinaryOp`. `constFoldBinaryOp` now accepts an optional template argument overriding the return type in case it differs from the input type. If the new template argument isn't provided, the default behavior is unchanged (i.e. the return type will be assumed to match the input type). `constFoldUnaryOp` received similar changes in order to support folding non-cast ops of the form `(T1) -> T2` (e.g. a `sign` op mapping `(floatN) -> sint32`).
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
0 files changed, 0 insertions, 0 deletions