[llvm] 9f27f45 - [NFC][SROA] `speculateSelectInstLoads()`: play nice with typed pointers for now

Yung, Douglas via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 19:48:53 PST 2022


Hi Roman,

Your change is causing the test llvm/test/Transforms/SROA/addrspacecast.ll to fail on many bots. Can you take a look and revert if you need time to investigate so that we can get the bots back to green?

https://lab.llvm.org/buildbot/#/builders/188/builds/23914
https://lab.llvm.org/buildbot/#/builders/245/builds/2623
https://lab.llvm.org/buildbot/#/builders/231/builds/6476
https://lab.llvm.org/buildbot/#/builders/121/builds/26427
https://lab.llvm.org/buildbot/#/builders/230/builds/7127
https://lab.llvm.org/buildbot/#/builders/109/builds/54036
https://lab.llvm.org/buildbot/#/builders/98/builds/29515
https://lab.llvm.org/buildbot/#/builders/16/builds/40719
https://lab.llvm.org/buildbot/#/builders/139/builds/33250
https://lab.llvm.org/buildbot/#/builders/216/builds/14836
https://lab.llvm.org/buildbot/#/builders/196/builds/23676
https://lab.llvm.org/buildbot/#/builders/3/builds/18816
https://lab.llvm.org/buildbot/#/builders/6/builds/18852
https://lab.llvm.org/buildbot/#/builders/9/builds/18865

Douglas Yung

-----Original Message-----
From: llvm-commits <llvm-commits-bounces at lists.llvm.org> On Behalf Of Roman Lebedev via llvm-commits
Sent: Tuesday, December 20, 2022 18:18
To: llvm-commits at lists.llvm.org
Subject: [llvm] 9f27f45 - [NFC][SROA] `speculateSelectInstLoads()`: play nice with typed pointers for now


Author: Roman Lebedev
Date: 2022-12-21T05:17:02+03:00
New Revision: 9f27f4536e19e93349b0662338408efe6d1cb2fd

URL: https://urldefense.com/v3/__https://github.com/llvm/llvm-project/commit/9f27f4536e19e93349b0662338408efe6d1cb2fd__;!!JmoZiZGBv3RvKRSx!__mKUp0_R34U7Ttw7mt8sNh_7syq3xQamOacETaTGnpB20CeWnu4Zj-CPUJdYeDsOCGI3zlsQABLjObmwhNOddhv8q5z$
DIFF: https://urldefense.com/v3/__https://github.com/llvm/llvm-project/commit/9f27f4536e19e93349b0662338408efe6d1cb2fd.diff__;!!JmoZiZGBv3RvKRSx!__mKUp0_R34U7Ttw7mt8sNh_7syq3xQamOacETaTGnpB20CeWnu4Zj-CPUJdYeDsOCGI3zlsQABLjObmwhNOdYwgJCpF$ 

LOG: [NFC][SROA] `speculateSelectInstLoads()`: play nice with typed pointers for now

As requested in https://urldefense.com/v3/__https://reviews.llvm.org/D138238*inline-1356685__;Iw!!JmoZiZGBv3RvKRSx!__mKUp0_R34U7Ttw7mt8sNh_7syq3xQamOacETaTGnpB20CeWnu4Zj-CPUJdYeDsOCGI3zlsQABLjObmwhNOdeK8J5dG$ 

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/SROA.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp
index 1bea80b69bc52..350e8bdc09314 100644
--- a/llvm/lib/Transforms/Scalar/SROA.cpp
+++ b/llvm/lib/Transforms/Scalar/SROA.cpp
@@ -1518,6 +1518,14 @@ static void speculateSelectInstLoads(SelectInst &SI, LoadInst &LI,
 
   assert(LI.isSimple() && "We only speculate simple loads");
 
+  if (auto *TypedPtrTy = LI.getType()->getPointerTo();
+      SI.getType() != TypedPtrTy) {
+    TV = BitCastInst::CreatePointerBitCastOrAddrSpaceCast(TV, TypedPtrTy, "",
+                                                          &LI);
+    FV = BitCastInst::CreatePointerBitCastOrAddrSpaceCast(FV, TypedPtrTy, "",
+                                                          &LI);  }
+
   IRB.SetInsertPoint(&LI);
   LoadInst *TL =
       IRB.CreateAlignedLoad(LI.getType(), TV, LI.getAlign(),


        
_______________________________________________
llvm-commits mailing list
llvm-commits at lists.llvm.org
https://urldefense.com/v3/__https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits__;!!JmoZiZGBv3RvKRSx!__mKUp0_R34U7Ttw7mt8sNh_7syq3xQamOacETaTGnpB20CeWnu4Zj-CPUJdYeDsOCGI3zlsQABLjObmwhNOdbLn16O5$ 


More information about the llvm-commits mailing list