[llvm] 6f9d990 - [TargetFolder] Use DL-aware folding for icmp

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 06:36:49 PDT 2022


Author: Nikita Popov
Date: 2022-07-13T15:35:13+02:00
New Revision: 6f9d990a6ea8d352dd08bdfa094335077f92bc32

URL: https://github.com/llvm/llvm-project/commit/6f9d990a6ea8d352dd08bdfa094335077f92bc32
DIFF: https://github.com/llvm/llvm-project/commit/6f9d990a6ea8d352dd08bdfa094335077f92bc32.diff

LOG: [TargetFolder] Use DL-aware folding for icmp

The Fold() call was accidentally dropped in
138fcc5f7619b5f066b9529a41ed47695149c8df, though it doesn't seem
to make a difference in practice (no test changes).

Added: 
    

Modified: 
    llvm/include/llvm/Analysis/TargetFolder.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Analysis/TargetFolder.h b/llvm/include/llvm/Analysis/TargetFolder.h
index 5e7e14f226a4..c42577330e9b 100644
--- a/llvm/include/llvm/Analysis/TargetFolder.h
+++ b/llvm/include/llvm/Analysis/TargetFolder.h
@@ -103,7 +103,7 @@ class TargetFolder final : public IRBuilderFolder {
     auto *LC = dyn_cast<Constant>(LHS);
     auto *RC = dyn_cast<Constant>(RHS);
     if (LC && RC)
-      return ConstantExpr::getCompare(P, LC, RC);
+      return Fold(ConstantExpr::getCompare(P, LC, RC));
     return nullptr;
   }
 


        


More information about the llvm-commits mailing list