summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2016-07-02 11:41:39 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2016-07-02 11:41:39 +0000
commit3bc1edf95ba7ec0ed52d80e5f18f167360d44427 (patch)
tree17093af9a6c069a04948ba0e2e3373a3b824345a /llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
parent270cf12b3ba8fb2c2e4e424582725344eda6f9eb (diff)
downloadbcm5719-llvm-3bc1edf95ba7ec0ed52d80e5f18f167360d44427.tar.gz
bcm5719-llvm-3bc1edf95ba7ec0ed52d80e5f18f167360d44427.zip
Use arrays or initializer lists to feed ArrayRefs instead of SmallVector where possible.
No functionality change intended. llvm-svn: 274431
Diffstat (limited to 'llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp')
-rw-r--r--llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
index de11ae2e31c..5cc51cd7a99 100644
--- a/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
+++ b/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp
@@ -179,7 +179,6 @@ static bool isZeroLengthArray(Type *Ty) {
bool XCoreLowerThreadLocal::lowerGlobal(GlobalVariable *GV) {
Module *M = GV->getParent();
- LLVMContext &Ctx = M->getContext();
if (!GV->isThreadLocal())
return false;
@@ -210,11 +209,8 @@ bool XCoreLowerThreadLocal::lowerGlobal(GlobalVariable *GV) {
Function *GetID = Intrinsic::getDeclaration(GV->getParent(),
Intrinsic::xcore_getid);
Value *ThreadID = Builder.CreateCall(GetID, {});
- SmallVector<Value *, 2> Indices;
- Indices.push_back(Constant::getNullValue(Type::getInt64Ty(Ctx)));
- Indices.push_back(ThreadID);
- Value *Addr =
- Builder.CreateInBoundsGEP(NewGV->getValueType(), NewGV, Indices);
+ Value *Addr = Builder.CreateInBoundsGEP(NewGV->getValueType(), NewGV,
+ {Builder.getInt64(0), ThreadID});
U->replaceUsesOfWith(GV, Addr);
}
OpenPOWER on IntegriCloud