github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. 
:warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions h,cpp -- 
clang/include/clang/Basic/TargetInfo.h 
llvm/include/llvm/Transforms/Utils/ModuleUtils.h 
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp 
llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp 
llvm/lib/Target/PowerPC/PPCISelLowering.cpp 
llvm/lib/Target/PowerPC/PPCTargetMachine.cpp 
llvm/lib/Target/PowerPC/PPCTargetMachine.h 
llvm/lib/Transforms/Utils/LowerIFunc.cpp 
llvm/lib/Transforms/Utils/ModuleUtils.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/include/llvm/Transforms/Utils/ModuleUtils.h 
b/llvm/include/llvm/Transforms/Utils/ModuleUtils.h
index 6be7ac80d..2734422ba 100644
--- a/llvm/include/llvm/Transforms/Utils/ModuleUtils.h
+++ b/llvm/include/llvm/Transforms/Utils/ModuleUtils.h
@@ -162,8 +162,8 @@ lowerGlobalIFuncUsersAsGlobalCtor(Module &M,
 /// AIX specific lowering of ifuncs where we convert an ifunc to a regular
 /// function with the following implementation:
 ///  Check if the function's descriptor still points to itself (true on first
-/// entry), if so then call the resolver function and atomically store the 
-/// resulting function pointer into the descriptor. Make an indirect call 
+/// entry), if so then call the resolver function and atomically store the
+/// resulting function pointer into the descriptor. Make an indirect call
 /// through the function pointer in the descriptor.
 LLVM_ABI void lowerIFuncsOnAIX(Module &M);
 } // End llvm namespace
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp 
b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 957b2b3e7..8b9b49756 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -764,7 +764,7 @@ static MCSymbol *getMCSymbolForTOCPseudoMO(const 
MachineOperand &MO,
   case MachineOperand::MO_BlockAddress:
     return AP.GetBlockAddressSymbol(MO.getBlockAddress());
   case MachineOperand::MO_MCSymbol:
-     return MO.getMCSymbol();
+    return MO.getMCSymbol();
   default:
     llvm_unreachable("Unexpected operand type to get symbol.");
   }
@@ -1047,7 +1047,8 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr 
*MI) {
     TmpInst.setOpcode(PPC::LWZ);
 
     const MachineOperand &MO = MI->getOperand(1);
-    assert((MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isBlockAddress() 
|| MO.isMCSymbol()) &&
+    assert((MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isBlockAddress() ||
+            MO.isMCSymbol()) &&
            "Invalid operand for LWZtoc.");
 
     // Map the operand to its corresponding MCSymbol.
@@ -1131,7 +1132,8 @@ void PPCAsmPrinter::emitInstruction(const MachineInstr 
*MI) {
     TmpInst.setOpcode(PPC::LD);
 
     const MachineOperand &MO = MI->getOperand(1);
-    assert((MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isBlockAddress() 
|| MO.isMCSymbol()) &&
+    assert((MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isBlockAddress() ||
+            MO.isMCSymbol()) &&
            "Invalid operand!");
 
     // Map the operand to its corresponding MCSymbol.
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp 
b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index bbdd573f4..63e951ce1 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -11185,12 +11185,13 @@ SDValue 
PPCTargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op,
       SDValue EntryPointSym = DAG.getMCSymbol(S, PtrVT);
       return getTOCEntry(DAG, dl, EntryPointSym);
     }
-    assert (Op1.getOpcode() == ISD::CopyFromReg);
+    assert(Op1.getOpcode() == ISD::CopyFromReg);
     SDLoc dl(Op);
     EVT PtrVT = getPointerTy(DAG.getDataLayout());
-    SDValue Result = DAG.getLoad(
-            PtrVT, dl, DAG.getEntryNode(), Op1, MachinePointerInfo(), 
DAG.getDataLayout().getPointerABIAlignment(0),
-            MachineMemOperand::MODereferenceable);
+    SDValue Result =
+        DAG.getLoad(PtrVT, dl, DAG.getEntryNode(), Op1, MachinePointerInfo(),
+                    DAG.getDataLayout().getPointerABIAlignment(0),
+                    MachineMemOperand::MODereferenceable);
     return Result;
   }
   case Intrinsic::thread_pointer:
diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp 
b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
index d8e840912..a2d8bca66 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -456,11 +456,12 @@ public:
 
 void PPCTargetMachine::registerPassBuilderCallbacks(PassBuilder &PB) {
   if (getTargetTriple().isOSAIX())
-    PB.registerOptimizerLastEPCallback(
-        [](ModulePassManager &PM, OptimizationLevel Level, ThinOrFullLTOPhase 
Phase) {
-          if (Phase == ThinOrFullLTOPhase::None)
-            PM.addPass(LowerIFuncPass());
-        });
+    PB.registerOptimizerLastEPCallback([](ModulePassManager &PM,
+                                          OptimizationLevel Level,
+                                          ThinOrFullLTOPhase Phase) {
+      if (Phase == ThinOrFullLTOPhase::None)
+        PM.addPass(LowerIFuncPass());
+    });
 }
 
 TargetPassConfig *PPCTargetMachine::createPassConfig(PassManagerBase &PM) {
diff --git a/llvm/lib/Transforms/Utils/ModuleUtils.cpp 
b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
index 67da3e66c..10e898bf2 100644
--- a/llvm/lib/Transforms/Utils/ModuleUtils.cpp
+++ b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
@@ -11,8 +11,8 @@
 
//===----------------------------------------------------------------------===//
 
 #include "llvm/Transforms/Utils/ModuleUtils.h"
-#include "llvm/Analysis/VectorUtils.h"
 #include "llvm/ADT/SmallString.h"
+#include "llvm/Analysis/VectorUtils.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/IRBuilder.h"
@@ -409,7 +409,8 @@ void llvm::lowerIFuncsOnAIX(Module &M) {
 
     // Create the regular (non-ifunc) function:
     //   define rt-type @foo(type1 %0, type2 %1)
-    Function *F = Function::Create(FTy, IFunc.getLinkage(), 
IFunc.getAddressSpace(), IFunc.getName(), &M);
+    Function *F = Function::Create(
+        FTy, IFunc.getLinkage(), IFunc.getAddressSpace(), IFunc.getName(), &M);
     LLVMContext &Ctx = F->getContext();
 
     // entry:
@@ -418,17 +419,25 @@ void llvm::lowerIFuncsOnAIX(Module &M) {
 
     PointerType *PtrTy = Builder.getPtrTy();
     //   %DescPtr = call ptr @ppc_get_function_descriptor(ptr noundef @foo)
-    auto *DescPtr = Builder.CreateIntrinsic(/*RetTy*/ PtrTy, 
Intrinsic::ppc_get_function_descriptor, {F}, {}, "desc.ptr");
+    auto *DescPtr = Builder.CreateIntrinsic(
+        /*RetTy*/ PtrTy, Intrinsic::ppc_get_function_descriptor, {F}, {},
+        "desc.ptr");
 
-    //   %DesctAddr = getelementptr inbounds %struct.Desc_t, ptr %DescPtr, i32 
0, i32 0
+    //   %DesctAddr = getelementptr inbounds %struct.Desc_t, ptr %DescPtr, i32
+    //   0, i32 0
     StructType *DescriptorType = StructType::get(PtrTy, PtrTy, PtrTy);
-    auto *DesctAddr = Builder.CreateStructGEP(DescriptorType, DescPtr, 0, 
"desc_t.addr");
+    auto *DesctAddr =
+        Builder.CreateStructGEP(DescriptorType, DescPtr, 0, "desc_t.addr");
 
     //   %AddrInDesc = load ptr, ptr %DesctAddr, align 4
-    auto *AddrInDesc = Builder.CreateAlignedLoad(PtrTy, DesctAddr, 
DesctAddr->getPointerAlignment(M.getDataLayout()), "addr.in.desc");
+    auto *AddrInDesc = Builder.CreateAlignedLoad(
+        PtrTy, DesctAddr, DesctAddr->getPointerAlignment(M.getDataLayout()),
+        "addr.in.desc");
 
     //   %OriginalAddr = call ptr @ppc_get_function_entry(ptr noundef @foo) #3
-    auto *OriginalAddr = Builder.CreateIntrinsic(/*RetTy*/ PtrTy, 
Intrinsic::ppc_get_function_entry, {F}, {}, "original.addr");
+    auto *OriginalAddr = Builder.CreateIntrinsic(
+        /*RetTy*/ PtrTy, Intrinsic::ppc_get_function_entry, {F}, {},
+        "original.addr");
 
     //   %cmp = icmp eq ptr %AddrInDesc, %OriginalAddr
     auto *CMP = Builder.CreateICmpEQ(AddrInDesc, OriginalAddr);
@@ -447,11 +456,16 @@ void llvm::lowerIFuncsOnAIX(Module &M) {
     //   %4 = ptrtoint ptr %ResolvedAddr to i32
     //   store atomic i32 %4, ptr %desc_t.addr release, align 4
     Function *ResolverFunc = IFunc.getResolverFunction();
-    auto *ResolvedFunc = Builder.CreateCall(ResolverFunc, ArrayRef<Value *>(), 
"resolved.func");
-    auto *ResolvedAddr = Builder.CreateIntrinsic(/*RetTy*/ PtrTy, 
Intrinsic::ppc_get_function_entry, {ResolvedFunc}, {}, "resolved.addr");
-    auto *PtrToInt = Builder.CreatePtrToInt(ResolvedAddr, 
Builder.getIntPtrTy(M.getDataLayout()));
+    auto *ResolvedFunc =
+        Builder.CreateCall(ResolverFunc, ArrayRef<Value *>(), "resolved.func");
+    auto *ResolvedAddr = Builder.CreateIntrinsic(
+        /*RetTy*/ PtrTy, Intrinsic::ppc_get_function_entry, {ResolvedFunc}, {},
+        "resolved.addr");
+    auto *PtrToInt = Builder.CreatePtrToInt(
+        ResolvedAddr, Builder.getIntPtrTy(M.getDataLayout()));
     // TODO fix alignment
-    Builder.CreateAlignedStore(PtrToInt, DesctAddr, 
MaybeAlign())->setAtomic(AtomicOrdering::Release);
+    Builder.CreateAlignedStore(PtrToInt, DesctAddr, MaybeAlign())
+        ->setAtomic(AtomicOrdering::Release);
 
     //   br label %if.end
     Builder.CreateBr(FinalBlock);
@@ -461,8 +475,9 @@ void llvm::lowerIFuncsOnAIX(Module &M) {
 
     //   %res = musttail call i32 %DescPtr(i32 noundef %a) #3
     SmallVector<Value *, 10> Args(make_pointer_range(F->args()));
-    CallInst *Result = Builder.CreateCall(F->getFunctionType(), DescPtr, Args, 
"res");
-    //Result->setTailCallKind(CallInst::TCK_MustTail);
+    CallInst *Result =
+        Builder.CreateCall(F->getFunctionType(), DescPtr, Args, "res");
+    // Result->setTailCallKind(CallInst::TCK_MustTail);
 
     //   ret i32 %res
     if (F->getReturnType()->isVoidTy())

``````````

</details>


https://github.com/llvm/llvm-project/pull/153049
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to