[llvm] cb1093b - [NFC] Remove dead code

Guillaume Chatelet via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 08:06:24 PST 2023


Author: Guillaume Chatelet
Date: 2023-02-03T16:06:11Z
New Revision: cb1093b7718ae8594a7f4a7d6fb79a6965aea0f7

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

LOG: [NFC] Remove dead code

Added: 
    

Modified: 
    llvm/lib/IR/ConstantFold.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index 7af33a70d327..9a48f346419e 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -1070,10 +1070,6 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, Constant *C1,
             // appropriate defaults
             if (isa<Function>(GV) && !DL.getFunctionPtrAlign())
               GVAlign = Align(4);
-          } else if (isa<Function>(GV)) {
-            // Without a datalayout we have to assume the worst case: that the
-            // function pointer isn't aligned at all.
-            GVAlign = Align(1);
           } else if (isa<GlobalVariable>(GV)) {
             GVAlign = cast<GlobalVariable>(GV)->getAlign().valueOrOne();
           }


        


More information about the llvm-commits mailing list