[llvm] [SCCP] Add context to SimplifyQuery (PR #100831)

Thomas Hashem via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 07:41:33 PDT 2024


================
@@ -0,0 +1,21 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -passes=sccp -S %s | FileCheck %s
+
+define float @test_ieee() #0 {
+; CHECK-LABEL: @test_ieee(
+; CHECK-NEXT:    ret float 0x36F4000000000000
+;
+  %1 = fmul float 2.802596928649634e-44, 2.000000e+00
----------------
hashemthomas1 wrote:

Understood.
I can work on adding tests that show other optimizations enabled by the context.
Replacing fmul with llvm.canonicalize doesn't reproduce the inconsistent behavior because the context was added to simplifyBinOp (canonicalize is handled elsewhere).
But, if you think the tests shouldn't look like this regardless, I'll work on changing them as well 👍 

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


More information about the llvm-commits mailing list