Skip to content

Commit b121664

Browse files
committed
Address last round of reviews and rebase
The way we define target-independent builtins has changed which required a rebase. Also cleaned up some comments and improved asserts as suggested in the review.
1 parent eef7dd6 commit b121664

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

clang/lib/Basic/Targets/PPC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo {
361361
}
362362

363363
// We support __builtin_cpu_supports/__builtin_cpu_is on targets that
364-
// have GLIBC since it is GLIBC that provides the HWCAP[2] in the auxv.
364+
// have Glibc since it is Glibc that provides the HWCAP[2] in the auxv.
365365
bool supportsCpuSupports() const override { return getTriple().isOSGlibc(); }
366366
bool supportsCpuIs() const override { return getTriple().isOSGlibc(); }
367367
bool validateCpuSupports(StringRef Feature) const override;

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16552,6 +16552,7 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned BuiltinID,
1655216552
#define PPC_LNX_CPU(Name, NumericID) .Case(Name, NumericID)
1655316553
#include "llvm/TargetParser/PPCTargetParser.def"
1655416554
.Default(-1U);
16555+
assert(NumCPUID < -1U && "Invalid CPU name. Missed by SemaChecking?");
1655516556
Value *Op0 = llvm::ConstantInt::get(Int32Ty, PPC_FAWORD_CPUID);
1655616557
llvm::Function *F = CGM.getIntrinsic(Intrinsic::ppc_fixed_addr_ld);
1655716558
Value *TheCall = Builder.CreateCall(F, {Op0}, "cpu_is");
@@ -16569,6 +16570,7 @@ Value *CodeGenFunction::EmitPPCBuiltinExpr(unsigned BuiltinID,
1656916570
.Case(Name, {FA_WORD, Bitmask})
1657016571
#include "llvm/TargetParser/PPCTargetParser.def"
1657116572
.Default({0, 0});
16573+
assert(BitMask && "Invalid target feature string. Missed by SemaChecking?");
1657216574
Value *Op0 = llvm::ConstantInt::get(Int32Ty, FeatureWord);
1657316575
llvm::Function *F = CGM.getIntrinsic(Intrinsic::ppc_fixed_addr_ld);
1657416576
Value *TheCall = Builder.CreateCall(F, {Op0}, "cpu_supports");

llvm/include/llvm/IR/IntrinsicsPowerPC.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.".
216216
[llvm_float_ty, llvm_float_ty, llvm_float_ty, llvm_vararg_ty],
217217
[IntrNoMem]>;
218218
// Load of a value provided by the system library at a fixed address. Used for
219-
// accessing things like HWCAP word provided by GLIBC. The immediate argument
220-
// is not an address but a value defined in
219+
// accessing things like the HWCAP word provided by Glibc. The immediate
220+
// argument is not an address but a value defined in
221221
// include/llvm/TargetParser/PPCTargetParser.def. Each of the values provided
222222
// by Glibc is a 32-bit word.
223223
def int_ppc_fixed_addr_ld

0 commit comments

Comments
 (0)