[llvm] 7591d21 - [PowerPC] fix a miscompile for Solaris build

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 29 05:06:37 PDT 2021


Author: Chen Zheng
Date: 2021-10-29T12:06:25Z
New Revision: 7591d2103222d712b589600a7f7bc19683152bdd

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

LOG: [PowerPC] fix a miscompile for Solaris build

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
index 1728857de383a..9641a9af5063d 100644
--- a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
+++ b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
@@ -494,7 +494,7 @@ bool PPCLoopInstrFormPrep::prepareBasesForCommoningChains(Bucket &CBucket) {
   // All elements are increased by FirstOffset.
   // The number of chains should be sqrt(EleNum).
   if (!SawChainSeparater)
-    ChainNum = (unsigned)sqrt(EleNum);
+    ChainNum = (unsigned)sqrt((double)EleNum);
 
   CBucket.ChainSize = (unsigned)(EleNum / ChainNum);
 


        


More information about the llvm-commits mailing list