summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Parser/Parser.cpp
diff options
context:
space:
mode:
authorJames Molloy <jmolloy@google.com>2019-11-05 15:10:28 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-11-05 15:11:01 -0800
commit250a11ae0f9b27d3c31c51b5c47a38288fccd39b (patch)
treede2c39fdeaea949d942b9348af48abd32920e329 /mlir/lib/Parser/Parser.cpp
parent6b534ecbcb2450e3b93bb38c738f0847e3077a39 (diff)
downloadbcm5719-llvm-250a11ae0f9b27d3c31c51b5c47a38288fccd39b.tar.gz
bcm5719-llvm-250a11ae0f9b27d3c31c51b5c47a38288fccd39b.zip
[llvm] Allow GlobalOp to take a region for complex initializers
This allows GlobalOp to either take a value attribute (for simple constants) or a region that can contain IR instructions (that must be constant-foldable) to create a ConstantExpr initializer. Example: // A complex initializer is constructed with an initializer region. llvm.mlir.global constant @int_gep() : !llvm<"i32*"> { %0 = llvm.mlir.addressof @g2 : !llvm<"i32*"> %1 = llvm.mlir.constant(2 : i32) : !llvm.i32 %2 = llvm.getelementptr %0[%1] : (!llvm<"i32*">, !llvm.i32) -> !llvm<"i32*"> llvm.return %2 : !llvm<"i32*"> } PiperOrigin-RevId: 278717836
Diffstat (limited to 'mlir/lib/Parser/Parser.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud